diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php
index 46700d46f3..cb870ecd9d 100755
--- a/phpBB/language/lang_english.php
+++ b/phpBB/language/lang_english.php
@@ -194,7 +194,6 @@ $l_version = "Version";
// Register
$l_accountinactive = "Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Pease check your email for further information.";
-$l_coppa = "Your account has been created, however in complance with the COPPA act you must print out this page and have you parent or guardian mail it to:
$l_mailingaddress
Or fax it to:
$l_faxinfo
Once this information has been recived your account will be activated by the administrator and you will recive and email notification.";
$l_acountadded = "Thank you for registering with $sitename. Your account has been successfully created.";
$l_nowactive = "Your account is now been activated. You may login and post with this account. Thank you for using $sitename forums.";
$l_notfilledin = "Error - you did not fill in all the required fields.";
@@ -216,7 +215,7 @@ $l_faxinfo = "
Fax Number: +1-604-742-1770
";
-
+$l_coppa = "Your account has been created, however in complance with the COPPA act you must print out this page and have you parent or guardian mail it to:
$l_mailingaddress
Or fax it to:
$l_faxinfo
Once this information has been recived your account will be activated by the administrator and you will recive and email notification.";
$l_welcomesubj = "Welcome to $sitename Forums";
$l_welcomemail =
"
diff --git a/phpBB/profile.php b/phpBB/profile.php
index 2b49c57ac2..ea8fa05285 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -77,8 +77,32 @@ switch($mode)
if(isset($submit) && !$error)
{
+ // The AUTO_INCREMENT field in MySQL v3.23 dosan't work correctly when there is a row with
+ // -1 in that field so we have to explicitly get the next user ID.
+ $sql = "SELECT max(user_id) AS total FROM users";
+ if($result = $db->sql_query($sql))
+ {
+ $user_id_row = $db->sql_fetchrow($result);
+ $new_user_id = $user_id_row["total"] + 1;
+ unset($result);
+ unset($user_id_row);
+ }
+ else
+ {
+ if(DEBUG)
+ {
+ $db_error = $db->sql_error();
+ error_die($db, GENERAL_ERROR, "Error getting next user ID.
Reason: ".$db_error["message"]."
Line: ".__LINE__."
File: ".__FILE__);
+ }
+ else
+ {
+ error_die($db, QUERY_ERROR);
+ }
+ }
+
$md_pass = md5($password);
$sql = "INSERT INTO ".USERS_TABLE." (
+ user_id,
username,
user_regdate,
user_password,
@@ -103,6 +127,7 @@ switch($mode)
user_active,
user_actkey)
VALUES (
+ $new_user_id,
'".addslashes($username)."',
'".time()."',
'$md_pass',
@@ -144,15 +169,29 @@ switch($mode)
else if($coppa)
{
$msg = $l_coppa;
+ $email_msg = $l_welcomecoppa;
}
else
{
$msg = $l_accountadded;
$email_msg = $l_welcomeemail;
}
- mail($email, $l_welcomesubj, $email_msg, "From: $email_from\r\n");
+ if(!$coppa)
+ {
+ mail($email, $l_welcomesubj, $email_msg, "From: $email_from\r\n");
+ }
error_die($db, GENERAL_ERROR, $msg);
}
+ else
+ {
+ $error = TRUE;
+ $err = $db->sql_error();
+ $error_msg = "Query Error: ".$err["message"];
+ if(DEBUG)
+ {
+ $error_msg .= "
Query: $sql";
+ }
+ }
}
if($error)