Code

Fixed ogroup saving
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Oct 2006 07:05:26 +0000 (07:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Oct 2006 07:05:26 +0000 (07:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4865 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiVariableEntry.inc
plugins/admin/fai/faiVariableEntry.tpl

index aed508d30d69bb4f6850939b92a21adb16011880..6dc864d17c9ba9fadef3a28bff5a15101b6a6439 100644 (file)
@@ -62,14 +62,17 @@ class faiVariableEntry extends plugin
       }
     }
 
-    foreach($this->attributes as $attr){
-      if(($this->FAIstate == "freeze") || (chkacl($this->acl,$attr)!= "")){
-        $smarty->assign($attr."ACL"," disabled ");
-      }else{
-        $smarty->assign($attr."ACL","  ");
+    $tmp = $this->plInfo();
+    foreach($tmp['plProvidedAcls'] as $name => $translated){
+      $acl = $this->getacl($name);
+      if($this->FAIstate == "freezed"){
+        $acl = preg_replace("/w/","",$acl);
       }
+      $smarty->assign($name."ACL",$acl);
     }
 
+
+
     $display.= $smarty->fetch(get_template_path('faiVariableEntry.tpl', TRUE));
     return($display);
   }
@@ -77,12 +80,14 @@ class faiVariableEntry extends plugin
   /* Save data to object */
   function save_object()
   {
-    if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
+     if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
       foreach($this->attributes as $attrs){
-        if(isset($_POST[$attrs])){
-          $this->$attrs = $_POST[$attrs];
-        }else{
-          $this->$attrs = "";
+        if($this->acl_is_writeable($attrs)){
+          if(isset($_POST[$attrs])){
+            $this->$attrs = $_POST[$attrs];
+          }else{
+            $this->$attrs = "";
+          }
         }
       }
     }
index c4d6fc63817fba1265e509bdeffba744b8c76895..07f4038ad2ab605515149a24a49bf4f4ea27fd87 100644 (file)
@@ -9,7 +9,9 @@
                                                        {t}Name{/t}{$must}&nbsp;
                                                </td>
                                                <td>
-                                                       <input value="{$cn}" size="45" maxlength="80" name="cn" {$cnACL}>
+{render acl=$cnACL}
+                                                       <input value="{$cn}" size="45" maxlength="80" name="cn">
+{/render}
                                                </td>
                                        </tr>
                                        <tr>
@@ -17,7 +19,9 @@
                                                        {t}Description{/t}&nbsp;
                                                </td>
                                                <td>
-                                                       <input value="{$description}" size="45" maxlength="80" name="description" {$descriptionACL}>
+{render acl=$descriptionACL}
+                                                       <input value="{$description}" size="45" maxlength="80" name="description">
+{/render}
                                                </td>
                                        </tr>
                                </table>
@@ -35,7 +39,9 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input type="text" name="FAIvariableContent" value="{$FAIvariableContent}" id="Content" style="width:250px;" {$FAIvariableContentACL}>
+{render acl=$FAIvariableContentACL}
+                                                       <input type="text" name="FAIvariableContent" value="{$FAIvariableContent}" id="Content" style="width:250px;">
+{/render}
                                                </td>
                                        </tr>
                                </table>
@@ -45,7 +51,7 @@
 <p class="seperator">&nbsp;</p>
 <br>
 <div style="align:right;" align="right">
-       <input type="submit" value="{t}Apply{/t}"       name="SaveSubObject" {$cnACL}>&nbsp;
+       <input type="submit" value="{t}Apply{/t}"       name="SaveSubObject" >&nbsp;
        <input type="submit" value="{t}Cancel{/t}"      name="CancelSubObject">
 </div>