Code

Added groupMail fix from 2.5
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Jan 2007 03:29:18 +0000 (03:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Jan 2007 03:29:18 +0000 (03:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5649 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupMail.inc

index 0dd27c42b2c63ed9f1f6da682486f3d455e879f2..03c9987d1affa5473b0e2659ecc479fc6ec661a5 100644 (file)
@@ -821,17 +821,6 @@ I: Only insider delivery */
     }  
 
 
-    if ((!$this->is_template)&&(!empty($this->gosaMailServer))){
-      $method= new $this->method($this->config);
-      $method->fixAttributesOnStore($this);
-      if (($method->connect($this->gosaMailServer))){
-        $method->updateMailbox($this->uid);
-        $method->setQuota($this->uid, $this->gosaMailQuota);
-        $method->setSharedFolderPermissions($this->uid, $this->imapacl);
-        $method->disconnect();
-      }
-    }
-
     /* Exchange '%member%' pseudo entry */
     $memberacl= $this->imapacl['%members%'];
 
@@ -849,12 +838,37 @@ I: Only insider delivery */
       }
     }
     $this->attrs['acl'] = array();
+    
+    
     foreach($this->imapacl as $user => $acl){
-      if(preg_match("/%members%/",$user) || empty($user)) continue;
-      
+
+      /* Remove empty user entry, to avoid entry like this im imap 
+       *   "" lrs
+       */
+      if(empty($user)){
+        unset($this->imapacl[$user]);
+      }
+   
+      /* Skip invalid values */
+      if(preg_match("/%members%/",$user) || empty($user)){
+        continue;
+      }
+
+      /* Append ldap acl entries */
       $this->attrs['acl'][] = $user." ".$acl;
     }
 
+    if ((!$this->is_template)&&(!empty($this->gosaMailServer))){
+      $method= new $this->method($this->config);
+      $method->fixAttributesOnStore($this);
+      if (($method->connect($this->gosaMailServer))){
+        $method->updateMailbox($this->uid);
+        $method->setQuota($this->uid, $this->gosaMailQuota);
+        $method->setSharedFolderPermissions($this->uid, $this->imapacl);
+        $method->disconnect();
+      }
+    }
+
     /* Save data to LDAP */
     $ldap->cd($this->dn);
     $this->cleanup();