forked from science-ation/science-ation
- Allow a committee privateemail to be written as '' (nothing) without throwing
the "email address already exists" error.
This commit is contained in:
parent
dd247fa002
commit
f7c430d712
@ -195,14 +195,19 @@ if($_POST['save'])
|
||||
else
|
||||
$emailupdate="email='".mysql_escape_string(stripslashes($_POST['email']))."', ";
|
||||
|
||||
$q=mysql_query("SELECT id FROM committees_members WHERE (email='".$_POST['emailprivate']."' OR emailprivate='".$_POST['emailprivate']."') AND id!='".$_POST['save']."'");
|
||||
if(mysql_num_rows($q))
|
||||
{
|
||||
$emailprivateupdate="";
|
||||
echo notice(i18n("Cannot update private email address. That address already exists for a different committee member"));
|
||||
$emailprivate = trim(mysql_escape_string(stripslashes($_POST['emailprivate'])));
|
||||
if($emailprivate != '') {
|
||||
$q=mysql_query("SELECT id FROM committees_members WHERE (email='$emailprivate' OR emailprivate='$emailprivate') AND id!='".$_POST['save']."'");
|
||||
if(mysql_num_rows($q))
|
||||
{
|
||||
$emailprivateupdate="";
|
||||
echo notice(i18n("Cannot update private email address. That address already exists for a different committee member"));
|
||||
} else {
|
||||
$emailprivateupdate="emailprivate='$emailprivate', ";
|
||||
}
|
||||
} else {
|
||||
$emailprivateupdate="emailprivate='$emailprivate', ";
|
||||
}
|
||||
else
|
||||
$emailprivateupdate="emailprivate='".mysql_escape_string(stripslashes($_POST['emailprivate']))."', ";
|
||||
|
||||
mysql_query("UPDATE committees_members SET ".
|
||||
"name='".mysql_escape_string(stripslashes($_POST['name']))."', ".
|
||||
|
Loading…
x
Reference in New Issue
Block a user