mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
Merge branch '3.3.x'
This commit is contained in:
@@ -966,10 +966,7 @@ class acp_users
|
||||
|
||||
if ($update_email !== false)
|
||||
{
|
||||
$sql_ary += array(
|
||||
'user_email' => $update_email,
|
||||
'user_email_hash' => phpbb_email_hash($update_email),
|
||||
);
|
||||
$sql_ary += ['user_email' => $update_email];
|
||||
|
||||
$phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_UPDATE_EMAIL', false, array(
|
||||
'reportee_id' => $user_id,
|
||||
|
@@ -263,18 +263,6 @@ function still_on_time($extra_time = 15)
|
||||
return (ceil($current_time - $start_time) < $max_execution_time) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hashes an email address to a big integer
|
||||
*
|
||||
* @param string $email Email address
|
||||
*
|
||||
* @return string Unsigned Big Integer
|
||||
*/
|
||||
function phpbb_email_hash($email)
|
||||
{
|
||||
return sprintf('%u', crc32(strtolower($email))) . strlen($email);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for version_compare() that allows using uppercase A and B
|
||||
* for alpha and beta releases.
|
||||
|
@@ -626,3 +626,17 @@ function phpbb_inet_pton($address)
|
||||
{
|
||||
return inet_pton($address);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hashes an email address to a big integer
|
||||
*
|
||||
* @param string $email Email address
|
||||
*
|
||||
* @return string Unsigned Big Integer
|
||||
*
|
||||
* @deprecated 3.3.0-b2 (To be removed: 4.0.0)
|
||||
*/
|
||||
function phpbb_email_hash($email)
|
||||
{
|
||||
return sprintf('%u', crc32(strtolower($email))) . strlen($email);
|
||||
}
|
||||
|
@@ -206,16 +206,6 @@ function get_group_id($group_name)
|
||||
return $group_mapping['REGISTERED'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the email hash stored in the users table
|
||||
*
|
||||
* Note: Deprecated, calls should directly go to phpbb_email_hash()
|
||||
*/
|
||||
function gen_email_hash($email)
|
||||
{
|
||||
return phpbb_email_hash($email);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a boolean into the appropriate phpBB constant indicating whether the topic is locked
|
||||
*/
|
||||
|
@@ -204,7 +204,6 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)
|
||||
'username_clean' => $username_clean,
|
||||
'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '',
|
||||
'user_email' => strtolower($user_row['user_email']),
|
||||
'user_email_hash' => phpbb_email_hash($user_row['user_email']),
|
||||
'group_id' => $user_row['group_id'],
|
||||
'user_type' => $user_row['user_type'],
|
||||
);
|
||||
@@ -1948,9 +1947,9 @@ function validate_user_email($email, $allowed_email = false)
|
||||
|
||||
if (!$config['allow_emailreuse'])
|
||||
{
|
||||
$sql = 'SELECT user_email_hash
|
||||
$sql = 'SELECT user_email
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_email_hash = " . $db->sql_escape(phpbb_email_hash($email));
|
||||
WHERE user_email = '" . $db->sql_escape($email) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
@@ -131,7 +131,6 @@ class ucp_profile
|
||||
'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $data['username'] : $user->data['username'],
|
||||
'username_clean' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'],
|
||||
'user_email' => ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'],
|
||||
'user_email_hash' => ($auth->acl_get('u_chgemail')) ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'],
|
||||
'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? $passwords_manager->hash($data['new_password']) : $user->data['user_password'],
|
||||
);
|
||||
|
||||
|
@@ -47,7 +47,7 @@ class ucp_resend
|
||||
|
||||
$sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_inactive_reason
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
|
||||
WHERE user_email = '" . $db->sql_escape($email) . "'
|
||||
AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
$user_row = $db->sql_fetchrow($result);
|
||||
|
Reference in New Issue
Block a user