Fix the default password nag clearer to work when an admin sets someone elses password away from the default. Fixes #12334.

git-svn-id: https://develop.svn.wordpress.org/trunk@14608 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2010-05-13 21:08:01 +00:00
parent 728b90a13b
commit 38407f0af5

View File

@ -834,14 +834,13 @@ function default_password_nag_handler($errors = false) {
add_action('profile_update', 'default_password_nag_edit_user', 10, 2); add_action('profile_update', 'default_password_nag_edit_user', 10, 2);
function default_password_nag_edit_user($user_ID, $old_data) { function default_password_nag_edit_user($user_ID, $old_data) {
global $user_ID; if ( ! get_user_option('default_password_nag', $user_ID) ) //Short circuit it.
if ( ! get_user_option('default_password_nag') ) //Short circuit it.
return; return;
$new_data = get_userdata($user_ID); $new_data = get_userdata($user_ID);
if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed. if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed.
delete_user_setting('default_password_nag'); delete_user_setting('default_password_nag', $user_ID);
update_user_option($user_ID, 'default_password_nag', false, true); update_user_option($user_ID, 'default_password_nag', false, true);
} }
} }