forked from science-ation/science-ation
Really make sure they cant add auser with an email address that already exists
This commit is contained in:
parent
1f244c8375
commit
081bc1b187
@ -223,6 +223,15 @@ function save_contact(){
|
||||
if(validate_contactdata()){
|
||||
// load or create the user, according to the situation
|
||||
if($_POST['recordtype'] == 'new'){
|
||||
|
||||
if($_POST['email']) {
|
||||
$q=mysql_query("SELECT *,MAX(year) FROM users WHERE email='".trim($_POST['email'])."' GROUP BY uid HAVING deleted='no'");
|
||||
if(mysql_num_rows($q)) {
|
||||
error_("A user with that email address already exists");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// this is a new record being submitted. Create the user.
|
||||
$successMessage = "Contact created successfully";
|
||||
$successLog = "Added contact ";
|
||||
|
Loading…
Reference in New Issue
Block a user