- 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.  :)
This commit is contained in:
dave 2009-02-02 23:48:26 +00:00
parent 68cdb98a8e
commit 8b430bd63f

View File

@ -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']))));
}