Fixed problem where password was cleared even if unchanged

git-svn-id: file:///svn/phpbb/trunk@248 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-05-06 00:25:23 +00:00
parent e6de886e1a
commit 981415805d

View file

@ -326,7 +326,8 @@ switch($mode)
$error = FALSE; $error = FALSE;
if($password && $password_confirm) $passwd_sql = "";
if(!empty($password) && !empty($password_confirm))
{ {
// The user wants to change their password, isn't that cute.. // The user wants to change their password, isn't that cute..
if($password != $password_confirm) if($password != $password_confirm)
@ -337,6 +338,7 @@ switch($mode)
else else
{ {
$password = md5($password); $password = md5($password);
$passwd_sql = ", user_password = '$password'";
} }
} }
else if($password && !$password_confirm) else if($password && !$password_confirm)
@ -344,10 +346,6 @@ switch($mode)
$error = TRUE; $error = TRUE;
$error_msg = $l_mismatch . "<br />" . $l_tryagain; $error_msg = $l_mismatch . "<br />" . $l_tryagain;
} }
else if(!password && !$password_confirm)
{
$password = $userdata['password'];
}
if($board_config['allow_namechange']) if($board_config['allow_namechange'])
{ {
@ -365,7 +363,7 @@ switch($mode)
{ {
$sql = "UPDATE ".USERS_TABLE." $sql = "UPDATE ".USERS_TABLE."
SET username = '$username', user_password = '$password', user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occ', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = '$viewemail', user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = '$attachsig', user_desmile = '$allowsmilies', user_html = '$allowhtml', user_bbcode = '$allowbbcode', user_timezone = '$user_timezone', user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_template = '$user_template', user_theme = '$user_theme' SET username = '$username'".$passwd_sql.", user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occ', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = '$viewemail', user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = '$attachsig', user_desmile = '$allowsmilies', user_html = '$allowhtml', user_bbcode = '$allowbbcode', user_timezone = '$user_timezone', user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_template = '$user_template', user_theme = '$user_theme'
WHERE user_id = '$user_id'"; WHERE user_id = '$user_id'";
if($result = $db->sql_query($sql)) if($result = $db->sql_query($sql))