aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-10-16 11:16:06 +0200
committerMarc Alexander <admin@m-a-styles.de>2016-10-16 11:16:06 +0200
commit20148e4d062019f9a1024f9afae905a4851d9aff (patch)
tree2f050c7d46362e4b81e48cae5ed5b92fb8fb9d91 /phpBB/includes/acp
parent1dd0ceabf6e3cdc49ea6a2abe3ad8fcece4cca31 (diff)
downloadforums-20148e4d062019f9a1024f9afae905a4851d9aff.tar
forums-20148e4d062019f9a1024f9afae905a4851d9aff.tar.gz
forums-20148e4d062019f9a1024f9afae905a4851d9aff.tar.bz2
forums-20148e4d062019f9a1024f9afae905a4851d9aff.tar.xz
forums-20148e4d062019f9a1024f9afae905a4851d9aff.zip
[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
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_users.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 1e453e88ad..008cc02471 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -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);