Code

Added a flag for connectivity classes, to allow grey out of every input when not...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 Jul 2006 09:52:39 +0000 (09:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 Jul 2006 09:52:39 +0000 (09:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4312 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/connectivity/class_connectivity.inc
plugins/personal/connectivity/class_intranetAccount.inc
plugins/personal/connectivity/class_kolabAccount.inc
plugins/personal/connectivity/class_opengwAccount.inc
plugins/personal/connectivity/class_phpgwAccount.inc
plugins/personal/connectivity/class_phpscheduleitAccount.inc
plugins/personal/connectivity/class_pptpAccount.inc
plugins/personal/connectivity/class_proxyAccount.inc
plugins/personal/connectivity/class_pureftpdAccount.inc

index 534541ecd2c4388fb0253c204fe0043b26482479..83252cc8a75011f80f57e8f2c8aae3718bbde9d7 100644 (file)
@@ -77,7 +77,11 @@ class connectivity extends plugin
 
     /* Execude  objects */
     $is_first= true;
+
+    $ReadOnly = (!is_object($this->parent) && !isset($_SESSION['edit']));
+
     foreach ($this->plugin_name as $name){
+      $this->plugin[$name]->ReadOnly = $ReadOnly;
       if (!$is_first){
         $display.= '<p class="seperator">&nbsp;</p>';
       } else {
index 49c540d2748a0a7f1835b8eb7ea655a112bf6dd0..46f44deabd9a71654c2d3091b2d1360826949fe6 100644 (file)
@@ -19,6 +19,7 @@ class intranetAccount extends plugin
   var $attributes= array();
   /* ObjectClasses list for save action */
   var $objectclasses= array("gosaIntranetAccount");
+  var $ReadOnly = false;  
 
   /*! \brief Konstructor  
 
@@ -67,7 +68,7 @@ class intranetAccount extends plugin
       $smarty->assign("tabbed", 0);    
     }
 
-    if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
+    if((!$this->ReadOnly) && ($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
       $smarty->assign('gosaIntranetACL', "");
     }else{
       $smarty->assign('gosaIntranetACL', " disabled ");
index 9d8899e30553cbc64db47a97aba95b3b95d8030e..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;
index 03da9692e03bc41f688d43a4ae6efea2beff73e7..e282f0c458b7d0bb37c12768c1b2ad48ec7959a9 100644 (file)
@@ -31,6 +31,7 @@ class opengwAccount extends plugin
        var $is_account           = false;
        var $initialy_was_account = false;
   var $OGWPassword          = "";
+  var $ReadOnly = false;
 
        function opengwAccount ($config, $dn= NULL)
        {
index 130bbe2d6b64987bca746fb8a65d9bdca9c6aae3..c458f8eb00648fab344a9ba24b19d4d1f9ea38c4 100644 (file)
@@ -13,6 +13,7 @@ class phpgwAccount extends plugin
   /* attribute list for save action */
   var $attributes= array("phpgwAccountExpires", "phpgwAccountStatus", "phpgwAccountType");
   var $objectclasses= array("phpgwAccount");
+  var $ReadOnly = false;
 
   function phpgwAccount ($config, $dn= NULL)
   {
@@ -41,7 +42,7 @@ class phpgwAccount extends plugin
       $smarty->assign("phpgwState", "");
     }
 
-    if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
+    if((!$this->ReadOnly)&&($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
       $smarty->assign('phpgwAccountACL', "");
     }else{
       $smarty->assign('phpgwAccountACL', " disabled ");
index 76cc349d548556ed26dc1aa0121282a0f7b3bfb5..558481ab9bfe6aaefce3b46c943eddae0c267ab4 100644 (file)
@@ -30,6 +30,7 @@ class phpscheduleitAccount extends plugin
   /* attribute list for save action */
   var $attributes= array();
   var $objectclasses= array("phpscheduleitAccount");
+  var $ReadOnly =false;
 
   function phpscheduleitAccount ($config, $dn= NULL)
   {
@@ -51,7 +52,7 @@ class phpscheduleitAccount extends plugin
       $smarty->assign("wstate", "disabled");
     }
 
-    if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
+    if((!$this->ReadOnly) && (($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable()))) {
       $smarty->assign('gosaphpscheduleitACL', "");
     }else{
       $smarty->assign('gosaphpscheduleitACL', " disabled ");
index 622fc0126105694f8217f3c37e4dc4a2b4e4162c..a037779449b640f4701bb717ff196e1bd67d96eb 100644 (file)
@@ -30,6 +30,8 @@ class pptpAccount extends plugin
   var $attributes= array();
   var $objectclasses= array("pptpServerAccount");
 
+  var $ReadOnly = false;
+
   function pptpAccount ($config, $dn= NULL)
   {
     plugin::plugin ($config, $dn);
@@ -53,7 +55,7 @@ class pptpAccount extends plugin
       $smarty->assign("wstate", "disabled");
     }
 
-    if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
+    if((!$this->ReadOnly) && ($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
       $smarty->assign('gosapptpACL', "");
     }else{
       $smarty->assign('gosapptpACL', " disabled ");
index 495924237642e95bad6c192c2d61270e93e2efdd..1280d3b9f268c6f840281d872e107ef3906bdd0c 100644 (file)
@@ -17,6 +17,7 @@ class proxyAccount extends plugin
   var $attributes= array("gosaProxyID", "gosaProxyAcctFlags", "gosaProxyWorkingStart",
       "gosaProxyWorkingStop", "gosaProxyQuota", "gosaProxyQuotaPeriod");
   var $objectclasses= array("gosaProxyAccount");
+  var $ReadOnly = false;
 
   function proxyAccount ($config, $dn= NULL)
   {
@@ -34,7 +35,7 @@ class proxyAccount extends plugin
     $smarty= get_smarty();
 
     
-    if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
+    if((!$this->ReadOnly)&& ($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
       $smarty->assign('proxyAccountACL', "");
     }else{
       $smarty->assign('proxyAccountACL', " disabled ");
@@ -63,8 +64,8 @@ class proxyAccount extends plugin
 
     $tmp = $this->plInfo();
     foreach($tmp['plProvidedAcls'] as $acl => $desc){
-      $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));
     }
 
     /* Assign working time */
index 596ab556bf5138d9343200ab65daac59c7c4a3e9..47c5aaf18afd9d7e01f28c6f2d7af0424703a07c 100644 (file)
@@ -21,6 +21,7 @@ class pureftpdAccount extends plugin
   var $attributes= array("FTPQuotaFiles","FTPQuotaMBytes","FTPUploadRatio","FTPDownloadRatio",
       "FTPUploadBandwidth","FTPDownloadBandwidth","FTPStatus","FTPuid","FTPgid");
   var $objectclasses= array("PureFTPdUser");
+  var $ReadOnly;
 
   function pureftpdAccount ($config, $dn= NULL)
   {
@@ -44,8 +45,8 @@ class pureftpdAccount extends plugin
     $tmp = $this->plInfo();
     $changeState = "";
     foreach($tmp['plProvidedAcls'] as $key => $desc){
-      $smarty->assign($key."ACL", $this->getacl($key));
-      $smarty->assign($key."_W", $this->acl_is_writeable($key));
+      $smarty->assign($key."ACL", $this->getacl($key,$this->ReadOnly));
+      $smarty->assign($key."_W", $this->acl_is_writeable($key,$this->ReadOnly));
   
       if($this->acl_is_writeable($key)){
         $changeState.= " changeState('".$key."'); \n";
@@ -69,7 +70,7 @@ class pureftpdAccount extends plugin
     }
     $smarty->assign("use_FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : "");
     
-    if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
+    if((!$this->ReadOnly)&&($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
       $smarty->assign('pureftpdACL', "");
     }else{
       $smarty->assign('pureftpdACL', " disabled ");