~ubuntu-branches/debian/sid/wordpress/sid

« back to all changes in this revision

Viewing changes to wp-admin/includes/user.php

  • Committer: Package Import Robot
  • Author(s): Craig Small
  • Date: 2014-09-05 20:58:06 UTC
  • mfrom: (1.2.38)
  • Revision ID: package-import@ubuntu.com-20140905205806-e4h6dkg4190n0svf
Tags: 4.0+dfsg-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 * @return int user id of the updated user
29
29
 */
30
30
function edit_user( $user_id = 0 ) {
31
 
        global $wp_roles, $wpdb;
 
31
        global $wp_roles;
32
32
        $user = new stdClass;
33
33
        if ( $user_id ) {
34
34
                $update = true;
390
390
 */
391
391
function default_password_nag_handler($errors = false) {
392
392
        global $user_ID;
393
 
        if ( ! get_user_option('default_password_nag') ) //Short circuit it.
 
393
        // Short-circuit it.
 
394
        if ( ! get_user_option('default_password_nag') )
394
395
                return;
395
396
 
396
 
        //get_user_setting = JS saved UI setting. else no-js-fallback code.
 
397
        // get_user_setting = JS saved UI setting. else no-js-fallback code.
397
398
        if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) {
398
399
                delete_user_setting('default_password_nag');
399
400
                update_user_option($user_ID, 'default_password_nag', false, true);
401
402
}
402
403
 
403
404
add_action('profile_update', 'default_password_nag_edit_user', 10, 2);
 
405
 
404
406
/**
405
407
 * @since 2.8.0
406
408
 */
407
409
function default_password_nag_edit_user($user_ID, $old_data) {
408
 
        if ( ! get_user_option('default_password_nag', $user_ID) ) //Short circuit it.
 
410
        // Short-circuit it.
 
411
        if ( ! get_user_option('default_password_nag', $user_ID) )
409
412
                return;
410
413
 
411
414
        $new_data = get_userdata($user_ID);
412
415
 
413
 
        if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed.
 
416
        // Remove the nag if the password has been changed.
 
417
        if ( $new_data->user_pass != $old_data->user_pass ) {
414
418
                delete_user_setting('default_password_nag');
415
419
                update_user_option($user_ID, 'default_password_nag', false, true);
416
420
        }
417
421
}
418
422
 
419
423
add_action('admin_notices', 'default_password_nag');
 
424
 
420
425
/**
421
426
 * @since 2.8.0
422
427
 */
423
428
function default_password_nag() {
424
429
        global $pagenow;
425
 
        if ( 'profile.php' == $pagenow || ! get_user_option('default_password_nag') ) //Short circuit it.
 
430
        // Short-circuit it.
 
431
        if ( 'profile.php' == $pagenow || ! get_user_option('default_password_nag') )
426
432
                return;
427
433
 
428
434
        echo '<div class="error default-password-nag">';