aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_activate.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2005-01-29 11:29:35 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2005-01-29 11:29:35 +0000
commit9c2cde7dfde6c11616aadbaf519c997ebb56026d (patch)
treeaeb34b7eabed4876b02bed2515b4ffdbfb727e97 /phpBB/includes/ucp/ucp_activate.php
parentda674eae0c382fdd6060f31e4522c2e0cbf1793a (diff)
downloadforums-9c2cde7dfde6c11616aadbaf519c997ebb56026d.tar
forums-9c2cde7dfde6c11616aadbaf519c997ebb56026d.tar.gz
forums-9c2cde7dfde6c11616aadbaf519c997ebb56026d.tar.bz2
forums-9c2cde7dfde6c11616aadbaf519c997ebb56026d.tar.xz
forums-9c2cde7dfde6c11616aadbaf519c997ebb56026d.zip
put user into appropiate group after activating his account
git-svn-id: file:///svn/phpbb/trunk@5086 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_activate.php')
-rw-r--r--phpBB/includes/ucp/ucp_activate.php24
1 files changed, 15 insertions, 9 deletions
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index 0892ebbb08..f7d069e5de 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -44,22 +44,28 @@ class ucp_activate extends module
$update_password = ($row['user_newpasswd']) ? true : false;
- $sql_ary = array(
- 'user_type' => USER_NORMAL,
- 'user_actkey' => ''
- );
-
if ($update_password)
{
- $sql_ary += array(
+ $sql_ary = array(
+ 'user_type' => USER_NORMAL,
+ 'user_actkey' => '',
'user_password' => $row['user_newpasswd'],
'user_newpasswd' => ''
);
+
+ $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE user_id = ' . $row['user_id'];
+ $result = $db->sql_query($sql);
}
- $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE user_id = ' . $row['user_id'];
- $result = $db->sql_query($sql);
+ // TODO: check for group membership after password update... active_flip there too
+ if (!$update_password)
+ {
+ // Now we need to demote the user from the inactive group and add him to the registered group
+
+ include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ user_active_flip($row['user_id'], $row['user_type'], '', $row['username']);
+ }
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
{