Make WordPress Core


Ignore:
Timestamp:
05/03/2009 05:06:29 PM (16 years ago)
Author:
westi
Message:

Add a nag message if the user is still using an auto-generated password. See #9710 props DD32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/user.php

    r11109 r11162  
    792792endif;
    793793
     794add_action('admin_init', 'default_password_nag_handler');
     795function default_password_nag_handler() {
     796    if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) {     
     797        global $user_ID;
     798        delete_user_setting('default_password_nag');
     799        update_usermeta($user_ID, 'default_password_nag', false);
     800    }
     801}
     802add_action('admin_notices', 'default_password_nag');
     803function default_password_nag() {
     804    global $user_ID;
     805    if ( ! get_usermeta($user_ID, 'default_password_nag') )
     806        return;
     807
     808    echo '<div class="error default-password-nag"><p>';
     809    printf(__("Howdy, you're still using the auto-generated password for your account. We recommend that you change it to something you'll remember easier.  Would you like to do this now?<br />
     810              <a href='%s'>Yes, Take me to my profile page</a> | <a href='%s' id='default-password-nag-no'>No Thanks, Do not remind me again.</a>"), admin_url('profile.php') . '#password', '?default_password_nag=0');
     811    echo '</p></div>';
     812}
     813
    794814?>
Note: See TracChangeset for help on using the changeset viewer.