diff --git a/admin/donors.php b/admin/donors.php index 68f0d50..ae0cf3b 100644 --- a/admin/donors.php +++ b/admin/donors.php @@ -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 ";