mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-02-07 13:59:07 +00:00
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:
parent
65835cc793
commit
7ddb2bd183
@ -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("
|
||||
|
Loading…
Reference in New Issue
Block a user