Code

Updated listing table summary
[gosa.git] / gosa-plugins / opsi / admin / opsi / class_opsiProperties.inc
index 16d4b21279e09da1a6ea56365f8153477e39b7da..b7266c3322a1ccb2028e8964fbac3595d01484df 100644 (file)
@@ -8,7 +8,7 @@ class opsiProperties extends plugin
   private $product;
   private $cfg;
   private $hostId;
-
+  public $config;
 
   /*! \brief  Initializes the class.
       @param  Object  The gosa configuration object
@@ -31,7 +31,11 @@ class opsiProperties extends plugin
    */
   public function execute()
   {
+    plugin::execute();
+    $ui =get_userinfo();
+    $acl =  $ui->get_permissions($this->config->current['BASE'],"opsi/opsiProperties","");
     $smarty = get_smarty();
+    $smarty->assign("ACL",$acl);
     $smarty->assign("cfg",$this->cfg);
     $smarty->assign("cfg_count",count($this->cfg));
     return($smarty->fetch(get_template_path("properties.tpl",TRUE,dirname(__FILE__))));
@@ -42,9 +46,13 @@ class opsiProperties extends plugin
    */
   public function save_object()
   {
-    foreach($this->cfg as $name => $value){
-      if(isset($_POST['value_'.$name])){
-        $this->cfg[$name] = validate(get_post('value_'.$name));
+    $ui =get_userinfo();
+    $acl =  $ui->get_permissions($this->config->current['BASE'],"opsi/opsiProperties","");
+    if(preg_match("/w/",$acl)){
+      foreach($this->cfg as $name => $value){
+        if(isset($_POST['value_'.$name])){
+          $this->cfg[$name]['CURRENT'] = validate(get_post('value_'.$name));
+        }
       }
     }
   }
@@ -91,6 +99,23 @@ class opsiProperties extends plugin
   {
     return($this->hostId);
   }
+
+
+  /* Return plugin informations for acl handling */
+  static function plInfo()
+  {
+    return (array(
+          "plShortName"   => _("Products"),
+          "plDescription" => _("Product properties"),
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 10,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("opsi"),
+          "plProvidedAcls"=> array(
+            )
+          ));
+  }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>