diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2004-02-05 14:35:56 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2004-02-05 14:35:56 +0000 |
commit | b1b6849500a68d703f405f287c5b7d06fc67f756 (patch) | |
tree | 172f2c327e35ebe25b350044fc03d9849aa6810f /phpBB/includes/ucp/ucp_profile.php | |
parent | 79e8f8d2997b271fad7e710d94c2bdc6b618c198 (diff) | |
download | forums-b1b6849500a68d703f405f287c5b7d06fc67f756.tar forums-b1b6849500a68d703f405f287c5b7d06fc67f756.tar.gz forums-b1b6849500a68d703f405f287c5b7d06fc67f756.tar.bz2 forums-b1b6849500a68d703f405f287c5b7d06fc67f756.tar.xz forums-b1b6849500a68d703f405f287c5b7d06fc67f756.zip |
Force password change additions + other updates
git-svn-id: file:///svn/phpbb/trunk@4795 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_profile.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_profile.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 8d384378ef..1fd6efd78d 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -59,14 +59,16 @@ class ucp_profile extends module extract($data); unset($data); - if ($auth->acl_get('u_chgpasswd') && $new_password && md5($password_confirm) != $user->data['user_password']) + if ($auth->acl_get('u_chgpasswd') && $new_password && $password_confirm != $new_password) { $error[] = 'NEW_PASSWORD_ERROR'; } - if ((($auth->acl_get('u_chgemail') && $email != $user->data['user_email']) || ($username != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && md5($cur_password) != $user->data['user_password']) + + if (($new_password || ($auth->acl_get('u_chgemail') && $email != $user->data['user_email']) || ($username != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && md5($cur_password) != $user->data['user_password']) { $error[] = 'CUR_PASSWORD_ERROR'; } + if ($auth->acl_get('u_chgemail') && $email != $user->data['user_email'] && $email_confirm != $email) { $error[] = 'NEW_EMAIL_ERROR'; @@ -75,9 +77,11 @@ class ucp_profile extends module if (!sizeof($error)) { $sql_ary = array( - 'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $username : $user->data['username'], - 'user_email' => ($auth->acl_get('u_chgemail')) ? $email : $user->data['user_email'], - 'user_password' => ($auth->acl_get('u_chgpasswd') && $new_password) ? md5($new_password) : $user->data['user_password'] + 'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $username : $user->data['username'], + 'user_email' => ($auth->acl_get('u_chgemail')) ? $email : $user->data['user_email'], + 'user_email_hash' => ($auth->acl_get('u_chgemail')) ? crc32(strtolower($email)) . strlen($email) : $user->data['user_email_hash'], + 'user_password' => ($auth->acl_get('u_chgpasswd') && $new_password) ? md5($new_password) : $user->data['user_password'], + 'user_passchg' => time(), ); if ($config['email_enable'] && $email != $user->data['user_email'] && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN)) @@ -153,7 +157,7 @@ class ucp_profile extends module ); } - $sql = 'UPDATE ' . USERS_TABLE . ' + echo $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $user->data['user_id']; $db->sql_query($sql); @@ -184,6 +188,7 @@ class ucp_profile extends module 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang['CHANGE_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'S_FORCE_PASSWORD' => ($config['chg_passforce'] && $this->data['user_passchg'] < time() - $config['chg_passforce']) ? true : false, 'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false, 'S_CHANGE_EMAIL' => ($auth->acl_get('u_chgemail')) ? true : false, 'S_CHANGE_PASSWORD' => ($auth->acl_get('u_chgpasswd')) ? true : false) |