diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index b5a0c4f10a..9407f1a986 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -990,6 +990,24 @@ function wp_notify_moderator($comment_id) { } endif; +if ( !function_exists('wp_password_change_notification') ) : +/** + * Notify the blog admin of a user changing password, normally via email. + * + * @since 2.7 + * + * @param object $user User Object + */ +function wp_password_change_notification(&$user) { + // send a copy of password change notification to the admin + // but check to see if it's the admin whose password we're changing, and skip this + if ( $user->user_email != get_option('admin_email') ) { + $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n"; + wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message); + } +} +endif; + if ( !function_exists('wp_new_user_notification') ) : /** * Notify the blog admin of a new user, normally via email. @@ -1562,4 +1580,4 @@ function wp_text_diff( $left_string, $right_string, $args = null ) { } endif; -?> \ No newline at end of file +?> diff --git a/wp-login.php b/wp-login.php index 32f3b55dcf..a84202d970 100644 --- a/wp-login.php +++ b/wp-login.php @@ -190,12 +190,7 @@ function reset_password($key) { if ( !wp_mail($user->user_email, sprintf(__('[%s] Your new password'), get_option('blogname')), $message) ) die('

' . __('The e-mail could not be sent.') . "
\n" . __('Possible reason: your host may have disabled the mail() function...') . '

'); - // send a copy of password change notification to the admin - // but check to see if it's the admin whose password we're changing, and skip this - if ( $user->user_email != get_option('admin_email') ) { - $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n"; - wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message); - } + wp_password_change_notification($user); return true; } @@ -508,4 +503,4 @@ try{document.getElementById('user_login').focus();}catch(e){} break; } // end action switch -?> \ No newline at end of file +?>