Don't reset user cookies when editing other users. Props donncha. fixes #1689
git-svn-id: http://svn.automattic.com/wordpress/trunk@2895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a34a4ca8c7
commit
b03de9abe4
|
@ -74,7 +74,7 @@ function wp_insert_user($userdata) {
|
|||
}
|
||||
|
||||
function wp_update_user($userdata) {
|
||||
global $wpdb;
|
||||
global $wpdb, $current_user;
|
||||
|
||||
$ID = (int) $userdata['ID'];
|
||||
|
||||
|
@ -95,9 +95,11 @@ function wp_update_user($userdata) {
|
|||
$user_id = wp_insert_user($userdata);
|
||||
|
||||
// Update the cookies if the password changed.
|
||||
if ( isset($plaintext_pass) ) {
|
||||
wp_clearcookie();
|
||||
wp_setcookie($userdata['user_login'], $plaintext_pass);
|
||||
if( $current_user->id == $ID ) {
|
||||
if ( isset($plaintext_pass) ) {
|
||||
wp_clearcookie();
|
||||
wp_setcookie($userdata['user_login'], $plaintext_pass);
|
||||
}
|
||||
}
|
||||
|
||||
return $user_id;
|
||||
|
|
Loading…
Reference in New Issue