Code

Updated FAI script
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Jul 2008 08:44:01 +0000 (08:44 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Jul 2008 08:44:01 +0000 (08:44 +0000)
-Updated ACL handling

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

gosa-plugins/fai/admin/fai/class_faiManagement.inc
gosa-plugins/fai/admin/fai/class_faiScript.inc
gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc
gosa-plugins/fai/admin/fai/faiScriptEntry.tpl

index 3e495a9d5afe58c1e00846d2cbb04b9cb9a0ce80..7c08866ca461bca487610de3e28dce4ff11c6b75 100644 (file)
@@ -432,13 +432,9 @@ class faiManagement extends plugin
 
                        $this->dialog     = new $a_setup[0]($this->config,$this->config->data['TABS'][$a_setup[2]],$this->dn,"fai");
       $this->dialog->parent = &$this;
-      $this->dialog->by_object[$a_setup[1]]->FAIstate = $entry['FAIstate'];;
+      $this->dialog->by_object[$a_setup[1]]->FAIstate = $entry['FAIstate'];
       $this->dialog->set_acl_base($this->dn);
                        $this->is_dialog  = true;
-
-      if(preg_match("/^freeze/", $entry['FAIstate']) || $this->no_save){
-#        $this->dialog->set_acl_base("freezed")  ;    
-      }
                        session::set('objectinfo',$this->dn);
                }
 
index 9e33a5d884ad6a59b2ded89a30e04b7126a1262e..dec9e21e71da30ee6ecada1d0545a1bb303e4b82 100644 (file)
@@ -30,7 +30,7 @@ class faiScript extends plugin
   var $is_dialog        = false;    // specifies which buttons will be shown to save or abort
   var $SubObjects       = array();  // All leafobjects of this object
 
-  var $FAIstate         = "";
+  var $FAIstate         = "branch";
   var $sort_by          = "name";
   var $sort_order       = "up";
 
@@ -156,8 +156,9 @@ class faiScript extends plugin
     $display= "";
 
     /* Add new sub object */
-    if(isset($_POST['AddSubObject'])){
+    if(isset($_POST['AddSubObject']) && !preg_match("/freeze/i",$this->FAIstate)){
       $this->dialog= new $this->subClassName($this->config,"new");
+      $this->dialog->FAIstate = $this->FAIstate;
       $this->dialog->set_acl_base($this->acl_base);
       $this->dialog->set_acl_category("fai");
       $this->dialog->parent = &$this;
@@ -190,7 +191,7 @@ class faiScript extends plugin
       }
 
       /* Delete script requested */
-      if(preg_match("/^deletescript_/",$name)){
+      if(preg_match("/^deletescript_/",$name) && preg_match("/freeze/i",$this->FAIstate)){
         $s_action = "remove";
         $s_entry = preg_replace("/^deletescript_/","",$name);
         $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry));
@@ -215,6 +216,7 @@ class faiScript extends plugin
 
       /* Create new dialog and set acl attributes  */
       $this->dialog= new $this->subClassName($this->config,$this->dn,$obj);
+      $this->dialog->FAIstate = $this->FAIstate;
       $this->dialog->set_acl_base($this->acl_base_for_current_object($obj['dn']));
       $this->dialog->set_acl_category("fai");
 
index a7a265eb16c6e45566795e9a724098b34bc4d06c..91c04d67bfba5905f459772c6d4c756ed264bb56 100644 (file)
@@ -28,11 +28,6 @@ class faiScriptEntry extends plugin
         $oname = $name;
         $this->$oname=$value;
       }
-
-      if(isset($this->attrs['FAIstate'][0])){
-        $this->FAIstate = $this->attrs['FAIstate'][0];
-      }
-
     }else{
       if(is_array($object)&&count($object)){
         $this->orig_cn= $object['cn'];
@@ -56,6 +51,7 @@ class faiScriptEntry extends plugin
 
     /* Fill templating stuff */
     $smarty     = get_smarty();
+    $smarty->assign("freeze", preg_match("/freeze/i",$this->FAIstate));
     $display = "";
   
     if(isset($_POST['ImportUpload']) && $this->acl_is_writeable("FAIscript")){
@@ -101,10 +97,7 @@ class faiScriptEntry extends plugin
 
     $tmp = $this->plInfo();
     foreach($tmp['plProvidedAcls'] as $name => $translated){
-      $acl = $this->getacl($name);
-      if($this->FAIstate == "freezed"){
-        $acl = preg_replace("/w/","",$acl);
-      }
+      $acl = $this->getacl($name,preg_match("/freeze/i",$this->FAIstate));
       $smarty->assign($name."ACL",$acl);
     }
 
index a01b2e776b59afcc7432439618d23585cda5603e..b25239f9186af3b72c9e2d1edf5bc54338b9a168 100644 (file)
@@ -80,7 +80,9 @@
 </div>
 <br>
 <div style="align:right;" align="right">
+{if !$freeze}
        <input type="submit" value="{msgPool type=applyButton}"         name="SaveSubObject">&nbsp;
+{/if}
        <input type="submit" value="{msgPool type=cancelButton}"        name="CancelSubObject">
 </div>
 <!-- Place cursor -->