Commit 7acef043 authored by tbrehm's avatar tbrehm
Browse files

Check only for active records when performing a duplicate check for mailboxes...

Check only for active records when performing a duplicate check for mailboxes / aliases / forwarders
parent c5a78707
......@@ -120,8 +120,8 @@ class page_action extends tform_actions {
unset($this->dataRecord["email_local_part"]);
unset($this->dataRecord["email_domain"]);
//* Check if there is no mailbox with this address
$tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE email = '".$app->db->quote($this->dataRecord["source"])."'");
//* Check if there is no active mailbox with this address
$tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE postfix = 'y' AND email = '".$app->db->quote($this->dataRecord["source"])."'");
if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("duplicate_mailbox_txt")."<br>";
unset($tmp);
......
......@@ -117,8 +117,8 @@ class page_action extends tform_actions {
unset($this->dataRecord["email_local_part"]);
unset($this->dataRecord["email_domain"]);
//* Check if there is no mailbox with this address
$tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE email = '".$app->db->quote($this->dataRecord["source"])."'");
//* Check if there is no active mailbox with this address
$tmp = $app->db->queryOneRecord("SELECT count(mailuser_id) as number FROM mail_user WHERE postfix = 'y' AND email = '".$app->db->quote($this->dataRecord["source"])."'");
if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("duplicate_mailbox_txt")."<br>";
unset($tmp);
......
......@@ -182,7 +182,7 @@ class page_action extends tform_actions {
$this->dataRecord["gid"] = $mail_config["mailuser_gid"];
//* Check if there is no alias or forward with this address
$tmp = $app->db->queryOneRecord("SELECT count(forwarding_id) as number FROM mail_forwarding WHERE source = '".$app->db->quote($this->dataRecord["email"])."'");
$tmp = $app->db->queryOneRecord("SELECT count(forwarding_id) as number FROM mail_forwarding WHERE active = 'y' AND source = '".$app->db->quote($this->dataRecord["email"])."'");
if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("duplicate_alias_or_forward_txt")."<br>";
unset($tmp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment