Changeset 1881547
- Timestamp:
- 05/25/2018 04:13:29 PM (8 years ago)
- Location:
- jade-gdpr/trunk
- Files:
-
- 2 added
- 3 edited
-
admin (added)
-
admin/jadegdpr-actions.php (added)
-
jadeGDPR.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
-
tabs/notyetreceived.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
jade-gdpr/trunk/jadeGDPR.php
r1877969 r1881547 5 5 Description: Adds a Data Protection consent checkbox to the users' profile. On a Dashboard page, an administrator can see which WordPress users have given, wthdrawn or not yet given consent for their details to be kept. 6 6 Author: E Martin 7 Version: 1. 1.57 Version: 1.2.0 8 8 Tags: gdpr, consent, profile, users 9 9 Text Domain: jade-gdpr … … 33 33 } 34 34 35 /** 36 * Currently plugin version. 37 * Update this as you release new versions. 38 */ 39 define( 'jadeGDPR_VERSION', '1.2.0' ); 40 41 42 require_once plugin_dir_path( __FILE__ ) . 'admin/jadegdpr-actions.php'; 43 44 45 register_activation_hook( __FILE__, 'jadeGDPR_activate' ); 46 register_deactivation_hook( __FILE__, 'jadeGDPR_deactivate' ); 47 register_uninstall_hook(__FILE__, 'jadeGDPR_uninstall'); 48 35 49 // Adds last time the user logged in to wordpress functionalily 36 50 function jadeGDPR_last_login( $user_login, $user ) { 37 update_user_meta( $user->ID, ' last_login', time() );51 update_user_meta( $user->ID, 'jade_last_login', time() ); 38 52 } 39 53 add_action( 'wp_login', 'jadeGDPR_last_login', 10, 2 ); … … 86 100 if ( !current_user_can( 'edit_user', $user_id ) ) 87 101 return FALSE; 88 89 $data = get_user_meta( $user_id, 'data_protection', true );102 103 $data = get_user_meta( $user_id, 'data_protection', true ); 90 104 91 105 if ( $_POST['data_protection'] !== $data ) { … … 102 116 103 117 } 104 105 118 } 106 119 120 121 function jadeGDPR_validate_dataprotection(&$errors, $update = null, &$user = null) 122 { 123 if (!$_POST['data_protection']) 124 { 125 $err_title = __( 'ERROR', 'jade-gdpr' ); 126 $err_msg = __( 'You need to choose a Data Protection option.', 'jade-gdpr' ); 127 128 $errors->add('data_protection', "<strong>$err_title</strong>: $err_msg"); 129 } 130 } 131 add_action( 'user_profile_update_errors', 'jadeGDPR_validate_dataprotection' ); 132 133 107 134 function jadeGDPR_plugin_menu() { 108 135 add_menu_page( … … 118 145 } 119 146 add_action( 'admin_menu', 'jadeGDPR_plugin_menu' ); 147 function jadeGDPR_options_menu() { 148 add_options_page( 'GDPR', 'GDPR', 'edit_users', 'jade-gdpr-options', 'jadeGDPR_options_page'); 149 } 150 add_action( 'admin_menu', 'jadeGDPR_options_menu' ); 151 add_action( 'admin_init', 'jadeGDPR_register_option' ); 152 153 function jadeGDPR_register_option() { 154 register_setting( 'jade_gdpr_options_group', 'jade_gdpr_consent_text' ); 155 } 156 157 function jadeGDPR_options_page() { 158 ?> 159 <div class="wrap"> 160 <h1>Jade GDPR Options Page</h1> 161 <form method="post" action="options.php"> 162 <?php 163 settings_fields( 'jade_gdpr_options_group' ); 164 do_settings_fields( 'jade_gdpr_options_group', '' ); 165 ?> 166 <table class="form-table"> 167 168 <tr> 169 <th scope="row"><label for="jade_gdpr_consent_text">Consent Text</label></th> 170 <td><textarea name="jade_gdpr_consent_text" id="jade_gdpr_consent_text" rows="5" cols="70"><?php echo get_option(' jade_gdpr_consent_text' ); ?></textarea> 171 <p class="description" id="tagline-description">This is the text that explains the consent to the user on their profile.</p></td> 172 </tr> 173 174 </table> 175 <p>Enter Consent profile Text Here:</p> 176 177 178 <?php 179 submit_button(); 180 ?> 181 </form> 182 </div> 183 <?php 184 } 185 120 186 121 187 /** -
jade-gdpr/trunk/readme.txt
r1877943 r1881547 31 31 32 32 == Change log == 33 33 = V1.2.0 - 25/05/2018 34 Added option to change text in user profile. 35 Added Database Cleanup on plugin uninstall. 36 34 37 = V1.1.5 - 20-05-2018 = 35 38 Added Translation Support. -
jade-gdpr/trunk/tabs/notyetreceived.php
r1877941 r1881547 17 17 $login = get_user_meta( $user->ID, 'last_login', true ); 18 18 if ( !empty( $login ) ) { 19 echo '<li> '. $user->first_name.' '.$user->last_name.' - '.$user->user_login.' (Last Login: '. date("d-m-Y H:i", $login ) .')</li>';19 echo '<li><b>'. $user->first_name.' '.$user->last_name.' - '.$user->user_login.' (Last Login: '. date("d-m-Y H:i", $login ) .')</b></li>'; 20 20 } 21 21 else { ?>
Note: See TracChangeset
for help on using the changeset viewer.