Code

Added missing check for group mails. Closes #617
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Feb 2009 13:33:41 +0000 (13:33 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Feb 2009 13:33:41 +0000 (13:33 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13396 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/admin/groups/mail/class_groupMail.inc

index 2b259812ba1a05baa0dc390d27301932c47cb976..ee636c8e3dd75bcdcd77a89b4ad343d04dc2b568 100644 (file)
@@ -850,6 +850,16 @@ class mailgroup extends plugin
       }
     }
 
+    /* Check if this mail address is already in use */
+    $ldap->cd($this->config->current['BASE']);
+    $filter = "(&(!(objectClass=gosaUserTemplate))(!(cn=".$this->cn."))".
+           "(objectClass=gosaMailAccount)".
+           "(|(mail=".$mail.")(alias=".$mail.")(gosaMailAlternateAddress=".$mail.")))";
+    $ldap->search($filter,array("cn"));
+    if ($ldap->count() != 0){
+           $message[]= msgPool::duplicated(_("Mail address"));
+    }
+
     /* Check rejectsize for integer */
     if ($this->gosaMailMaxSize != '' && $this->acl_is_writeable("gosaMailQuota")){
       if (!is_numeric($this->gosaMailMaxSize)){