Code

Updated gotoHotplug ACLs.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 Jul 2008 08:48:13 +0000 (08:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 Jul 2008 08:48:13 +0000 (08:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11722 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/devices/class_deviceGeneric.inc
gosa-plugins/goto/admin/devices/deviceGeneric.tpl

index 07a497e1baae5f846f377955cee4ef7276a6ed59..d66c4906c4483cb26bd2a5818db6337285ae8fd1 100644 (file)
@@ -15,8 +15,7 @@ class deviceGeneric extends plugin
   public $types;
   public $type;
 
-  public $posts           = array("description","dev_id","serial","vendor", "type");
-  public $attributes      = array("cn");
+  public $attributes      = array("cn","description","dev_id","serial","vendor", "type");
   public $objectclasses   = array("top","gotoDevice");
 
   public $CopyPasteVars   = array("orig_cn","description","vendor","dev_id","serial","base");
@@ -71,13 +70,14 @@ class deviceGeneric extends plugin
     foreach($this->attributes as $attr){
       $smarty->assign($attr,$this->$attr);
     }
-    foreach($this->posts as $attr){
-      $smarty->assign($attr,$this->$attr);
+  
+    $tmp = $this->plInfo();
+    foreach($tmp['plProvidedAcls'] as $attr => $desc){
+      $smarty->assign($attr."ACL", $this->getacl($attr));
     }
 
     $smarty->assign("type",$this->type);
     $smarty->assign ("types", $this->types);
-
     return($smarty->fetch(get_template_path("deviceGeneric.tpl",TRUE,dirname(__FILE__))));
   }
 
@@ -136,12 +136,6 @@ class deviceGeneric extends plugin
           $this->base = get_post("base");
         }
       }
-    
-      foreach($this->posts as $post){
-        if(isset($_POST[$post])){
-          $this->$post = get_post($post);
-        }
-      }
     }
   }
 
@@ -171,8 +165,10 @@ class deviceGeneric extends plugin
   {
     plugin::save();
 
+    $this->attrs = array();
+    $this->attrs['cn'] = $this->cn;
     $this->attrs['gotoHotplugDevice'] = "";
-    foreach($this->posts as $post){
+    foreach(array("description","dev_id","serial","vendor", "type") as $post){
       $this->attrs['gotoHotplugDevice'] .= $this->$post."|"; 
     }
     $this->attrs['gotoHotplugDevice'] = preg_replace("/\|$/","",$this->attrs['gotoHotplugDevice']);
@@ -245,7 +241,7 @@ class deviceGeneric extends plugin
   {
     return (array(
           "plShortName"   => _("Generic"),
-          "plDescription" => _("Device generic"),
+          "plDescription" => _("Device generic")." ("._("Hotplug").")",
           "plSelfModify"  => FALSE,
           "plDepends"     => array(),
           "plPriority"    => 0,
@@ -253,7 +249,13 @@ class deviceGeneric extends plugin
           "plCategory"    => array("devices" => array("description"  => _("Devices"),
                                                         "objectClass"  => "gotoHotplugDevice")),
           "plProvidedAcls"=> array(
-            "cn"                          => _("Name"))
+            "cn"            => _("Name"),
+            "base"          => _("Base"),
+            "description"   => _("Description"),
+            "type"          => _("Tpye"),
+            "serial"        => _("Serial"),
+            "vendor"        => _("Vendor"), 
+            "dev_id"        => _("Devive ID"))
           ));
 
   }
index 863851e4492c82d17ec281c3ee7472961cb786b8..25aac08c64ea88b6936970d15cd04a5674634eb2 100644 (file)
@@ -9,32 +9,40 @@
             <td><LABEL for="base">{t}Base{/t}</LABEL>
             </td>
             <td>
+{render acl=$baseACL}
                                <select name="base">
                                        {html_options options=$bases selected=$base}
                                </select>
+{/render}
             </td>
         </tr>
         <tr>
             <td><LABEL for="cn">{t}Device name{/t}</LABEL>{$must}
             </td>
             <td>
+{render acl=$cnACL}
                 <input type="text" size=40 value="{$cn}" name="cn" id="cn">
+{/render}
             </td>
         </tr>
         <tr>
             <td><LABEL for="description">{t}Description{/t}</LABEL>
             </td>
             <td>
+{render acl=$descriptionACL}
                 <input type="text" size=40 value="{$description}" name="description" id="description">
+{/render}
             </td>
         </tr>
         <tr>
             <td><LABEL for="description">{t}Device type{/t}</LABEL>
             </td>
             <td>
-               <select id="type" size="1" name="type" title="{t}Choose the device type{/t}">
-                       {html_options options=$types selected=$type}
-               </select>
+{render acl=$typeACL}
+                               <select id="type" size="1" name="type" title="{t}Choose the device type{/t}">
+                                       {html_options options=$types selected=$type}
+                               </select>
+{/render}
             </td>
         </tr>
     </table>
@@ -45,7 +53,9 @@
             <td><LABEL for="dev_id">{t}Serial number{/t}&nbsp;{t}(iSerial){/t}</LABEL>{$must}
             </td>
             <td>
+{render acl=$dev_idACL}
                 <input type="text" value="{$dev_id}" name="dev_id" id="dev_id">
+{/render}
             </td>
             <td colspan="2">&nbsp;</td>
         </tr>
             <td><LABEL for="vendor">{t}Vendor-ID{/t}&nbsp;{t}(idVendor){/t}</LABEL>{$must}
             </td>
             <td>
+{render acl=$vendorACL}
                 <input type="text" value="{$vendor}" name="vendor" id="vendor">
+{/render}
             </td>
         </tr>
         <tr>
           <td><LABEL for="produkt">{t}Product-ID{/t}&nbsp;{t}(idProduct){/t}</LABEL>{$must}
             </td>
             <td>
+{render acl=$serialACL}
                 <input type="text" value="{$serial}" name="serial" id="serial">
+{/render}
             </td>
         </tr>
     </table>