From b68de2323d6444b4b3685a98bbcb9500a38e45cb Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 16 Dec 2009 15:48:23 +0000 Subject: merge changes from 3.0.x branch git-svn-id: file:///svn/phpbb/trunk@10342 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_inactive.php | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'phpBB/includes/acp/acp_inactive.php') diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 3d0c0a2780..1a12c4967c 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -90,22 +90,19 @@ class acp_inactive if ($action == 'activate') { - if ($config['require_activation'] == USER_ACTIVATION_ADMIN) + // Get those 'being activated'... + $sql = 'SELECT user_id, username' . (($config['require_activation'] == USER_ACTIVATION_ADMIN) ? ', user_email, user_lang' : '') . ' + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $mark) . ' + AND user_type = ' . USER_INACTIVE; + $result = $db->sql_query($sql); + + $inactive_users = array(); + while ($row = $db->sql_fetchrow($result)) { - // Get those 'being activated'... - $sql = 'SELECT user_id, username, user_email, user_lang - FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', $mark) . ' - AND user_type = ' . USER_INACTIVE; - $result = $db->sql_query($sql); - - $inactive_users = array(); - while ($row = $db->sql_fetchrow($result)) - { - $inactive_users[] = $row; - } - $db->sql_freeresult($result); + $inactive_users[] = $row; } + $db->sql_freeresult($result); user_active_flip('activate', $mark); @@ -136,6 +133,15 @@ class acp_inactive $messenger->save_queue(); } + if (!empty($inactive_users)) + { + foreach ($inactive_users as $row) + { + add_log('admin', 'LOG_USER_ACTIVE', $row['username']); + add_log('user', $row['user_id'], 'LOG_USER_ACTIVE_USER'); + } + } + // For activate we really need to redirect, else a refresh can result in users being deactivated again $u_action = $this->u_action . "&$u_sort_param&start=$start"; $u_action .= ($per_page != $config['topics_per_page']) ? "&users_per_page=$per_page" : ''; -- cgit v1.2.1