Code

Updated opsiProperties
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 14 Oct 2008 13:29:10 +0000 (13:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 14 Oct 2008 13:29:10 +0000 (13:29 +0000)
-Added Acls.

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

gosa-plugins/opsi/admin/opsi/class_opsiProperties.inc
gosa-plugins/opsi/admin/opsi/properties.tpl

index 91c4d8a153e5129cae9bd6b31982613e359a29a8..07304d11ed643a103e7a559a5f8a3fed7510abf1 100644 (file)
@@ -31,7 +31,11 @@ class opsiProperties extends plugin
    */
   public function 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,12 @@ class opsiProperties extends plugin
    */
   public function save_object()
   {
-    foreach($this->cfg as $name => $value){
-      if(isset($_POST['value_'.$name])){
-        $this->cfg[$name]['DEFAULT'] = validate(get_post('value_'.$name));
+    $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]['DEFAULT'] = validate(get_post('value_'.$name));
+        }
       }
     }
   }
@@ -91,6 +98,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:
 ?>
index be54a4a01c593b22b6edb8911d37413131bd3105..9f4c62325428fb6494b6e32e0390dbb6e0811d47 100644 (file)
@@ -14,6 +14,7 @@
        <tr>
                <td>{$key}</td>
                <td>
+{render acl=$ACL}
                        {if $item.VALUE_CNT}
                                <select name="value_{$key}" style='width:180px;'>
                                {foreach from=$item.VALUE key=k item=i}
@@ -23,7 +24,7 @@
                        {else}
                                <input type='input' name='value_{$key}' value="{$item.DEFAULT}" style='width:280px;'>
                        {/if}
-
+{/render}
                </td>
        </tr>
 {/foreach}