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
|
else
|
||||||
$emailupdate="email='".mysql_escape_string(stripslashes($_POST['email']))."', ";
|
$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']."'");
|
$emailprivate = trim(mysql_escape_string(stripslashes($_POST['emailprivate'])));
|
||||||
if(mysql_num_rows($q))
|
if($emailprivate != '') {
|
||||||
{
|
$q=mysql_query("SELECT id FROM committees_members WHERE (email='$emailprivate' OR emailprivate='$emailprivate') AND id!='".$_POST['save']."'");
|
||||||
$emailprivateupdate="";
|
if(mysql_num_rows($q))
|
||||||
echo notice(i18n("Cannot update private email address. That address already exists for a different committee member"));
|
{
|
||||||
|
$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 ".
|
mysql_query("UPDATE committees_members SET ".
|
||||||
"name='".mysql_escape_string(stripslashes($_POST['name']))."', ".
|
"name='".mysql_escape_string(stripslashes($_POST['name']))."', ".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user