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

[ticket/11483] Generate user act key if database entry is empty

The force reactivation action in the ACP will no longer overwrite the
generated activation key in case the key stored in the database is empty.
It will also save the generated key back to the database to actually allow
the activation by the user.

PHPBB3-11483
This commit is contained in:
Marc Alexander 2016-10-16 11:16:06 +02:00
parent 1dd0ceabf6
commit 20148e4d06
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -373,11 +373,6 @@ class acp_users
if ($user_row['user_type'] == USER_NORMAL)
{
user_active_flip('deactivate', $user_id, INACTIVE_REMIND);
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
WHERE user_id = $user_id";
$db->sql_query($sql);
}
else
{
@ -386,8 +381,18 @@ class acp_users
FROM ' . USERS_TABLE . '
WHERE user_id = ' . $user_id;
$result = $db->sql_query($sql);
$user_actkey = (string) $db->sql_fetchfield('user_actkey');
$user_activation_key = (string) $db->sql_fetchfield('user_actkey');
$db->sql_freeresult($result);
$user_actkey = empty($user_activation_key) ? $user_actkey : $user_activation_key;
}
if ($user_row['user_type'] == USER_NORMAL || empty($user_activation_key))
{
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
WHERE user_id = $user_id";
$db->sql_query($sql);
}
$messenger = new messenger(false);