Code

Updated css und div framework.
[gosa.git] / plugins / admin / groups / class_groupMail.inc
index f836f5281f372d66884c6ffc379cde0b94594835..03c9987d1affa5473b0e2659ecc479fc6ec661a5 100644 (file)
@@ -290,6 +290,7 @@ class mailgroup extends plugin
     $this->perms["p"]= _("external post");
     $this->perms["lrsip"]= _("append");
     $this->perms["lrswipcd"]= _("write");
+    $this->perms[""]= _("none");
   }
 
   function execute()
@@ -349,8 +350,8 @@ class mailgroup extends plugin
           }
           $display .= "<h2>Shared folder delete options</h2>
                        <input class='center' type='checkbox' name='remove_folder_from_imap' value='1' ".$c."
-                          title='"._("Remove shared folder from mail server database")."'>";
-          $display .= _("Remove the shared folder and all its contents from mail server.");
+                        title='"._("Remove shared folder from mail server database when entry gets removed in LDAP")."'>";
+          $display .= _("Remove the shared folder and all its contents after saving this account");
         }
         return ($display);
       }
@@ -565,6 +566,13 @@ class mailgroup extends plugin
           $Dis = " disabled ";
         }
   
+        /* Reset given Acls to ensure that nobody can read username and acls if not allwoed */
+        if(!preg_match("/r/",$perm)){
+          $user = "";
+          $nr   = "none";
+          $key  = "none";  
+        }
+
         $tmp.= "<tr>  
                  <td>
                   <input name=\"user_$nr\" size=20 maxlength=60 value=\"$user\" ".$Dis.">
@@ -813,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%'];
 
@@ -841,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();