Changeset 3051655
- Timestamp:
- 03/15/2024 11:44:03 AM (13 months ago)
- Location:
- gdpr-compliance/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
gdpr-compliance/trunk/README.txt
r2436755 r3051655 2 2 Contributors: scribit 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=GDPR Compliance Wordpress plugin donation&no_note=0 4 Tags: GDPR, compliance, data, protection, users, privacy, regulation, european, eea, legislation4 Tags: GDPR, compliance, protection, privacy, legislation 5 5 Requires at least: 4.0 6 Tested up to: 5.6.07 Stable tag: 1. 2.56 Tested up to: 6.4.3 7 Stable tag: 1.3.0 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 40 40 41 41 == Changelog == 42 43 = 1.3.0 = 44 * Security fixes 45 * CSV download enabled only for users with "edit_users" capability 46 * Removed "user_pass" from visible and downloadable informations 47 * Removed sensible usermeta parameters from visible and downloadable informations 48 * Wordpress 6.4.3 compatibility 42 49 43 50 = 1.2.5 = -
gdpr-compliance/trunk/admin/class-gdpr-compliance-admin.php
r2436755 r3051655 162 162 public function gdpr_compliance_user_table_row($val, $column_name, $user_id) 163 163 { 164 if (!current_user_can( 'edit_users' )) return $val; 165 164 166 switch ($column_name) { 165 167 case 'download_gdpr_data': … … 186 188 public function gdpr_compliance_userdata_download() 187 189 { 190 if (!current_user_can( 'edit_users' )) return false; 191 188 192 if (isset($_GET['user_id']) && is_numeric($_GET['user_id'])) { 189 193 $user_id = $_GET['user_id']; … … 209 213 210 214 $user_fields = array(); 211 foreach ($settings['others'] as $field => $setting) { 212 if ($setting['enabled'] && $this->startsWith($field, $wpdb->prefix .'users')) { // Include only users table 213 $user_fields[$field] = $setting; 214 } 215 } 215 if (isset($settings)) 216 foreach ($settings['others'] as $field => $setting) { 217 if ($setting['enabled'] && $this->startsWith($field, $wpdb->prefix .'users')) { // Include only users table 218 $user_fields[$field] = $setting; 219 } 220 } 216 221 217 222 $usermeta_fields = array(); 218 foreach ($settings['usermetas'] as $usermeta => $setting) { 219 if ($setting['enabled']) { 220 $usermeta_fields[$usermeta] = $setting['desc']; 221 } 222 } 223 if (isset($settings)) 224 foreach ($settings['usermetas'] as $usermeta => $setting) { 225 if ($setting['enabled']) { 226 $usermeta_fields[$usermeta] = $setting['desc']; 227 } 228 } 223 229 224 230 if (count($user_fields) > 0 || count($usermeta_fields) > 0) { … … 292 298 $postmeta_fields_desc = array(); 293 299 294 foreach ($settings['types'] as $postmeta => $setting) { 295 if ($setting['enabled']) { 296 $meta_fields = explode('.', $postmeta); // Every postmeta should be composed as: posttype.metakey 297 298 if (count($meta_fields) == 2) { 299 $postmeta_fields_desc[$meta_fields[0]]['metas'][$meta_fields[1]] = $setting['desc']; 300 } elseif (count($meta_fields) == 1) { 301 $postmeta_fields_desc[$meta_fields[0]]['desc'] = $setting['desc']; 302 } 303 } 304 } 300 if (isset($settings)) 301 foreach ($settings['types'] as $postmeta => $setting) { 302 if ($setting['enabled']) { 303 $meta_fields = explode('.', $postmeta); // Every postmeta should be composed as: posttype.metakey 304 305 if (count($meta_fields) == 2) { 306 $postmeta_fields_desc[$meta_fields[0]]['metas'][$meta_fields[1]] = $setting['desc']; 307 } elseif (count($meta_fields) == 1) { 308 $postmeta_fields_desc[$meta_fields[0]]['desc'] = $setting['desc']; 309 } 310 } 311 } 305 312 306 313 if (count($postmeta_fields_desc) > 0) { … … 374 381 375 382 $other_fields_desc = array(); 376 foreach ($settings['others'] as $field => $setting) { 377 if ($setting['enabled']) { 378 if ($this->startsWith($field, $wpdb->prefix .'users')) { 379 continue; 380 } // Esclude users table 381 382 $table_fields = explode('.', $field); // Every information should be composed as: tablename.fieldname 383 if (count($table_fields) < 1 || count($table_fields) > 2) { 384 continue; 385 } 386 387 if (!isset($other_fields_desc[$table_fields[0]])) { 388 $other_fields_desc[$table_fields[0]] = array(); 389 } 390 391 if (count($table_fields) == 2) { 392 $other_fields_desc[$table_fields[0]]['fields'][$table_fields[1]] = $setting['desc']; 393 } else { 394 $other_fields_desc[$table_fields[0]]['desc'] = $setting['desc']; 395 } 396 } 397 } 383 if (isset($settings)) 384 foreach ($settings['others'] as $field => $setting) { 385 if ($setting['enabled']) { 386 if ($this->startsWith($field, $wpdb->prefix .'users')) { 387 continue; 388 } // Esclude users table 389 390 $table_fields = explode('.', $field); // Every information should be composed as: tablename.fieldname 391 if (count($table_fields) < 1 || count($table_fields) > 2) { 392 continue; 393 } 394 395 if (!isset($other_fields_desc[$table_fields[0]])) { 396 $other_fields_desc[$table_fields[0]] = array(); 397 } 398 399 if (count($table_fields) == 2) { 400 $other_fields_desc[$table_fields[0]]['fields'][$table_fields[1]] = $setting['desc']; 401 } else { 402 $other_fields_desc[$table_fields[0]]['desc'] = $setting['desc']; 403 } 404 } 405 } 398 406 399 407 if (count($other_fields_desc) > 0) { -
gdpr-compliance/trunk/admin/partials/gdpr-compliance-admin-display-users-data.php
r2205887 r3051655 15 15 if (isset($_POST['submit'])) { 16 16 $res = true; 17 $nonce = $_POST['nonce']; 18 19 if ( wp_verify_nonce( $_POST['nonce'], 'gdpr-compliance-admin-menu-save' ) ){ 20 21 //print_r($_POST); echo '<br/><br/>'; 22 17 $nonce = sanitize_text_field(wp_unslash($_POST['nonce'])); 18 19 if ( wp_verify_nonce( $nonce, 'gdpr-compliance-admin-menu-save' ) ){ 23 20 // Sanitizing 24 21 $settings['types'] = array(); … … 35 32 36 33 update_option( GDPR_COMPLIANCE_USERDATA_SETTINGNAME, json_encode($settings) ); 37 38 34 } 39 35 else $res = false; … … 81 77 <?php $table_with_userid_columns = $wpdb->get_results("SELECT table_name AS 'table', column_name AS 'column' 82 78 FROM information_schema.columns 83 WHERE table_schema = '{$wpdb->dbname}' AND table_name = '{$wpdb->prefix}users' ");79 WHERE table_schema = '{$wpdb->dbname}' AND table_name = '{$wpdb->prefix}users' And column_name != 'user_pass'"); 84 80 $table_with_userid_example = $wpdb->get_results("SELECT * 85 81 FROM {$wpdb->prefix}users … … 119 115 FROM {$wpdb->prefix}usermeta u1 120 116 WHERE CONCAT('',meta_value * 1) <> meta_value 121 AND meta_value 122 NOT IN ('true', 'false', '', 'a:0:{}')117 AND meta_value NOT IN ('true', 'false', '', 'a:0:{}') 118 AND meta_key NOT LIKE '{$wpdb->prefix}%_capabilities' AND meta_key != 'session_tokens' 123 119 GROUP BY meta_key", ARRAY_A); 124 120 ?> -
gdpr-compliance/trunk/gdpr-compliance-consts.php
r2436755 r3051655 8 8 */ 9 9 10 define( 'GDPR_COMPLIANCE_VERSION', '1. 2.5' );10 define( 'GDPR_COMPLIANCE_VERSION', '1.3.0' ); 11 11 12 12 if (!defined('GDPR_COMPLIANCE_USERDATA_SETTINGNAME')) -
gdpr-compliance/trunk/gdpr-compliance.php
r2436755 r3051655 17 17 * Plugin URI: https://www.scribit.it/en/wordpress-open-source-plugins/ 18 18 * Description: This plugin helps webmasters to accomplish the european GDPR (data protection regulation) allowing users to manage their personal data. 19 * Version: 1. 2.519 * Version: 1.3.0 20 20 * Author: Scribit 21 21 * Author URI: https://www.scribit.it/ -
gdpr-compliance/trunk/public/class-gdpr-compliance-public.php
r2436755 r3051655 120 120 // Note: I must mantain users table settings into "others" setting array for retrocompatibility (<=1.1.0) 121 121 $user_fields = array(); 122 foreach($settings['others'] as $field => $setting) 123 if ( $setting['enabled'] && $this->startsWith($field, $wpdb->prefix .'users') ) // Include only users table 122 foreach($settings['others'] as $field => $setting){ 123 // Include only users table fields, excluding user_pass 124 if ( $setting['enabled'] && $this->startsWith($field, $wpdb->prefix .'users') && ($field != $wpdb->prefix .'users.user_pass')) 124 125 $user_fields[$field] = $setting; 126 } 125 127 126 128 $usermeta_fields = array(); … … 166 168 FROM {$wpdb->prefix}usermeta 167 169 WHERE user_id = %d 168 AND meta_key in ('". $usermeta_fields_string ."')", $current_user->ID) 170 AND meta_key IN ('$usermeta_fields_string') 171 AND meta_key NOT LIKE '{$wpdb->prefix}%_capabilities' AND meta_key != 'session_tokens'", 172 $current_user->ID) 169 173 , ARRAY_A ); 170 174
Note: See TracChangeset
for help on using the changeset viewer.