diff options
author | James Atkinson <thefinn@users.sourceforge.net> | 2001-03-22 01:33:42 +0000 |
---|---|---|
committer | James Atkinson <thefinn@users.sourceforge.net> | 2001-03-22 01:33:42 +0000 |
commit | c11d9105d73994e1d86c7579f836fb73ad9c7b42 (patch) | |
tree | 3f33e9cc391da3118e82500a1b8ba38134853765 /phpBB/profile.php | |
parent | 1ccf0a5b178fb6fd5943c9a94979b7a45515579d (diff) | |
download | forums-c11d9105d73994e1d86c7579f836fb73ad9c7b42.tar forums-c11d9105d73994e1d86c7579f836fb73ad9c7b42.tar.gz forums-c11d9105d73994e1d86c7579f836fb73ad9c7b42.tar.bz2 forums-c11d9105d73994e1d86c7579f836fb73ad9c7b42.tar.xz forums-c11d9105d73994e1d86c7579f836fb73ad9c7b42.zip |
Registration is almost done, coppa support is in..
git-svn-id: file:///svn/phpbb/trunk@129 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/profile.php')
-rw-r--r-- | phpBB/profile.php | 41 |
1 files changed, 40 insertions, 1 deletions
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.<br>Reason: ".$db_error["message"]."<br>Line: ".__LINE__."<br>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 .= "<br>Query: $sql"; + } + } } if($error) |