1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

Merge remote-tracking branch 'nickvergessen/ticket/9361' into develop-olympus

* nickvergessen/ticket/9361:
  [ticket/9361] View correct error messages when editing account information
This commit is contained in:
Andreas Fischer 2011-11-14 19:01:06 +01:00
commit 69f943c8d6
2 changed files with 9 additions and 6 deletions

View File

@ -78,14 +78,14 @@ class ucp_profile
$error = validate_data($data, $check_ary); $error = validate_data($data, $check_ary);
if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password']) if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
{ {
$error[] = 'NEW_PASSWORD_ERROR'; $error[] = ($data['email_confirm']) ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY';
} }
if (($data['new_password'] || ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) || ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && !phpbb_check_hash($data['cur_password'], $user->data['user_password'])) if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
{ {
$error[] = 'CUR_PASSWORD_ERROR'; $error[] = ($data['password_confirm']) ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY';
} }
// Only check the new password against the previous password if there have been no errors // Only check the new password against the previous password if there have been no errors
@ -94,9 +94,9 @@ class ucp_profile
$error[] = 'SAME_PASSWORD_ERROR'; $error[] = 'SAME_PASSWORD_ERROR';
} }
if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email']) if (!phpbb_check_hash($data['cur_password'], $user->data['user_password']))
{ {
$error[] = 'NEW_EMAIL_ERROR'; $error[] = ($data['cur_password']) ? 'CUR_PASSWORD_ERROR' : 'CUR_PASSWORD_EMPTY';
} }
if (!check_form_key('ucp_reg_details')) if (!check_form_key('ucp_reg_details'))

View File

@ -138,6 +138,7 @@ $lang = array_merge($lang, array(
'CURRENT_IMAGE' => 'Current image', 'CURRENT_IMAGE' => 'Current image',
'CURRENT_PASSWORD' => 'Current password', 'CURRENT_PASSWORD' => 'Current password',
'CURRENT_PASSWORD_EXPLAIN' => 'You must confirm your current password if you wish to change it, alter your e-mail address or username.', 'CURRENT_PASSWORD_EXPLAIN' => 'You must confirm your current password if you wish to change it, alter your e-mail address or username.',
'CUR_PASSWORD_EMPTY' => 'You did not enter your current password.',
'CUR_PASSWORD_ERROR' => 'The current password you entered is incorrect.', 'CUR_PASSWORD_ERROR' => 'The current password you entered is incorrect.',
'CUSTOM_DATEFORMAT' => 'Custom…', 'CUSTOM_DATEFORMAT' => 'Custom…',
@ -268,9 +269,11 @@ $lang = array_merge($lang, array(
'MOVE_TO_FOLDER' => 'Move to folder', 'MOVE_TO_FOLDER' => 'Move to folder',
'MOVE_UP' => 'Move up', 'MOVE_UP' => 'Move up',
'NEW_EMAIL_CONFIRM_EMPTY' => 'You did not enter a confirm e-mail address.',
'NEW_EMAIL_ERROR' => 'The e-mail addresses you entered do not match.', 'NEW_EMAIL_ERROR' => 'The e-mail addresses you entered do not match.',
'NEW_FOLDER_NAME' => 'New folder name', 'NEW_FOLDER_NAME' => 'New folder name',
'NEW_PASSWORD' => 'New password', 'NEW_PASSWORD' => 'New password',
'NEW_PASSWORD_CONFIRM_EMPTY' => 'You did not enter a confirm password.',
'NEW_PASSWORD_ERROR' => 'The passwords you entered do not match.', 'NEW_PASSWORD_ERROR' => 'The passwords you entered do not match.',
'NOTIFY_METHOD' => 'Notification method', 'NOTIFY_METHOD' => 'Notification method',
'NOTIFY_METHOD_BOTH' => 'Both', 'NOTIFY_METHOD_BOTH' => 'Both',