Add Checking if email is already used

Add Checking if email is already used when try to register. If email is
already in the DB, you will get error that this email is already used.
This commit is contained in:
fen7azy 2014-06-19 21:23:44 +03:00
parent 65835cc793
commit 7ddb2bd183

View File

@ -59,6 +59,7 @@
$Err = 'You cannot have a username of "0" or "1".';
}
// Check if username is already used
$DB->query("
SELECT COUNT(ID)
FROM users_main
@ -69,6 +70,18 @@
$Err = 'There is already someone registered with that username.';
$_REQUEST['username'] = '';
}
// Check if email is already used
$DB->query("
SELECT COUNT(ID)
FROM users_main
WHERE Email LIKE '".db_string(trim($_POST['email']))."'");
list($EmailCount) = $DB->next_record();
if ($EmailCount) {
$Err = 'There is already someone registered with that email.';
$_REQUEST['email'] = '';
}
if ($_REQUEST['invite']) {
$DB->query("