aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-08-20 15:59:03 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-08-20 15:59:03 +0000
commitfb5cd25094c7a82867ecfa86f4c1fb63b633b51c (patch)
treeecb3511706d44552ee51d6a2c94873a80588c5fb
parent7d408e542930fae3acac4e80df066c2bc8a885f3 (diff)
downloadforums-fb5cd25094c7a82867ecfa86f4c1fb63b633b51c.tar
forums-fb5cd25094c7a82867ecfa86f4c1fb63b633b51c.tar.gz
forums-fb5cd25094c7a82867ecfa86f4c1fb63b633b51c.tar.bz2
forums-fb5cd25094c7a82867ecfa86f4c1fb63b633b51c.tar.xz
forums-fb5cd25094c7a82867ecfa86f4c1fb63b633b51c.zip
Group id now taken from group table rather than next_id
git-svn-id: file:///svn/phpbb/trunk@909 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/profile.php32
1 files changed, 23 insertions, 9 deletions
diff --git a/phpBB/profile.php b/phpBB/profile.php
index da30f71d8c..fb55c3e3d2 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -394,16 +394,32 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
FROM " . USERS_TABLE;
if($result = $db->sql_query($sql))
{
- $user_id_row = $db->sql_fetchrow($result);
- $new_user_id = $user_id_row['total'] + 1;
+ $row = $db->sql_fetchrow($result);
+ $new_user_id = $row['total'] + 1;
unset($result);
- unset($user_id_row);
+ unset($row);
}
else
{
message_die(GENERAL_ERROR, "Couldn't obtained next user_id information.", "", __LINE__, __FILE__, $sql);
}
+
+ $sql = "SELECT MAX(group_id) AS total
+ FROM " . GROUPS_TABLE;
+ if($result = $db->sql_query($sql))
+ {
+ $row = $db->sql_fetchrow($result);
+ $new_group_id = $row['total'] + 1;
+
+ unset($result);
+ unset($row);
+ }
+ else
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtained next user_id information.", "", __LINE__, __FILE__, $sql);
+ }
+
}
$avatar_sql = "";
@@ -668,7 +684,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
$user_actkey = generate_activation_key();
//
- // The user is inactive, remove their session forcing them to login again befor they can post.
+ // The user is inactive, remove their session forcing them to login again before they can post.
//
$sql = "DELETE FROM " . SESSIONS_TABLE . "
WHERE session_user_id = " . $userdata['user_id'];
@@ -748,14 +764,12 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
if($result = $db->sql_query($sql, BEGIN_TRANSACTION))
{
- $sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)
- VALUES ('$username', 'Personal User', 1, 0)";
+ $sql = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_description, group_single_user, group_moderator)
+ VALUES ($new_group_id, '', 'Personal User', 1, 0)";
if($result = $db->sql_query($sql))
{
- $group_id = $db->sql_nextid();
-
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
- VALUES ($new_user_id, $group_id, 0)";
+ VALUES ($new_user_id, $new_group_id, 0)";
if($result = $db->sql_query($sql, END_TRANSACTION))
{
if($board_config['require_activation'])