Code

Updated mail group
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 Dec 2008 09:47:32 +0000 (09:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 9 Dec 2008 09:47:32 +0000 (09:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13197 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 32da99f4dbbd15dea523227e65c7f0f4862fd146..ade0f17f9c749d2fe033d9bae579e566edafc7a3 100644 (file)
@@ -44,10 +44,12 @@ class mailgroup extends plugin
   {
     plugin::plugin($config, $dn);
 
+
     /* Intialize the used mailMethod
      */
     $tmp = new mailMethod($config,$this,"group");
     $this->mailMethod           = $tmp->get_method();
+    $this->mailMethod->fixAttributesOnLoad();
     $this->mailDomainParts      = $this->mailMethod->getMailDomains();
     $this->AvailableFolderTypes = $this->mailMethod->getAvailableFolderTypes();
     $this->AclTypes             = $this->mailMethod->getAclTypes();
@@ -490,10 +492,8 @@ class mailgroup extends plugin
     $this->attrs['gosaMailForwardingAddress']= array();
     $this->attrs['gosaSharedFolderTarget']= array();
 
-    $this->cleanup();
-
     $this->mailMethod->fixAttributesOnRemove();
-
+    $this->cleanup();
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->dn);
     $ldap->modify ($this->attrs); 
@@ -669,13 +669,17 @@ class mailgroup extends plugin
     $ldap= $this->config->get_ldap_link();
 
     /* If domain part was selectable, contruct mail address */
-    if($this->mailMethod->domainSelectionEnabled() || $this->mailMethod->mailEqualsCN()){
-      $this->mail = $this->mail."@".$this->mailDomainPart;
+    if(!(!$this->mailMethod->isModifyableMail() && $this->initially_was_account)){
+
+      if($this->mailMethod->domainSelectionEnabled() || $this->mailMethod->mailEqualsCN()){
+        $this->mail = $this->mail."@".$this->mailDomainPart;
+      }
     }
 
     /* Enforce lowercase mail address and trim whitespaces
      */
     $this->mail = trim(strtolower($this->mail));
+    
 
     /* Create acls 
      */