From fd0b2e7df328ad7a7f210b79b2861c8b551ae761 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Sun, 1 Oct 2006 16:12:53 +0000 Subject: [PATCH] Prevent reuse of previous password git-svn-id: file:///svn/phpbb/trunk@6424 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_profile.php | 6 ++++++ phpBB/language/en/ucp.php | 1 + 2 files changed, 7 insertions(+) diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index e9ef944986..15c7699253 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -83,6 +83,12 @@ class ucp_profile $error[] = 'CUR_PASSWORD_ERROR'; } + // Only check the new password against the previous password if there have been no errors + if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $new_password && md5($new_password) == $user->data['user_password']) + { + $error[] = 'SAME_PASSWORD_ERROR'; + } + if ($auth->acl_get('u_chgemail') && $email != $user->data['user_email'] && $email_confirm != $email) { $error[] = 'NEW_EMAIL_ERROR'; diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index c5838bd015..af50607972 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -368,6 +368,7 @@ $lang = array_merge($lang, array( 'RULE_DELETED' => 'Rule successfully removed', 'RULE_NOT_DEFINED' => 'Rule not correctly specified', + 'SAME_PASSWORD_ERROR' => 'The new password you entered is the same as your current password', 'SEARCH_YOUR_POSTS' => 'Show your posts', 'SEND_PASSWORD' => 'Send password', 'SENT_AT' => 'Sent at',