aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_users.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2016-11-06 15:41:59 +0100
committerTristan Darricau <github@nicofuma.fr>2016-11-06 15:41:59 +0100
commitcd348b200a6d3711eee6b8f028d9c7caef268e5f (patch)
tree0a3655b1870d81339c3679cc584de2d3c005f748 /phpBB/includes/acp/acp_users.php
parentecb81894ccefd6b6de3bee6c192497c59524da4e (diff)
parentdc32b900c58943df25ae5085c96ad47fc6e67c61 (diff)
downloadforums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.tar
forums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.tar.gz
forums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.tar.bz2
forums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.tar.xz
forums-cd348b200a6d3711eee6b8f028d9c7caef268e5f.zip
Merge branch '3.1.x' into 3.2.x
* 3.1.x: [ticket/11483] Add tests for generating user act key on force reactivate [ticket/11483] Generate user act key if database entry is empty
Diffstat (limited to 'phpBB/includes/acp/acp_users.php')
-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 f730e7cfbe..fc7f3bb56a 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -371,11 +371,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
{
@@ -384,8 +379,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);