From 89623defaa2cb2a71861d9dac4594c6c0618191a Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Sun, 21 Jun 2009 10:39:22 -0400
Subject: [PATCH] Fixed: FS#778 - mailalias has priority over mailbox if they both exist. Added a error message that prevents it to add a alias or forward when a mailbox with the same email address exists.

---
 interface/web/mail/mail_forward_edit.php |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/interface/web/mail/mail_forward_edit.php b/interface/web/mail/mail_forward_edit.php
index b6871aa..efc83da 100644
--- a/interface/web/mail/mail_forward_edit.php
+++ b/interface/web/mail/mail_forward_edit.php
@@ -1,6 +1,6 @@
 <?php
 /*
-Copyright (c) 2005, Till Brehm, projektfarm Gmbh
+Copyright (c) 2005 - 2009, Till Brehm, projektfarm Gmbh
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification,
@@ -123,6 +123,11 @@
 		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"])."'");
+		if($tmp['number'] > 0) $app->tform->errorMessage .= $app->tform->lng("duplicate_mailbox_txt")."<br>";
+		unset($tmp);
+		
 		parent::onSubmit();
 	}
 	

--
Gitblit v1.9.1