Code

Made mail plugin w3c conform
[gosa.git] / plugins / personal / connectivity / class_kolabAccount.inc
index 8fe31efabcb310f335f12cbdd9c64fd3d146cdcc..84ea03a2515fe46958fb50a86dd8fe3cce39af75 100644 (file)
@@ -19,6 +19,7 @@ class kolabAccount extends plugin
   /* Helper */
   var $imapping= array();
   var $mail_Account   = false;
+  var $ReadOnly = false;
 
   function kolabAccount ($config, $dn= NULL)
   {
@@ -78,12 +79,18 @@ class kolabAccount extends plugin
 
     $tmp = $this->plInfo();
     foreach($tmp['plProvidedAcls'] as $acl => $description){
-      $smarty->assign($acl."ACL",$this->getacl($acl));
-      $smarty->assign($acl."_W", $this->acl_is_writeable($acl));
+      $smarty->assign($acl."ACL",$this->getacl($acl,$this->ReadOnly));
+      $smarty->assign($acl."_W", $this->acl_is_writeable($acl,$this->ReadOnly));
     }
     $smarty->assign("is_account" ,  $this->is_account); 
-    $smarty->assign("is_removeable",$this->acl_is_removeable()); 
-    $smarty->assign("is_createable",$this->acl_is_createable()); 
+
+    if($this->ReadOnly){
+      $smarty->assign("is_removeable",false); 
+      $smarty->assign("is_createable",false); 
+    }else{
+      $smarty->assign("is_removeable",$this->acl_is_removeable()); 
+      $smarty->assign("is_createable",$this->acl_is_createable()); 
+    }
 
     /* Check for invitation action */
     $nr= 0;
@@ -324,12 +331,16 @@ class kolabAccount extends plugin
     if (isset($_POST['connectivityTab'])){
 
       if(isset($_POST["kolabState"])){
-        $this->is_account = true;
+        if($this->acl_is_createable()){
+          $this->is_account = true;
+        }
       }else{
-        $this->is_account = false;
+        if($this->acl_is_removeable()){
+          $this->is_account = false;
+        }
       }
-
-      if (chkacl('unrestrictedMailSize', $this->acl == "")){
+      
+      if ($this->acl_is_writeable("unrestrictedMailSize")){
         if (isset($_POST['unrestrictedMailSize']) && $_POST['unrestrictedMailSize'] == 1){
           $this->unrestrictedMailSize= 1;
         } else {
@@ -341,25 +352,26 @@ class kolabAccount extends plugin
     plugin::save_object();
 
     /* Save changes done in invitation policies */
-    $nr= 0;
-    $this->kolabInvitationPolicy= array();
-    while (isset($_POST["policy$nr"])){
+    if($this->acl_is_writeable("kolabInvitationPolicy")){
+      $nr= 0;
+      $this->kolabInvitationPolicy= array();
+      while (isset($_POST["policy$nr"])){
+
+        /* Anonymous? */
+        if (!isset($_POST["address$nr"])){
+          $this->kolabInvitationPolicy[]= $_POST["policy$nr"];
+        } else {
+          $this->kolabInvitationPolicy[]= $_POST["address$nr"].": ".$_POST["policy$nr"];
+        }
 
-      /* Anonymous? */
-      if (!isset($_POST["address$nr"])){
-        $this->kolabInvitationPolicy[]= $_POST["policy$nr"];
-      } else {
-        $this->kolabInvitationPolicy[]= $_POST["address$nr"].": ".$_POST["policy$nr"];
+        $nr++;
       }
-      
-      $nr++;
-    }
-    
-    /* If this one is empty, preset with ACT_MANUAL for anonymous users */
-    if (count ($this->kolabInvitationPolicy) == 0){
-      $this->kolabInvitationPolicy= array("ACT_MANUAL");
-    }
 
+      /* If this one is empty, preset with ACT_MANUAL for anonymous users */
+      if (count ($this->kolabInvitationPolicy) == 0){
+        $this->kolabInvitationPolicy= array("ACT_MANUAL");
+      }
+    }
   }