From 8b430bd63f9e6143c16062cabdf500f94a2778b9 Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 2 Feb 2009 23:48:26 +0000 Subject: [PATCH] - Use the uid instead of the id (which changes every year) to see if an email address is in use. - Only scan emails of non-deleted users - Don't try and go back to the committee management page after save, we're in a popup window. FIXME: the popup window needs a close button. :) --- user_personal.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/user_personal.php b/user_personal.php index 32fc39b..b37dc09 100644 --- a/user_personal.php +++ b/user_personal.php @@ -153,7 +153,7 @@ /* Check for an email collision */ $em = mysql_escape_string(stripslashes($_POST['email'])); - $q=mysql_query("SELECT id FROM users WHERE email='$em' AND id!='{$u['id']}'"); + $q=mysql_query("SELECT id FROM users WHERE email='$em' AND uid!='{$u['uid']}' AND deleted='no'"); if(mysql_num_rows($q) > 0) { message_push(error(i18n("That email address is in use by another user"))); $save = false; @@ -161,10 +161,6 @@ if($save == true) { user_save($u); - if($_SESSION['last_page'] == 'committee_management') { - header("location: {$config['SFIABDIRECTORY']}/admin/committees.php"); - exit; - } message_push(notice(i18n("%1 %2 successfully updated",array($_POST['firstname'],$_POST['lastname'])))); }