Code

Updated connectivity squid plugin.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Jul 2008 07:47:30 +0000 (07:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Jul 2008 07:47:30 +0000 (07:47 +0000)
-Grey out add/remove plugin checkbox if we are not allowed to do so.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11586 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc

index e495ce35b09cf75568e04a19adc1c49f64de36f7..d480b2cfcf54e0ead1ff72313b176097b024d91a 100644 (file)
@@ -147,7 +147,15 @@ class proxyAccount extends plugin
         $smarty->assign("use_filter".$attr,FALSE);
       }
     }
-    $smarty->assign("proxyAccountACL",$this->getacl("",$this->ReadOnly));
+
+    /* check if we are allowed to switch the checkbox.
+     */
+    $smarty->assign('proxyAccountACL', preg_replace("/w/","",$this->getacl("",$this->ReadOnly)));
+    if(($this->acl_is_removeable() && $this->is_account) ||
+        ($this->acl_is_createable() && !$this->is_account)){
+      $smarty->assign('proxyAccountACL', $this->getacl("",$this->ReadOnly));
+    }
+
     $smarty->assign("use_proxy",in_array("proxy",$this->multi_boxes));
     $smarty->assign("multiple_support",$this->multiple_support_active);
     $display.= $smarty->fetch(get_template_path('proxy.tpl', TRUE, dirname(__FILE__)));