aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-05-30 15:46:07 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-05-30 15:46:07 +0000
commit9b8cea97319d80835732b05bd2bda6c467861596 (patch)
treebc2d513da6fab9067f4a44044d80dbe554af6269 /phpBB
parentdffc9028eee33c497bc2228e538400c0584705b8 (diff)
downloadforums-9b8cea97319d80835732b05bd2bda6c467861596.tar
forums-9b8cea97319d80835732b05bd2bda6c467861596.tar.gz
forums-9b8cea97319d80835732b05bd2bda6c467861596.tar.bz2
forums-9b8cea97319d80835732b05bd2bda6c467861596.tar.xz
forums-9b8cea97319d80835732b05bd2bda6c467861596.zip
Basic user group addition for single user upon registration
git-svn-id: file:///svn/phpbb/trunk@374 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/profile.php88
1 files changed, 62 insertions, 26 deletions
diff --git a/phpBB/profile.php b/phpBB/profile.php
index 4dd2b99afb..c9dde3d122 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -882,37 +882,73 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
if($result = $db->sql_query($sql))
{
- if($require_activation)
+ $sql = "INSERT INTO ".GROUPS_TABLE."
+ (group_name, group_note)
+ VALUES
+ ('$username', 'Personal User')";
+ if($result = $db->sql_query($sql))
{
- $msg = $l_accountinactive;
- $email_msg = $l_welcomeemailactivate;
- }
- else if($coppa)
- {
- $msg = $l_coppa;
- $email_msg = $l_welcomecoppa;
+ $group_id = $db->sql_nextid();
+
+ $sql = "INSERT INTO ".USER_GROUP_TABLE."
+ (user_id, group_id)
+ VALUES
+ ($new_user_id, $group_id)";
+ if($result = $db->sql_query($sql))
+ {
+ if($require_activation)
+ {
+ $msg = $l_accountinactive;
+ $email_msg = $l_welcomeemailactivate;
+ }
+ else if($coppa)
+ {
+ $msg = $l_coppa;
+ $email_msg = $l_welcomecoppa;
+ }
+ else
+ {
+ $msg = $l_acountadded;
+ $email_msg = $l_welcomemail;
+ }
+
+ if(!$coppa)
+ {
+ $email_msg .= "\r\n" . $board_config['board_email'];
+ mail($email, $l_welcomesubj, $email_msg, "From: ".$board_config['board_email_from']."\r\n");
+ }
+
+ $template->set_filenames(array(
+ "reg_header" => "error_body.tpl"
+ ));
+ $template->assign_vars(array(
+ "ERROR_MESSAGE" => $msg
+ ));
+ $template->pparse("reg_header");
+
+ include('includes/page_tail.'.$phpEx);
+ }
+ else
+ {
+ $error = TRUE;
+ $err = $db->sql_error();
+ $error_msg = "Query Error: ".$err["message"];
+ if(DEBUG)
+ {
+ $error_msg .= "<br>Query: $sql";
+ }
+ }
}
else
{
- $msg = $l_acountadded;
- $email_msg = $l_welcomemail;
- }
-
- if(!$coppa)
- {
- $email_msg .= "\r\n" . $board_config['board_email'];
- mail($email, $l_welcomesubj, $email_msg, "From: ".$board_config['board_email_from']."\r\n");
+ $error = TRUE;
+ $err = $db->sql_error();
+ $error_msg = "Query Error: ".$err["message"];
+ if(DEBUG)
+ {
+ $error_msg .= "<br>Query: $sql";
+ }
}
-
- $template->set_filenames(array(
- "reg_header" => "error_body.tpl"
- ));
- $template->assign_vars(array(
- "ERROR_MESSAGE" => $msg
- ));
- $template->pparse("reg_header");
-
- include('includes/page_tail.'.$phpEx);
}
else
{