Code

Freezed releases can now be viewed, but not changed ...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 6 Mar 2006 08:17:08 +0000 (08:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 6 Mar 2006 08:17:08 +0000 (08:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2811 594d385d-05f5-0310-b6e9-bd551577e9d8

25 files changed:
plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiHookEntry.inc
plugins/admin/fai/class_faiManagement.inc
plugins/admin/fai/class_faiPackage.inc
plugins/admin/fai/class_faiPartitionTable.inc
plugins/admin/fai/class_faiPartitionTableEntry.inc
plugins/admin/fai/class_faiProfile.inc
plugins/admin/fai/class_faiScript.inc
plugins/admin/fai/class_faiScriptEntry.inc
plugins/admin/fai/class_faiTemplate.inc
plugins/admin/fai/class_faiTemplateEntry.inc
plugins/admin/fai/class_faiVariable.inc
plugins/admin/fai/class_faiVariableEntry.inc
plugins/admin/fai/faiHook.tpl
plugins/admin/fai/faiHookEntry.tpl
plugins/admin/fai/faiPackage.tpl
plugins/admin/fai/faiPartitionTable.tpl
plugins/admin/fai/faiPartitionTableEntry.tpl
plugins/admin/fai/faiProfile.tpl
plugins/admin/fai/faiScript.tpl
plugins/admin/fai/faiScriptEntry.tpl
plugins/admin/fai/faiTemplate.tpl
plugins/admin/fai/faiTemplateEntry.tpl
plugins/admin/fai/faiVariable.tpl
plugins/admin/fai/faiVariableEntry.tpl

index eef163f8828b8e304e712cbf6bcfe14fc8037b49..7dd077eb15cc669b2c1ef5bf2e8cf1bc92aa0f78 100644 (file)
@@ -34,16 +34,33 @@ class faiHook extends plugin
   var $dialog           = NULL;     // a dialog, e.g. new disk dialog
   var $SubObjects       = array();  // All leafobjects of this object
 
+  var $FAIstate         = "";  
+
   function faiHook ($config, $dn= NULL)
   {
     /* Load Attributes */
     plugin::plugin ($config, $dn);
 
+    $this->acl ="#all#";
+
     /* If "dn==new" we try to create a new entry
      * Else we must read all objects from ldap which belong to this entry.
      */
     if($dn != "new"){
       $this->dn =$dn;
+    
+      /* Set acls 
+       */
+      $ui   = get_userinfo();
+      $acl  = get_permissions ($this->dn, $ui->subtreeACL);
+      $acli = get_module_permission($acl, "FAIclass", $this->dn);
+      $this->acl=$acli;
+
+      /* Get FAIstate
+       */
+      if(isset($this->attrs['FAIstate'][0])){
+        $this->FAIstate = $this->attrs['FAIstate'][0];
+      }
 
       /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
        */
@@ -53,7 +70,7 @@ class faiHook extends plugin
 
       while($object = $ldap->fetch()){
         /* Set status for save management */
-  
+
         foreach($this->subAttributes as $attrs){
           if(!isset($object[$attrs][0])){
             $this->SubObjects[$object['cn'][0]][$attrs]="";
@@ -61,7 +78,7 @@ class faiHook extends plugin
             $this->SubObjects[$object['cn'][0]][$attrs]=$object[$attrs][0];
           }
         }
-     
+
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
 
@@ -93,8 +110,8 @@ class faiHook extends plugin
 
   function execute()
   {
-       /* Call parent execute */
-       plugin::execute();
+    /* Call parent execute */
+    plugin::execute();
 
     /* Fill templating stuff */
     $smarty= get_smarty();
@@ -109,6 +126,7 @@ class faiHook extends plugin
         $entry = preg_replace("/^editscript_/","",$name);
         $entry = base64_decode(preg_replace("/_.*/","",$entry));
         $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$entry]);
+        $this->dialog->acl = $this->acl;
         $_SESSION['objectinfo'] = $this->SubObjects[$entry]['dn'];
         $this->dialog->parent = &$this;
         $this->is_dialog=true;
@@ -129,23 +147,25 @@ class faiHook extends plugin
     /* Add new sub object */
     if(isset($_POST['AddSubObject'])){
       $this->dialog= new $this->subClassName($this->config,"new");
+      $this->dialog->acl = $this->acl;
       $this->dialog->parent = &$this;
       $this->is_dialog=true;
     }
-  
+
     if($this->dn != "new"){
       $_SESSION['objectinfo']= $this->dn;
     }
     /* Edit selected Sub Object */
     if((isset($_POST['EditSubObject']))&&(isset($_POST['SubObject']))){
       $hook = $_POST['SubObject'][0];
-    
+
       $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$hook]);
+      $this->dialog->acl = $this->acl;
       $this->dialog->parent = &$this;
       $_SESSION['objectinfo'] = $this->SubObjects[$hook]['dn'];
       $this->is_dialog=true;
     }
-    
+
     /* Remove Sub object */
     if((isset($_POST['DelSubObject']))&&(isset($_POST['SubObject']))){
       foreach($_POST['SubObject'] as $hook){
@@ -221,13 +241,19 @@ class faiHook extends plugin
     }
 
 
-    
+
     /* Divlist            added 28.02.2006
        Containing FAIscripts
      */
+
     $divlist = new divSelectBox("FAIhooks");
-    $img_edit = "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("edit")."' alt='"._("edit")."'>";
-    $img_remo = "<input type='image' src='images/edittrash.png' name='deletescript_%s'  title='"._("delete")."' alt='"._("delete")."'>";
+    if((chkacl($this->acl,"cn")!="") || ($this->FAIstate == "freeze")){
+      $img_edit = "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("edit")."' alt='"._("edit")."'>";
+      $img_remo = ""; 
+    }else{
+      $img_edit = "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("edit")."' alt='"._("edit")."'>";
+      $img_remo = "<input type='image' src='images/edittrash.png' name='deletescript_%s'  title='"._("delete")."' alt='"._("delete")."'>";
+    }
 
     foreach($this->getList(true) as $key => $name){
 
@@ -235,26 +261,23 @@ class faiHook extends plugin
         $down = "";
       }else{
         $down = "<a href='getFAIscript.php?id=".base64_encode($name['dn'])."' target='_blank'>
-                      <img src='images/save.png' alt='"._("Download")."' title='"._("Download")."' border=0>
-                 </a>";
+          <img src='images/save.png' alt='"._("Download")."' title='"._("Download")."' border=0>
+          </a>";
       }
 
       $divlist->AddEntry(array( array("string"=>$name['name']),
-                                array("string"=>$down , "attach" => "style='width:20px;'"),
-                                array("string"=>str_replace("%s",base64_encode($key),$img_edit.$img_remo),
-                                      "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));
+            array("string"=>$down , "attach" => "style='width:20px;'"),
+            array("string"=>str_replace("%s",base64_encode($key),$img_edit.$img_remo),
+              "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));
     }
     $smarty->assign("Entry_divlist",$divlist->DrawList());
     /* Divlist creation complete
      */
 
-
-
-
     $smarty->assign("SubObjects",$this->getList());
     $smarty->assign("SubObjectKeys",array_flip($this->getList()));
 
-     /* Magic quotes GPC, escapes every ' " \, to solve some security risks
+    /* Magic quotes GPC, escapes every ' " \, to solve some security risks
      * If we post the escaped strings they will be escaped again
      */
     foreach($this->attributes as $attrs){
@@ -265,12 +288,16 @@ class faiHook extends plugin
       }
     }
 
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+    }
+
     $display.= $smarty->fetch(get_template_path('faiHook.tpl', TRUE));
     return($display);
   }
 
   /* Generate listbox friendly SubObject list
-  */
+   */
   function getList($use_dns=false){
     $a_return=array();
     foreach($this->SubObjects as $obj){
@@ -310,7 +337,7 @@ class faiHook extends plugin
    */
   function save_object()
   {
-    if(isset($_POST['FAIhook_posted'])){
+    if((isset($_POST['FAIhook_posted'])) && ($this->FAIstate != "freeze")){
       plugin::save_object();
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
@@ -333,7 +360,7 @@ class faiHook extends plugin
   function save()
   {
     plugin::save();
+
     $ldap = $this->config->get_ldap_link();
 
     $ldap->cat($this->dn);
@@ -341,7 +368,7 @@ class faiHook extends plugin
       /* Write FAIscript to ldap*/ 
       $ldap->cd($this->dn);
       $this->cleanup();
-$ldap->modify ($this->attrs); 
+      $ldap->modify ($this->attrs); 
 
     }else{
       /* Write FAIscript to ldap*/ 
@@ -351,7 +378,7 @@ $ldap->modify ($this->attrs);
       $ldap->add($this->attrs);
     }
     show_ldap_error($ldap->get_error()); 
+
     /* Prepare FAIscriptEntry to write it to ldap
      * First sort array.
      *  Because we must delete old entries first.
@@ -397,7 +424,7 @@ $ldap->modify ($this->attrs);
           $obj['status']="modify";
         }
       }
+
       if($obj['status'] == "delete"){
         $ldap->cd($sub_dn);
         $ldap->rmdir_recursive($sub_dn);
@@ -405,7 +432,7 @@ $ldap->modify ($this->attrs);
       }elseif($obj['status'] == "edited"){
         $ldap->cd($sub_dn);
         $this->cleanup();
-$ldap->modify ($tmp); 
+        $ldap->modify ($tmp); 
 
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
@@ -421,7 +448,7 @@ $ldap->modify ($tmp);
       show_ldap_error($ldap->get_error()); 
     }
   }
-  
+
   function readBinary($attr,$dn){
     $Data  ="";
     $ds= ldap_connect($this->config->current['SERVER']);
index 83396e99214b69922e0ca0744cb0c14042d09b3c..8a7f0c990cef0ef446a8b78c42123af350945d1f 100644 (file)
@@ -22,6 +22,8 @@ class faiHookEntry extends plugin
   var $FAIscript     = "";
   var $description   = "";
   var $status        = "new";
+
+  var $FAIstate      = "";
   
   function faiHookEntry ($config, $dn= NULL,$object=false)
   {
@@ -33,6 +35,11 @@ class faiHookEntry extends plugin
         $oname = $name;
         $this->$oname=$value;
       }
+
+      if(isset($this->attrs['FAIstate'][0])){
+        $this->FAIstate = $this->attrs['FAIstate'][0];
+      }
+
     }elseif(is_array($object)){
       if(count($object)){
         $this->orig_cn= $object['cn'];
@@ -100,6 +107,14 @@ class faiHookEntry 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","  ");
+      }
+    }
+
     $display.= $smarty->fetch(get_template_path('faiHookEntry.tpl', TRUE));
     return($display);
   }
@@ -107,7 +122,7 @@ class faiHookEntry extends plugin
   /* Save data to object */
   function save_object()
   {
-    if(isset($_POST['SubObjectFormSubmitted'])){
+    if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
           $this->$attrs = $_POST[$attrs];
index 9ca356db27df040b2cdd04719c6e3dd0dd1b6583..3a03dfecff4722ab19673ec52923302c4b47a74a 100644 (file)
@@ -295,10 +295,12 @@ class faiManagement extends plugin
                        $this->dialog= new $a_setup[0]($this->config,
                                        $this->config->data['TABS'][$a_setup[2]],$this->dn);
                        $this->is_dialog = true;
+      if($entry['FAIstate'] == "freeze"){
+        $this->dialog->set_acl(array("*none*"))  ;
+      }
                        $_SESSION['objectinfo'] = $this->dn;
                }
 
-
     /*  Branch handling 
         09.01.2006
     */
@@ -768,9 +770,15 @@ class faiManagement extends plugin
                                        }
 
           if($value['FAIstate'] == "freeze"){
-            $acti = "";
-            $edi  = "%NAME%";
+            $action  = "<input class='center' type='image' src='images/edit.png'       alt='"._("edit")."'   
+              name='entry_edit_%KEY%' title='"._("Edit class")."'>";
+            $edi = $editlink;
+            $acti = $action;
           }else{
+            $action  = "<input class='center' type='image' src='images/edit.png'       alt='"._("edit")."'   
+              name='entry_edit_%KEY%' title='"._("Edit class")."'>";
+            $action .= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."' 
+              name='entry_delete_%KEY%' title='"._("Delete class")."'>";
             $acti = $action;
             $edi = $editlink;
           }
index 1540bb748111efaf31edc3213d17a608367517cf..bf9b32ba937d86391dad6d4a85cf2122a821f7a0 100644 (file)
@@ -54,17 +54,34 @@ class faiPackage extends plugin
   var $strID            ="";
   var $newDialogShown   =false;
 
+  var $FAIstate         = "";
+
   function faiPackage ($config, $dn= NULL)
   {
     /* Load Attributes */
     plugin::plugin ($config, $dn);
 
+    $this->acl ="#all#";
+
     /* If "dn==new" we try to create a new entry
      * Else we must read all objects from ldap which belong to this entry.
      * First read SubObjects from ldap ... and then the partition definitions for the SubObjects.
      */
     if($dn != "new"){
       $this->dn =$dn;
+
+      /* Set acls
+       */
+      $ui   = get_userinfo();
+      $acl  = get_permissions ($this->dn, $ui->subtreeACL);
+      $acli = get_module_permission($acl, "FAIclass", $this->dn);
+      $this->acl=$acli;
+
+      /* Get FAIstate
+       */
+      if(isset($this->attrs['FAIstate'][0])){
+        $this->FAIstate = $this->attrs['FAIstate'][0];
+      }
     }
 
     if(isset($this->attrs['FAIpackage'])){
@@ -179,9 +196,11 @@ class faiPackage extends plugin
 
     /* Delte selected package */ 
     if(isset($_POST['Delpkg'])){
-      foreach($_POST['usedPackages'] as $del){
-        if(isset($this->usedPackages[$del])){
-          unset($this->usedPackages[$del]);
+      if($this->FAIstate != "freeze"){
+        foreach($_POST['usedPackages'] as $del){
+          if(isset($this->usedPackages[$del])){
+            unset($this->usedPackages[$del]);
+          }
         }
       }
     }
@@ -194,17 +213,22 @@ class faiPackage extends plugin
 
     /* attach new packages */
     if(isset($_POST['SaveSubObject'])) {
-      $this->dialog->save_object();
-      if(count($this->dialog->check())){
-        foreach($this->dialog->check() as $msgs){
-        print_red($msgs);
+      if($this->FAIstate != "freeze"){
+        $this->dialog->save_object();
+        if(count($this->dialog->check())){
+          foreach($this->dialog->check() as $msgs){
+            print_red($msgs);
+          }
+        }else{
+          $use = $this->dialog->save();
+          $this->usedPackages = $use;
+          $this->dialog = false;
+          $this->is_dialog=false;
+          ksort($this->usedPackages);
         }
       }else{
-        $use = $this->dialog->save();
-        $this->usedPackages = $use;
         $this->dialog = false;
         $this->is_dialog=false;
-        ksort($this->usedPackages);
       }
     }
 
@@ -219,12 +243,15 @@ class faiPackage extends plugin
       }
   
       $this->dialog = new faiPackageConfiguration($this->config, $this->dn,$pkg, $path, $pkg_config);
+      $this->dialog ->acl = $this->acl;
       $this->is_dialog =true;
     }
   
     /* Save Configuration */
     if(isset($_POST['SaveObjectConfig'])){
-      $this->ConfiguredPackages= array_merge($this->ConfiguredPackages,$this->dialog->save());
+      if($this->FAIstate != "freeze"){
+        $this->ConfiguredPackages= array_merge($this->ConfiguredPackages,$this->dialog->save());
+      }
       $this->dialog = false;
       $this->is_dialog=false;
     }
@@ -246,6 +273,10 @@ class faiPackage extends plugin
        $strsec .= $sec." ";
     }
 
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+    }
+
     $smarty->assign("OptionsACL","");
 
     $smarty->assign("releases",$this->releases);
@@ -272,8 +303,11 @@ class faiPackage extends plugin
    */
   function save_object()
   {
-    
+  
+    if($this->FAIstate == "freeze") return;  
     plugin::save_object();
+  
+
     foreach($this->attributes as $attrs){
       if(isset($_POST[$attrs])){
         $this->$attrs = $_POST[$attrs];
index 77b2e76e83075ce9da883a78eb31e6cc7e1d5739..b5ea44e3bb5a941c4bcb2ff0cc24b659964a3093 100644 (file)
@@ -19,11 +19,15 @@ class faiPartitionTable extends plugin
   var $is_dialog        = false;    // specifies which buttons will be shown to save or abort
   var $dialog           = NULL;     // a dialog, e.g. new disk dialog
 
+  var $FAIstate         = "";
+
   function faiPartitionTable ($config, $dn= NULL)
   {
     /* Load Attributes */
     plugin::plugin ($config, $dn);
 
+    $this->acl ="#all#";
+
     /* If "dn==new" we try to create a new entry
      * Else we must read all objects from ldap which belong to this entry.
      * First read disks from ldap ... and then the partition definitions for the disks.
@@ -31,6 +35,19 @@ class faiPartitionTable extends plugin
     if($dn != "new"){
       $this->dn =$dn;
 
+      /* Set acls
+       */
+      $ui   = get_userinfo();
+      $acl  = get_permissions ($this->dn, $ui->subtreeACL);
+      $acli = get_module_permission($acl, "FAIclass", $this->dn);
+      $this->acl=$acli;
+
+      /* Get FAIstate
+       */
+      if(isset($this->attrs['FAIstate'][0])){
+        $this->FAIstate = $this->attrs['FAIstate'][0];
+      }
+
       /* Read all disks from ldap taht are defined fot this partition table 
        */
       $ldap = $this->config->get_ldap_link();
@@ -94,6 +111,8 @@ class faiPartitionTable extends plugin
         $usedDiskNames[]= $key;
       }
       $this->dialog = new faiPartitionTableEntry($this->config,$this->dn,$usedDiskNames); 
+      $this->dialog->acl = $this->acl;
+      $this->dialog->FAIstate = $this->FAIstate;
       $this->is_dialog = true;
     }
 
@@ -116,6 +135,8 @@ class faiPartitionTable extends plugin
         }
       }
       $this->dialog = new faiPartitionTableEntry($this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]); 
+      $this->dialog->acl = $this->acl;
+      $this->dialog->FAIstate = $this->FAIstate;
       $_SESSION['objectinfo'] = $this->disks[$Udisk]['dn'];
       $this->is_dialog = true;
     }
@@ -127,40 +148,46 @@ class faiPartitionTable extends plugin
       $this->dialog = NULL;
       $this->is_dialog=false;
     }
-  
+
     /* Dialog saved
      * Save given data from Dialog, if no error is occured
      */
     if(isset($_POST['SaveDisk'])){
-      $this->dialog->save_object();
-      if(count($this->dialog->check())){
-        foreach($this->dialog->check() as $msg){
-          print_red($msg);
-        }
-      }else{
-        $disk = $this->dialog->save();
-        if(isset($disk['rename'])){
-          if($this->disks[$disk['rename']['from']]['status']=="edited"){
-            $this->disks[$disk['rename']['from']]['status']="delete";
-          }else{
-            unset($this->disks[$disk['rename']['from']]);
+
+      if($this->FAIstate != "freeze"){
+        $this->dialog->save_object();
+        if(count($this->dialog->check())){
+          foreach($this->dialog->check() as $msg){
+            print_red($msg);
           }
-  
-          foreach($disk['partitions'] as $key => $val){
-            if($disk['partitions'][$key]['status']!="delete"){
-              $disk['partitions'][$key]['status']= "new";
+        }else{
+          $disk = $this->dialog->save();
+          if(isset($disk['rename'])){
+            if($this->disks[$disk['rename']['from']]['status']=="edited"){
+              $this->disks[$disk['rename']['from']]['status']="delete";
+            }else{
+              unset($this->disks[$disk['rename']['from']]);
             }
+
+            foreach($disk['partitions'] as $key => $val){
+              if($disk['partitions'][$key]['status']!="delete"){
+                $disk['partitions'][$key]['status']= "new";
+              }
+            }
+
+            $disk['status']="new";
+            $disk['cn']= $disk['rename']['to'];
           }
 
-          $disk['status']="new";
-          $disk['cn']= $disk['rename']['to'];
+          $this->disks[$disk['cn']]=$disk; 
+          unset($this->dialog);
+          $this->dialog = NULL;
+          $this->is_dialog=false;
+          ksort($this->disks);
         }
-      
-        $this->disks[$disk['cn']]=$disk; 
-        unset($this->dialog);
+      }else{
         $this->dialog = NULL;
         $this->is_dialog=false;
-        ksort($this->disks);
       }
     }
 
@@ -168,22 +195,23 @@ class faiPartitionTable extends plugin
      * Assign delete status for all its partitions      
      */
     if((isset($_POST['DelDisk']))&&(!empty($_POST['disks']))){
-
-      foreach($_POST['disks'] as $disk) {
-        if($this->disks[$disk]['status']=="edited"){
-          $this->disks[$disk."-delete"]=$this->disks[$disk];
-          unset($this->disks[$disk]);
-          $disk = $disk."-delete";        
-          $this->disks[$disk]['status']="delete";
-          foreach($this->disks[$disk]['partitions'] as $name => $value ){
-            if($value['status']=="edited"){
-              $this->disks[$disk]['partitions'][$name]['status']="delete"; 
-            }else{
-              unset($this->disks[$disk]['partitions'][$name]);
+      if($this->FAIstate != "freeze"){
+        foreach($_POST['disks'] as $disk) {
+          if($this->disks[$disk]['status']=="edited"){
+            $this->disks[$disk."-delete"]=$this->disks[$disk];
+            unset($this->disks[$disk]);
+            $disk = $disk."-delete";        
+            $this->disks[$disk]['status']="delete";
+            foreach($this->disks[$disk]['partitions'] as $name => $value ){
+              if($value['status']=="edited"){
+                $this->disks[$disk]['partitions'][$name]['status']="delete"; 
+              }else{
+                unset($this->disks[$disk]['partitions'][$name]);
+              }
             }
+          }else{
+            unset($this->disks[$disk]);
           }
-        }else{
-          unset($this->disks[$disk]);
         }
       }
     }
@@ -205,7 +233,11 @@ class faiPartitionTable extends plugin
         $smarty->assign($attrs."CHK"," disabled ");
       }
     }
-    
+   
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+    }
+
     $disks = $this->getDisks();
     $smarty->assign("disks"   ,$disks);
     $smarty->assign("diskKeys",array_flip($disks));
@@ -262,6 +294,7 @@ class faiPartitionTable extends plugin
    */
   function save_object()
   {
+    if($this->FAIstate == "freeze") return;
     plugin::save_object();
     foreach($this->attributes as $attrs){
       if(isset($_POST[$attrs])){
index 408b361d20d06518fdd8020bdf5a96fea49efcbe..83e7a179cfbb2b268ed40386e985ef3c76cd8af5 100644 (file)
@@ -22,6 +22,8 @@ class faiPartitionTableEntry extends plugin
   var $status               = "new";
   var $deletePartitions     = array();
 
+  var $FAIstate             = "";
+
   function faiPartitionTableEntry ($config, $dn= NULL,$usedDiskNames=array(),$disk=false)
   {
     plugin::plugin ($config, $dn);
@@ -151,6 +153,15 @@ class faiPartitionTableEntry extends plugin
       $smarty->assign($attr,$this->$attr);
     }
 
+    foreach($this->UsedAttrs as $attr){
+      if(($this->FAIstate == "freeze") || (chkacl($this->acl,$attr)!= "")){
+        $smarty->assign($attr."ACL"," disabled ");
+      }else{
+        $smarty->assign($attr."ACL","  ");
+      }
+    }
+
+
     /* The user can't change a diskname 
      *  if we are currently in edit mode for the specified disk 
      */
@@ -160,6 +171,8 @@ class faiPartitionTableEntry extends plugin
       $smarty->assign("DISK_cnACL","");
 //    }
 
+  
+
     /* Fetch template and show the result
      */
     $display.= $smarty->fetch(get_template_path('faiPartitionTableEntry.tpl', TRUE));
@@ -199,10 +212,15 @@ class faiPartitionTableEntry extends plugin
         $dis = " disabled ";
       }
 
+      $disableALL = "";
+      if($this->FAIstate =="freeze"){
+        $disableALL = " disabled ";
+      }
+
       if($part['status']!="delete"){
         /* Generate Partition select box  
          */
-        $PartitionType = "<select name='FAIpartitionType_".$key."' id='FAIpartitionType_".$key."' >";
+        $PartitionType = "<select name='FAIpartitionType_".$key."' id='FAIpartitionType_".$key."' ".$disableALL.">";
         foreach($PartitionTypes as $type){
           if($part['FAIpartitionType'] == $type){
             $PartitionType .="<option value='".$type."' selected >".$type."</option>";
@@ -215,7 +233,7 @@ class faiPartitionTableEntry extends plugin
 
         /* Generate fsType select box  
          */
-        $FAIfsType= "<select name='FAIfsType_".$key."' id='FAIfsType_".$key."' ".$dis.">";
+        $FAIfsType= "<select name='FAIfsType_".$key."' id='FAIfsType_".$key."' ".$dis." ".$disableALL.">";
         foreach($FAIfsTypes as $type){
           if($part['FAIfsType'] == $type){
             $FAIfsType  .="<option value='".$type."' selected >".$type."</option>";
@@ -228,10 +246,10 @@ class faiPartitionTableEntry extends plugin
         $str .= "\n<tr>";
         $str .= "\n<td>".$PartitionType."</td>";
         $str .= "\n<td>".$FAIfsType."</td>";
-        $str .= "\n<td><input name='FAImountPoint_".$key."'    ".$dis."  value='".$part['FAImountPoint']."'    id='FAImountPoint_".$key."'></td>";
-        $str .= "\n<td><input name='FAIpartitionSize_".$key."'  ".$dis." value='".$part['FAIpartitionSize']."' id='FAIpartitionSize_".$key."' size=12></td>";
-        $str .= "\n<td><input name='FAImountOptions_".$key."'  ".$dis."  value='".$part['FAImountOptions']."'  id='FAImountOptions_".$key."' style='width:100px;'></td>";
-        $str .= "\n<td><input name='FAIfsOptions_".$key."'     ".$dis."  value='".$part['FAIfsOptions']."'     id='FAIfsOptions_".$key."' style='width:100px;'></td>";
+        $str .= "\n<td><input name='FAImountPoint_".$key."'  ".$disableALL."  ".$dis."  value='".$part['FAImountPoint']."'    id='FAImountPoint_".$key."'></td>";
+        $str .= "\n<td><input name='FAIpartitionSize_".$key."' ".$disableALL." ".$dis." value='".$part['FAIpartitionSize']."' id='FAIpartitionSize_".$key."' size=12></td>";
+        $str .= "\n<td><input name='FAImountOptions_".$key."' ".$disableALL."  ".$dis."  value='".$part['FAImountOptions']."'  id='FAImountOptions_".$key."' style='width:100px;'></td>";
+        $str .= "\n<td><input name='FAIfsOptions_".$key."'   ".$disableALL."  ".$dis."  value='".$part['FAIfsOptions']."'     id='FAIfsOptions_".$key."' style='width:100px;'></td>";
 
         $changeState = "onClick=\"changeState('FAImountPoint_".$key."') ; ".
                                  "changeState('FAIpartitionSize_".$key."') ; ".
@@ -241,11 +259,11 @@ class faiPartitionTableEntry extends plugin
   
 
         if($part['FAIpartitionFlags']!=false){
-          $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' checked ".$changeState."></td>";
+          $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' checked ".$changeState." ".$disableALL."></td>";
         }else{
-          $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' ".$changeState."></td>";
+          $str .= "\n<td><input type='checkbox' name='FAIpartitionFlags_".$key."' value='preserve' ".$changeState." ".$disableALL."></td>";
         }
-        $str .= "\n<td><input type='submit' name='Delete_".$key."' value='"._("Remove")."'></td>";
+        $str .= "\n<td><input type='submit' name='Delete_".$key."' value='"._("Remove")."' ".$disableALL."></td>";
         $str .= "\n</tr>";    
       }
     }
@@ -286,7 +304,7 @@ class faiPartitionTableEntry extends plugin
   /* Save data to object */
   function save_object()
   {
-    if(isset($_POST['TableEntryFrameSubmitted'])){
+    if((isset($_POST['TableEntryFrameSubmitted'])) && ($this->FAIstate != "freeze") ){
       plugin::save_object();
 
       /* Check base attributes */
index c3c6d052bdf2760e0cb7cbb7e33dd5c89b41bc5a..6df1f06a5345b83b85cb5db120d4fee91719b352 100644 (file)
@@ -30,12 +30,25 @@ class faiProfile extends plugin
   var $FAIclasses       = array();  // Contains classname seperated in an array
   var $FAIAllclasses    = array();  // Contains all possible Classnames
 
+  var $FAIstate      = "";
+
   function faiProfile($config, $dn= NULL)
   {
     /* Load Attributes */
     plugin::plugin ($config, $dn);
     $ldap=$this->config->get_ldap_link();
 
+    $this->acl = "#all#";
+
+    if($this->dn != "new"){
+      /* Set acls
+       */
+      $ui   = get_userinfo();
+      $acl  = get_permissions ($this->dn, $ui->subtreeACL);
+      $acli = get_module_permission($acl, "FAIclass", $this->dn);
+      $this->acl=$acli;
+    }
+
     /* Parse ldap attribute to get all assigned classes */
     $tmp = split(" ",$this->FAIclass);
     $tmp2 = array();
@@ -44,7 +57,11 @@ class faiProfile extends plugin
         $tmp2[trim($class)] = trim($class);
       }
     }
-   
+
+    if(isset($this->attrs['FAIstate'][0])){
+      $this->FAIstate = $this->attrs['FAIstate'][0];
+    }
+
     /* Sort assigned classes */ 
     if(is_array($tmp2)){
       foreach($tmp2 as $class){
@@ -298,7 +315,13 @@ class faiProfile extends plugin
   
       $field1 = array("string"=> $usedClass,"attach"=>"");
       $field2 = array("string"=> $str,"attach"=>"");
-      $field3 = array("string"=> preg_replace("/%KEY%/",base64_encode($usedClass),$actions).preg_replace("/%s/",base64_encode($usedClass),$linkupdown),"attach"=>"style='border-right:none;'");
+      if($this->FAIstate != "freeze"){
+        $field3 = array("string"=> preg_replace("/%KEY%/",base64_encode($usedClass),$actions).
+            preg_replace("/%s/",base64_encode($usedClass),$linkupdown),
+            "attach"=>"style='border-right:none;'");
+      }else{
+        $field3 = array("string"=>"&nbsp;", "attach"=>"style='border-right:none;'");
+      }
       $divlist->AddEntry(array($field1,$field2,$field3));
     }
 
@@ -316,6 +339,13 @@ class faiProfile 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","  ");
+      }
+    }
 
     $display.= $smarty->fetch(get_template_path('faiProfile.tpl', TRUE));
     return($display);
index 08859d81615720686d424ca00568ba3bcabd378e..c8bc4d80272fc66e402b34d01d0287ddfba22b26 100644 (file)
@@ -34,18 +34,36 @@ class faiScript extends plugin
   var $dialog           = NULL;     // a dialog, e.g. new disk dialog
   var $SubObjects       = array();  // All leafobjects of this object
 
+  var $FAIstate         ="";
+
   function faiScript ($config, $dn= NULL)
   {
     /* Load Attributes */
     plugin::plugin ($config, $dn);
 
+    $this->acl ="#all#";
+    
     /* If "dn==new" we try to create a new entry
      * Else we must read all objects from ldap which belong to this entry.
      * First read SubObjects from ldap ... and then the partition definitions for the SubObjects.
      */
     if($dn != "new"){
+
+      /* Set acls
+       */
+      $ui   = get_userinfo();
+      $acl  = get_permissions ($this->dn, $ui->subtreeACL);
+      $acli = get_module_permission($acl, "FAIclass", $this->dn);
+      $this->acl=$acli;
+
       $this->dn =$dn;
 
+      /* Get FAIstate
+       */
+      if(isset($this->attrs['FAIstate'][0])){
+        $this->FAIstate = $this->attrs['FAIstate'][0];
+      }
+
       /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
        */
       $ldap     = $this->config->get_ldap_link();
@@ -54,7 +72,7 @@ class faiScript extends plugin
 
       while($object = $ldap->fetch()){
         /* Set status for save management */
-  
+
         foreach($this->subAttributes as $attrs){
           if(!isset($object[$attrs][0])){
             $this->SubObjects[$object['cn'][0]][$attrs]="";
@@ -62,7 +80,7 @@ class faiScript extends plugin
             $this->SubObjects[$object['cn'][0]][$attrs]=$object[$attrs][0];
           }
         }
-     
+
         foreach($this->sub64coded as $codeIt){
           $this->SubObjects[$object['cn'][0]][$codeIt]=(base64_decode($this->SubObjects[$object['cn'][0]][$codeIt]));
         }
@@ -72,7 +90,7 @@ class faiScript extends plugin
         }
 
         $this->SubObjects[$object['cn'][0]]['FAIscript']   = addslashes ($this->readBinary("FAIscript",$object['dn']));
+
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
       }
@@ -81,8 +99,8 @@ class faiScript extends plugin
 
   function execute()
   {
-       /* Call parent execute */
-       plugin::execute();
+    /* Call parent execute */
+    plugin::execute();
 
     /* Fill templating stuff */
     $smarty= get_smarty();
@@ -91,6 +109,7 @@ class faiScript extends plugin
     /* Add new sub object */
     if(isset($_POST['AddSubObject'])){
       $this->dialog= new $this->subClassName($this->config,"new");
+      $this->dialog->acl = $this->acl;
       $this->is_dialog=true;
     }
 
@@ -108,6 +127,7 @@ class faiScript extends plugin
         $entry = preg_replace("/^editscript_/","",$name);
         $entry = base64_decode(preg_replace("/_.*/","",$entry));
         $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$entry]);
+        $this->dialog->acl = $this->acl;
         $_SESSION['objectinfo'] = $this->SubObjects[$entry]['dn'];
         $this->is_dialog=true;
       }
@@ -123,17 +143,17 @@ class faiScript extends plugin
       }
     }
     ///// Ende new list handling
-    
+
 
     /* Edit selected Sub Object */
     if((isset($_POST['EditSubObject']))&&(isset($_POST['SubObject']))){
       $script = $_POST['SubObject'][0];
-    
       $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$script]);
+      $this->dialog->acl = $this->acl;
       $_SESSION['objectinfo'] = $this->SubObjects[$script]['dn'];
       $this->is_dialog=true;
     }
-    
+
     /* Remove Sub object */
     if((isset($_POST['DelSubObject']))&&(isset($_POST['SubObject']))){
 
@@ -203,23 +223,28 @@ class faiScript extends plugin
        Containing FAIscripts 
      */
     $divlist = new divSelectBox("FAIscripts");
-    $img_edit = "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("edit")."' alt='"._("edit")."'>";
-    $img_remo = "<input type='image' src='images/edittrash.png' name='deletescript_%s'  title='"._("delete")."' alt='"._("delete")."'>";
+    if((chkacl($this->acl,"cn")!="") || ($this->FAIstate == "freeze")){
+      $img_edit = "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("edit")."' alt='"._("edit")."'>";
+      $img_remo = "";
+    }else{
+      $img_edit = "<input type='image' src='images/edit.png'      name='editscript_%s'    title='"._("edit")."' alt='"._("edit")."'>";
+      $img_remo = "<input type='image' src='images/edittrash.png' name='deletescript_%s'  title='"._("delete")."' alt='"._("delete")."'>";
+    }
 
     foreach($this->getList(true) as $key => $name){
-      
+
       if(($this->SubObjects[$key]['status'] == "new") || ($this->SubObjects[$key]['dn'] == "new")){
         $down = "";
       }else{
         $down = "<a href='getFAIscript.php?id=".base64_encode($name['dn'])."' target='_blank'>
-                      <img src='images/save.png' alt='"._("Download")."' title='"._("Download")."' border=0>
-                 </a>"; 
+          <img src='images/save.png' alt='"._("Download")."' title='"._("Download")."' border=0>
+          </a>"; 
       } 
 
       $divlist->AddEntry(array( array("string"=>$name['name']),
-                                array("string"=>$down , "attach" => "style='width:20px;'"),
-                                array("string"=>str_replace("%s",base64_encode($key),$img_edit.$img_remo),
-                                      "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));
+            array("string"=>$down , "attach" => "style='width:20px;'"),
+            array("string"=>str_replace("%s",base64_encode($key),$img_edit.$img_remo),
+              "attach"=>"style='border-right: 0px;width:50px;text-align:right;'")));
     }
     $smarty->assign("Entry_divlist",$divlist->DrawList());
     /* Divlist creation complete
@@ -227,10 +252,10 @@ class faiScript extends plugin
 
     $smarty->assign("SubObjects",$this->getList());
     $smarty->assign("SubObjectKeys",array_flip($this->getList()));
-     
+
     /* Magic quotes GPC, escapes every ' " \, to solve some security risks
-    * If we post the escaped strings they will be escaped again
-    */
+     * If we post the escaped strings they will be escaped again
+     */
     foreach($this->attributes as $attrs){
       if(get_magic_quotes_gpc()){
         $smarty->assign($attrs,stripslashes($this->$attrs));
@@ -239,12 +264,16 @@ class faiScript extends plugin
       }
     }
 
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+    }
+
     $display.= $smarty->fetch(get_template_path('faiScript.tpl', TRUE));
     return($display);
   }
 
   /* Generate listbox friendly SubObject list
-  */
+   */
   function getList($use_dns=false){
     $a_return=array();
     foreach($this->SubObjects as $obj){
@@ -283,7 +312,7 @@ class faiScript extends plugin
    */
   function save_object()
   {
-    if(isset($_POST['FAIscript_posted'])){
+    if((isset($_POST['FAIscript_posted'])) && ($this->FAIstate != "freeze")){
       plugin::save_object();
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
@@ -306,15 +335,15 @@ class faiScript extends plugin
   function save()
   {
     plugin::save();
+
     $ldap = $this->config->get_ldap_link();
-  
+
     $ldap->cat($this->dn);
     if($ldap->count()!=0){
       /* Write FAIscript to ldap*/
       $ldap->cd($this->dn);
       $this->cleanup();
-$ldap->modify ($this->attrs); 
+      $ldap->modify ($this->attrs); 
 
     }else{
       /* Write FAIscript to ldap*/
@@ -324,7 +353,7 @@ $ldap->modify ($this->attrs);
       $ldap->add($this->attrs);
     }
     show_ldap_error($ldap->get_error());
+
     /* Prepare FAIscriptEntry to write it to ldap
      * First sort array.
      *  Because we must delete old entries first.
@@ -359,7 +388,7 @@ $ldap->modify ($this->attrs);
           $tmp[$attrs] = $obj[$attrs];
         }
       }    
-        
+
       $tmp['objectClass'] = $this->subClasses;
 
       $sub_dn = "cn=".$obj['cn'].",".$this->dn;
@@ -374,7 +403,7 @@ $ldap->modify ($this->attrs);
       if(empty($tmp['FAIpriority'])){
         $tmp['FAIpriority']  ="0";
       }
-  
+
       if($obj['status'] == "delete"){
         $ldap->cd($sub_dn);
         $ldap->rmdir_recursive($sub_dn);
@@ -382,7 +411,7 @@ $ldap->modify ($this->attrs);
       }elseif($obj['status'] == "edited"){
         $ldap->cd($sub_dn);
         $this->cleanup();
-$ldap->modify ($tmp); 
+        $ldap->modify ($tmp); 
 
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
index f52c123c5671ace45eb057bb540b64450f2ce0f8..91fa11ff71f34b47cd8f2c6f06ed1ed7baf54d4c 100644 (file)
@@ -21,6 +21,7 @@ class faiScriptEntry extends plugin
   var $description   = "";
   var $status        = "new";
 
+  var $FAIstate      = "";
   
   function faiScriptEntry ($config, $dn= NULL,$object=false)
   {
@@ -32,6 +33,11 @@ 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'];
@@ -89,6 +95,15 @@ class faiScriptEntry extends plugin
     for($i =0 ; $i < 100 ; $i++){
       $FAIprioritys[$i]=$i;
     }
+
+    foreach($this->attributes as $attr){
+      if(($this->FAIstate == "freeze") || (chkacl($this->acl,$attr)!= "")){
+        $smarty->assign($attr."ACL"," disabled ");
+      }else{
+        $smarty->assign($attr."ACL","  ");
+      }
+    }
+
     $smarty->assign("FAIprioritys",$FAIprioritys);
     $display.= $smarty->fetch(get_template_path('faiScriptEntry.tpl', TRUE));
     return($display);
@@ -97,7 +112,7 @@ class faiScriptEntry extends plugin
   /* Save data to object */
   function save_object()
   {
-    if(isset($_POST['SubObjectFormSubmitted'])){
+    if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
           $this->$attrs = $_POST[$attrs];
index 10f81c719542047b246f5f68c7dd0987689b1538..279050b4625e5305d017297b7d147fbb487a1306 100644 (file)
@@ -34,11 +34,15 @@ class faiTemplate extends plugin
   var $dialog           = NULL;     // a dialog, e.g. new disk dialog
   var $SubObjects       = array();  // All leafobjects of this object
 
+  var $FAIstate         = "";
+
   function faiTemplate ($config, $dn= NULL)
   {
     /* Load Attributes */
     plugin::plugin ($config, $dn);
 
+    $this->acl="#all#";
+
     /* If "dn==new" we try to create a new entry
      * Else we must read all objects from ldap which belong to this entry.
      * First read SubObjects from ldap ... and then the partition definitions for the SubObjects.
@@ -46,6 +50,19 @@ class faiTemplate extends plugin
     if($dn != "new"){
       $this->dn =$dn;
 
+      /* Set acls
+       */
+      $ui   = get_userinfo();
+      $acl  = get_permissions ($this->dn, $ui->subtreeACL);
+      $acli = get_module_permission($acl, "FAIclass", $this->dn);
+      $this->acl=$acli;
+
+      /* Get FAIstate
+       */
+      if(isset($this->attrs['FAIstate'][0])){
+        $this->FAIstate = $this->attrs['FAIstate'][0];
+      }
+
       /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
        */
       $ldap     = $this->config->get_ldap_link();
@@ -87,6 +104,7 @@ class faiTemplate extends plugin
     /* Add new sub object */
     if(isset($_POST['AddSubObject'])){
       $this->dialog= new $this->subClassName($this->config,"new");
+      $this->dialog->acl = $this->acl;
       $this->is_dialog=true;
     }
 
@@ -101,6 +119,7 @@ class faiTemplate extends plugin
       $temp = $_POST['SubObject'][0];
     
       $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$temp]);
+      $this->dialog->acl = $this->acl;
       $_SESSION['objectinfo'] = $this->SubObjects[$temp]['dn'];
       $this->is_dialog=true;
     }
@@ -183,6 +202,9 @@ class faiTemplate extends plugin
       }
     }
 
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+    }
 
     $display.= $smarty->fetch(get_template_path('faiTemplate.tpl', TRUE));
     return($display);
@@ -223,7 +245,7 @@ class faiTemplate extends plugin
    */
   function save_object()
   {
-    if(isset($_POST['FAItemplate_posted'])){
+    if((isset($_POST['FAItemplate_posted'])) && ($this->FAIstate != "freeze") ){
       plugin::save_object();
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
@@ -246,15 +268,15 @@ class faiTemplate extends plugin
   function save()
   {
     plugin::save();
+
     $ldap = $this->config->get_ldap_link();
-  
+
     $ldap->cat($this->dn);
     if($ldap->count()!=0){
       /* Write FAIscript to ldap*/
       $ldap->cd($this->dn);
       $this->cleanup();
-$ldap->modify ($this->attrs); 
+      $ldap->modify ($this->attrs); 
 
     }else{
       /* Write FAIscript to ldap*/
@@ -264,7 +286,7 @@ $ldap->modify ($this->attrs);
       $ldap->add($this->attrs);
     }
     show_ldap_error($ldap->get_error());
+
     /* Prepare FAIscriptEntry to write it to ldap
      * First sort array.
      *  Because we must delete old entries first.
index 33b361992a1877d1ad5d60e88b217113a469ee24..33092b851090f5db527b715769b84331750b0802 100644 (file)
@@ -25,6 +25,8 @@ class faiTemplateEntry extends plugin
   var $user          = "root";
   var $group         = "root";
   var $binary        = false;
+
+  var $FAIstate      = "";
   
   function faiTemplateEntry ($config, $dn= NULL,$object=false)
   {
@@ -36,6 +38,11 @@ class faiTemplateEntry extends plugin
         $oname = $name;
         $this->$oname=$value;
       }
+
+      if(isset($this->attrs['FAIstate'][0])){
+        $this->FAIstate = $this->attrs['FAIstate'][0];
+      }
+
     }else{
       $this->status = "new";
       $this->orig_cn       = false;
@@ -106,6 +113,14 @@ class faiTemplateEntry extends plugin
 
     $smarty->assign("FAItemplateFile","");
 
+    foreach($this->attributes as $attr){
+      if(($this->FAIstate == "freeze") || (chkacl($this->acl,$attr)!= "")){
+        $smarty->assign($attr."ACL"," disabled ");
+      }else{
+        $smarty->assign($attr."ACL","  ");
+      }
+    }
+
     $display.= $smarty->fetch(get_template_path('faiTemplateEntry.tpl', TRUE));
     return($display);
   }
@@ -116,7 +131,7 @@ class faiTemplateEntry extends plugin
     if (!isset($_POST['FAItemplatePath'])){
       return;
     }
-    if(isset($_POST['SubObjectFormSubmitted'])){
+    if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
       foreach($this->attributes as $attrs){
         if($attrs == "FAItemplateFile") 
           continue;
@@ -130,22 +145,21 @@ class faiTemplateEntry extends plugin
           $this->$attrs = "";
         }
       }
-    }
-
-    /* Save mode */
-    $tmode= "";
-    foreach (array("s", "u", "g", "o") as $type){
-      $nr= 1;
-      $dest= 0;
-      while ($nr < 5){
-        if (isset($_POST["$type$nr"])){
-          $dest+= $nr;
+      /* Save mode */
+      $tmode= "";
+      foreach (array("s", "u", "g", "o") as $type){
+        $nr= 1;
+        $dest= 0;
+        while ($nr < 5){
+          if (isset($_POST["$type$nr"])){
+            $dest+= $nr;
+          }
+          $nr+= $nr;
         }
-        $nr+= $nr;
+        $tmode= $tmode.$dest;
       }
-      $tmode= $tmode.$dest;
+      $this->FAImode= $tmode;
     }
-    $this->FAImode= $tmode;
   }
 
   /* Check supplied data */
index f6c4a5562658d6e832de1c1d3d5d1dc7c93c3d56..baa760623810ce89323f695b221bcc1f95f318e8 100644 (file)
@@ -34,18 +34,36 @@ class faiVariable extends plugin
   var $dialog           = NULL;     // a dialog, e.g. new disk dialog
   var $SubObjects       = array();  // All leafobjects of this object
 
+  var $FAIstate         = "";
+
   function faiVariable ($config, $dn= NULL)
   {
     /* Load Attributes */
     plugin::plugin ($config, $dn);
 
+    $this->acl ="#all#";
+
     /* If "dn==new" we try to create a new entry
      * Else we must read all objects from ldap which belong to this entry.
      * First read SubObjects from ldap ... and then the partition definitions for the SubObjects.
      */
+
     if($dn != "new"){
       $this->dn =$dn;
 
+      /* Set acls
+       */
+      $ui   = get_userinfo();
+      $acl  = get_permissions ($this->dn, $ui->subtreeACL);
+      $acli = get_module_permission($acl, "FAIclass", $this->dn);
+      $this->acl=$acli;
+
+      /* Get FAIstate
+       */
+      if(isset($this->attrs['FAIstate'][0])){
+        $this->FAIstate = $this->attrs['FAIstate'][0];
+      }
+
       /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
        */
       $ldap     = $this->config->get_ldap_link();
@@ -85,6 +103,7 @@ class faiVariable extends plugin
     /* Add new sub object */
     if(isset($_POST['AddSubObject'])){
       $this->dialog= new $this->subClassName($this->config,"new");
+      $this->dialog->acl = $this->acl;
       $this->is_dialog=true;
     }
 
@@ -99,6 +118,7 @@ class faiVariable extends plugin
       $var = $_POST['SubObject'][0];
     
       $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$var]);
+      $this->dialog->acl = $this->acl;
       $_SESSION['objectinfo'] = $this->SubObjects[$var]['dn'];
       $this->is_dialog=true;
     }
@@ -182,6 +202,11 @@ class faiVariable extends plugin
       }
     }
 
+      foreach($this->attributes as $attr){
+      $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+    }
+
+
     $display.= $smarty->fetch(get_template_path('faiVariable.tpl', TRUE));
     return($display);
   }
@@ -226,7 +251,7 @@ class faiVariable extends plugin
    */
   function save_object()
   {
-    if(isset($_POST['FAIvariable_posted'])){
+    if((isset($_POST['FAIvariable_posted'])) && ($this->FAIstate != "freeze") ){
       plugin::save_object();
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
index f367315026db30f7af6f4bf136aacb228cd9a0ed..12c66fe134ee651930a721d4217b784157387784 100644 (file)
@@ -18,6 +18,8 @@ class faiVariableEntry extends plugin
   var $FAIvariableContent   = "";
   var $description   = "";
   var $status        = "new";
+
+  var $FAIstate      = "";
   
   function faiVariableEntry ($config, $dn= NULL,$object=false)
   {
@@ -29,6 +31,11 @@ class faiVariableEntry extends plugin
         $oname = $name;
         $this->$oname=addslashes($value);
       }
+
+      if(isset($this->attrs['FAIstate'][0])){
+        $this->FAIstate = $this->attrs['FAIstate'][0];
+      }
+
     }else{
       $this->status = "new";
       $this->orig_cn       = false;
@@ -55,6 +62,14 @@ 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","  ");
+      }
+    }
+
     $display.= $smarty->fetch(get_template_path('faiVariableEntry.tpl', TRUE));
     return($display);
   }
@@ -62,7 +77,7 @@ class faiVariableEntry extends plugin
   /* Save data to object */
   function save_object()
   {
-    if(isset($_POST['SubObjectFormSubmitted'])){
+    if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
       foreach($this->attributes as $attrs){
         if(isset($_POST[$attrs])){
           $this->$attrs = $_POST[$attrs];
index 68f2c913277a5322c94f75f2f8154e55299d0500..3bd5c80b1ba127e5b6ea22284a7823997a5d540c 100644 (file)
@@ -10,7 +10,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input value="{$cn}" size="45" maxlength="80" disabled id="cn">
+                                                       <input value="{$cn}" size="45" maxlength="80" disabled id="cn" {$cnACL}>
                                                </td>
                                        </tr>
                                        <tr>
@@ -20,7 +20,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input value="{$description}" size="45" maxlength="80" {$description} name="description" id="description">
+                                                       <input value="{$description}" size="45" maxlength="80" {$descriptionACL} name="description" id="description">
                                                </td>
                                        </tr>
                                </table>
@@ -45,7 +45,7 @@
                                                <input type="submit" name="EditSubObject"    value="{t}Edit{/t}"    title="{t}Edit{/t}">
                                                <input type="submit" name="DelSubObject"     value="{t}Delete{/t}"  title="{t}Delete{/t}">
                                                -->
-                                               <input type="submit" name="AddSubObject"     value="{t}Add{/t}"         title="{t}Add{/t}">
+                                               <input type="submit" name="AddSubObject"     value="{t}Add{/t}"         title="{t}Add{/t}" {$cnACL}>
                                        </td>
                                </tr>
                                </table>
index 699528a40c147219d780276fddfe124eabaa7d99..ad25455ce0f51fa7594c614c8323b29df3c78ce4 100644 (file)
@@ -9,7 +9,7 @@
                                                        {t}Name{/t}{$must}&nbsp;
                                                </td>
                                                <td>
-                                                       <input value="{$cn}" size="45" name="cn">
+                                                       <input value="{$cn}" size="45" name="cn" {$cnACL}>
                                                </td>
                                        </tr>
                                        <tr>
@@ -17,7 +17,7 @@
                                                        {t}Description{/t}&nbsp;
                                                </td>
                                                <td>
-                                                       <input value="{$description}" size="45" name="description">
+                                                       <input value="{$description}" size="45" name="description" {$descriptionACL}>
                                                </td>
                                        </tr>
                                </table>
@@ -33,7 +33,7 @@
                                                        <LABEL for="FAItask">
                                                        {t}Task{/t}&nbsp;
                                                        </LABEL>
-                                                       <select name="FAItask" title="{t}Choose an existing FAI task{/t}">
+                                                       <select name="FAItask" title="{t}Choose an existing FAI task{/t}" {$FAItaskACL}>
                                                                {html_options values=$tasks output=$tasks selected=$FAItask}
                                                        </select>
                                                </td>
 <table width="99%" summary="">
     <tr>
         <td>
-            <textarea name="FAIscript" style="width:100%;height:300px;" id="FAIscript">{$FAIscript}</textarea>
+            <textarea name="FAIscript" style="width:100%;height:300px;" id="FAIscript" >{$FAIscript}</textarea>
         </td>
     </tr>
 </table>
 <br>
 <div>
-    <input type="file" name="ImportFile">&nbsp;
-    <input type="submit" name="ImportUpload" value="{t}Import script{/t}">
+    <input type="file" name="ImportFile" {$FAIscriptACL}>&nbsp;
+    <input type="submit" name="ImportUpload" value="{t}Import script{/t}" {$FAIscriptACL}>
        {$DownMe}
 </div>
 
 <p class="seperator">&nbsp;</p>
 <br>
 <div style="align:right;" align="right">
-       <input type="submit" value="{t}Apply{/t}"       name="SaveSubObject">&nbsp;
+       <input type="submit" value="{t}Apply{/t}"       name="SaveSubObject" {$cnACL}>&nbsp;
        <input type="submit" value="{t}Cancel{/t}"      name="CancelSubObject">
 </div>
 <!-- Place cursor -->
index c65598798e85f64a22ec3ac76ac3252b79184570..a4d4371bdadaf9aef4ea1478e16bcfef9c85e91f 100644 (file)
@@ -20,7 +20,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input value="{$description}" size="45" {$description} name="description" id="description">
+                                                       <input value="{$description}" size="45" {$descriptionACL} name="description" id="description">
                                                </td>
                                        </tr>
                                </table>
@@ -58,8 +58,8 @@
                                {html_options options=$usedPackages}
                </select>
                        <br>
-                       <input type="submit" name="Addpkg" value="{t}Add{/t}" {$OptionsACL}>
-                       <input type="submit" name="Delpkg" value="{t}Remove{/t}"  {$OptionsACL}>
+                       <input type="submit" name="Addpkg" value="{t}Add{/t}" {$OptionsACL} {$cnACL}>
+                       <input type="submit" name="Delpkg" value="{t}Remove{/t}"  {$OptionsACL} {$cnACL}>
                        <input type="submit" name="Conpkg" value="{t}Configure{/t}"  {$OptionsACL} >
                </td>
        </tr>
index feb0f443f1cb68890848c93bfe439190a10af03a..43db0eb5676fac4bfe8dace8b8a2ca8a73f941d7 100644 (file)
@@ -20,7 +20,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input value="{$description}" size="45" maxlength="80" name="description" id="description">
+                                                       <input value="{$description}" size="45" maxlength="80" name="description" id="description" {$descriptionACL}>
                                                </td>
                                        </tr>
                                </table>
@@ -40,9 +40,9 @@
                                                <select name="disks[]" title="{t}Choose a disk to delete or edit{/t}" style="width:100%" size="20" id="SubObject" multiple>
                                                        {html_options values=$diskKeys output=$disks}
                                                </select><br>
-                                               <input type="submit" name="AddDisk"     value="{t}Add{/t}"              title="{t}Add{/t}">
-                                               <input type="submit" name="EditDisk"    value="{t}Edit{/t}"    title="{t}Edit{/t}">
-                                               <input type="submit" name="DelDisk"     value="{t}Delete{/t}"  title="{t}Delete{/t}">
+                                               <input type="submit" name="AddDisk"     value="{t}Add{/t}"              title="{t}Add{/t}" {$cnACL}>
+                                               <input type="submit" name="EditDisk"    value="{t}Edit{/t}"    title="{t}Edit{/t}" >
+                                               <input type="submit" name="DelDisk"     value="{t}Delete{/t}"  title="{t}Delete{/t}"  {$cnACL}>
                                        </td>
                                </tr>
                                </table>
index df23a2ff664fbe3eb0a2788da8481e080e4bc828..9ceab9439d3dcbcabd3826fe226f68c2eedd3838 100644 (file)
@@ -5,12 +5,12 @@
                <td style='width:50%;border-right:1px solid #909090;'><LABEL for="DISK_cn">
                        {t}Name{/t}
                        </LABEL>{$must}&nbsp;
-                       <input value="{$DISK_cn}" size="45" maxlength="80" name="DISK_cn" id="DISK_cn">
+                       <input value="{$DISK_cn}" size="45" maxlength="80" name="DISK_cn" id="DISK_cn" {$cnACL}>
                </td>
                <td><LABEL for="DISK_description">
                        &nbsp;{t}Description{/t}
                        </LABEL>&nbsp;
-                       <input value="{$DISK_description}" size="45" maxlength="80" name="DISK_description" id="DISK_description">
+                       <input value="{$DISK_description}" size="45" maxlength="80" name="DISK_description" id="DISK_description" {$descriptionACL}>
                </td>
        </tr>
 </table>
 <h2><img class="center" alt="" src="images/editpaste.png" align="middle" title="{t}Partition entries{/t}">&nbsp;{t}Partition entries{/t}</h2>
 {$setup}
 <br>
-<input type="submit" name="AddPartition" value="{t}Add partition{/t}" >
+<input type="submit" name="AddPartition" value="{t}Add partition{/t}" {$cnACL}>
 <br>   
 <br>
 <p class="seperator">&nbsp;</p>
 <br>
 <div style="align:right;" align="right">
-<input type="submit" name="SaveDisk" value="{t}Save{/t}" >
+<input type="submit" name="SaveDisk" value="{t}Save{/t}" {$cnACL}>
 <input type="submit" name="CancelDisk" value="{t}Cancel{/t}" >
 </div>
 <!-- Place cursor -->
index 8ecedab7f75da5355f6caea1dd78e54619c99560..5020bc74557770a214669c7679e830ecc14fd53b 100644 (file)
@@ -10,7 +10,7 @@
                                                </LABEL>
                                        </td>
                                        <td>
-                                               <input value="{$cn}" size="45" maxlength="80" id="cn" name="cn">
+                                               <input value="{$cn}" size="45" maxlength="80" id="cn" name="cn" {$cnACL}>
                                        </td>
                                </tr>
                                <tr>
@@ -20,7 +20,7 @@
                                                </LABEL>
                                        </td>
                                        <td>
-                                               <input value="{$description}" size="45" maxlength="80" name="description" id="description">
+                                               <input value="{$description}" size="45" maxlength="80" name="description" id="description" {$descriptionACL}>
                                        </td>
                                </tr>
                        </table>
@@ -35,7 +35,7 @@
                                                </select>-->
                                                {$divlist}
                                                <br>
-                                               <input type="submit" name="AddClass" value="{t}Add{/t}">
+                                               <input type="submit" name="AddClass" value="{t}Add{/t}" {$cnACL}>
                                                <input type="hidden" name="edit_helper">
                                        </td>
                                </tr>
index 1a646b3d91e3de92a4a1598ad4057572a7806af3..4c235c3613643fbcbbe0c2abeca4f91532f6762b 100644 (file)
@@ -20,7 +20,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input size="45" maxlength="80" value="{$description}" {$description} name="description" id="description">
+                                                       <input size="45" maxlength="80" value="{$description}" {$description} name="description" id="description" {$descriptionACL}>
                                                </td>
                                        </tr>
                                </table>
                                                <input type="submit" name="EditSubObject"    value="{t}Edit{/t}"    title="{t}Edit{/t}">
                                                <input type="submit" name="DelSubObject"     value="{t}Delete{/t}"  title="{t}Delete{/t}">
                                                -->
-                                               <input type="submit" name="AddSubObject"     value="{t}Add{/t}"         title="{t}Add{/t}">
+                                               <input type="submit" name="AddSubObject"     value="{t}Add{/t}"         title="{t}Add{/t}" {$cnACL}>
                                        </td>
                                </tr>
                                </table>
                </td>
        </tr>
 </table>
-<input type="hidden" value="1" name="FAIscript_posted">
+<input type="hidden" value="1" name="FAIscript_posted" >
 <!-- Place cursor -->
 <script language="JavaScript" type="text/javascript">
   <!-- // First input field on page
index cc1eee23c77314c8e872ec9295e3792e4a40968f..9f60e8a17eba42fd1d5d275da1254d7489d949a9 100644 (file)
@@ -9,7 +9,7 @@
                                                        {t}Name{/t}{$must}&nbsp;
                                                </td>
                                                <td>
-                                                       <input value="{$cn}" size="45" maxlength="80" name="cn">
+                                                       <input value="{$cn}" size="45" maxlength="80" name="cn"  {$cnACL}>
                                                </td>
                                        </tr>
                                        <tr>
@@ -17,7 +17,7 @@
                                                        {t}Description{/t}&nbsp;
                                                </td>
                                                <td>
-                                                       <input size="45" maxlength="80" value="{$description}" name="description">
+                                                       <input size="45" maxlength="80" value="{$description}" name="description" {$descriptionACL}>
                                                </td>
                                        </tr>
                                </table>
@@ -35,7 +35,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                   <select name="FAIpriority" title="{t}Choose a priority{/t}">
+                                                   <select name="FAIpriority" title="{t}Choose a priority{/t}" {$FAIpriorityACL}>
                                                {html_options values=$FAIprioritys output=$FAIprioritys selected=$FAIpriority}
                                        </select>
                                                </td>
 <table summary="" width="99%">
     <tr>
         <td>
-            <textarea name="FAIscript" style="width:100%;height:300px;" id="FAIscript">{$FAIscript}</textarea>
+            <textarea name="FAIscript" style="width:100%;height:300px;" id="FAIscript"  >{$FAIscript}</textarea>
         </td>
     </tr>
 </table>
 <br>
 <div>
-       <input type="file" name="ImportFile">&nbsp;
-       <input type="submit" name="ImportUpload" value="{t}Import script{/t}">
+       <input type="file" name="ImportFile"  {$FAIscriptACL}>&nbsp;
+       <input type="submit" name="ImportUpload" value="{t}Import script{/t}" {$FAIscriptACL}>
        {$DownMe}
 </div>
 <br>
 <div style="align:right;" align="right">
-       <input type="submit" value="{t}Apply{/t}"       name="SaveSubObject">&nbsp;
+       <input type="submit" value="{t}Apply{/t}"       name="SaveSubObject" {$cnACL}>&nbsp;
        <input type="submit" value="{t}Cancel{/t}"      name="CancelSubObject">
 </div>
 <!-- Place cursor -->
index e97b520698d117af89436e9f10052adc1bde8b4a..9e380d77a68d385cc8713f79cd3a23736474fc73 100644 (file)
@@ -20,7 +20,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input value="{$description}" size="45" maxlength="80" {$description} name="description" id="description">
+                                                       <input value="{$description}" size="45" maxlength="80" {$description} name="description" id="description" {$descriptionACL}>
                                                </td>
                                        </tr>
                                </table>
                                <table summary="" width="100%">
                                <tr>
                                        <td>
-                                               <select name="SubObject[]" multiple title="{t}Choose a template to delete or edit{/t}" style="width:100%;" size="20" id="SubObject">
+                                               <select name="SubObject[]" multiple} 
+                                                       title="{t}Choose a template to delete or edit{/t}" style="width:100%;" size="20" id="SubObject">
                                                        {html_options values=$SubObjectKeys output=$SubObjects}
                                                </select><br>
-                                               <input type="submit" name="AddSubObject"     value="{t}Add{/t}"         title="{t}Add{/t}">
+                                               <input type="submit" name="AddSubObject"     value="{t}Add{/t}"         title="{t}Add{/t}" {$cnACL}>
                                                <input type="submit" name="EditSubObject"    value="{t}Edit{/t}"    title="{t}Edit{/t}">
-                                               <input type="submit" name="DelSubObject"     value="{t}Delete{/t}"  title="{t}Delete{/t}">
+                                               <input type="submit" name="DelSubObject"     value="{t}Delete{/t}"  title="{t}Delete{/t}" {$cnACL}>
                                        </td>
                                </tr>
                                </table>
index 2c2e1e139d418a57270c59566559c0ab5d933b5a..1aa04a261967ff83e618c9df86bf1d3cbd4cd848 100644 (file)
@@ -5,11 +5,11 @@
 <tr>
        <td width="50%">
                {t}Name{/t}{$must}&nbsp;
-               <input value="{$cn}" name="cn" size="45" maxlength="80">&nbsp;&nbsp;
+               <input value="{$cn}" name="cn" size="45" maxlength="80" {$cnACL}>&nbsp;&nbsp;
        </td>
        <td>
                {t}Description{/t}&nbsp;
-               <input size="45" maxlength="80" value="{$description}" name="description">
+               <input size="45" maxlength="80" value="{$description}" name="description" {$descriptionACL}>
        </td>
 </tr>
 </table>
@@ -36,8 +36,8 @@
                        {/if}
                        <br>
                        <br>
-                       <input type="file" name="FAItemplateFile" value="{$FAItemplateFile}" id="FAItemplateFile">
-                       &nbsp;<input type="submit" value="{t}Upload{/t}" name="TmpFileUpload">
+                       <input type="file" name="FAItemplateFile" value="{$FAItemplateFile}" id="FAItemplateFile" {$FAItemplateFileACL}>
+                       &nbsp;<input type="submit" value="{t}Upload{/t}" name="TmpFileUpload" {$FAItemplateFileACL}>
                        <br>
                        <br>
                        </td>
@@ -48,7 +48,7 @@
                                </LABEL>
                                </td>
                        <td>
-                               <input type="text" name="FAItemplatePath" value="{$FAItemplatePath}" id="FAItemplatePath" size="45">
+                               <input type="text" name="FAItemplatePath" value="{$FAItemplatePath}" id="FAItemplatePath" size="45" {$FAItemplatePathACL}>
                                </td>
                </tr>
                </table>
@@ -63,7 +63,7 @@
                        </LABEL>
                        </td>
                <td>
-                       <input type="text" name="user" value="{$user}" id="user" size="15">
+                       <input type="text" name="user" value="{$user}" id="user" size="15" {$userACL}>
                        </td>
        </tr><tr>
                <td style="vertical-align:top">
@@ -72,7 +72,7 @@
                        </LABEL>
                        </td>
                <td>
-                       <input type="text" name="group" value="{$group}" id="group" size="15">
+                       <input type="text" name="group" value="{$group}" id="group" size="15" {$groupACL}>
                        <br>
                        <br>
                        </td>
                        <th>&nbsp;</th>
                </tr>
                <tr><td>{t}User{/t}</td>
-                       <td align="center"><input type="checkbox" name="u4" value="4" {$u4}></td>
-                       <td align="center"><input type="checkbox" name="u2" value="2" {$u2}></td>
-                       <td align="center"><input type="checkbox" name="u1" value="1" {$u1}></td>
+                       <td align="center"><input type="checkbox" name="u4" value="4" {$u4} {$userACL}></td>
+                       <td align="center"><input type="checkbox" name="u2" value="2" {$u2} {$userACL}></td>
+                       <td align="center"><input type="checkbox" name="u1" value="1" {$u1} {$userACL}></td>
                        <td>&nbsp;</td>
-                       <td align="center"><input type="checkbox" name="s4" value="4" {$s4}></td>
+                       <td align="center"><input type="checkbox" name="s4" value="4" {$s4} {$userACL}></td>
                        <td>({t}SUID{/t})</td>
                        </tr>
 
                <tr><td>{t}Group{/t}</td>
-                       <td align="center"><input type="checkbox" name="g4" value="4" {$g4}></td>
-                       <td align="center"><input type="checkbox" name="g2" value="2" {$g2}></td>
-                       <td align="center"><input type="checkbox" name="g1" value="1" {$g1}></td>
+                       <td align="center"><input type="checkbox" name="g4" value="4" {$g4} {$userACL}></td>
+                       <td align="center"><input type="checkbox" name="g2" value="2" {$g2} {$userACL}></td>
+                       <td align="center"><input type="checkbox" name="g1" value="1" {$g1} {$userACL}></td>
                        <td>&nbsp;</td>
-                       <td align="center"><input type="checkbox" name="s2" value="2" {$s2}></td>
+                       <td align="center"><input type="checkbox" name="s2" value="2" {$s2} {$userACL}></td>
                        <td>({t}SGID{/t})</td>
                        </tr>
 
                <tr><td>{t}Others{/t}</td>
-                       <td align="center"><input type="checkbox" name="o4" value="4" {$o4}></td>
-                       <td align="center"><input type="checkbox" name="o2" value="2" {$o2}></td>
-                       <td align="center"><input type="checkbox" name="o1" value="1" {$o1}></td>
+                       <td align="center"><input type="checkbox" name="o4" value="4" {$o4} {$userACL}></td>
+                       <td align="center"><input type="checkbox" name="o2" value="2" {$o2} {$userACL}></td>
+                       <td align="center"><input type="checkbox" name="o1" value="1" {$o1} {$userACL}></td>
                        <td>&nbsp;</td>
-                       <td align="center"><input type="checkbox" name="s1" value="1" {$s1}></td>
+                       <td align="center"><input type="checkbox" name="s1" value="1" {$s1} {$userACL}></td>
                        <td>({t}sticky{/t})</td>
        </tr></table>
        
index d7ef90216c24d01044a2b06a9d1794ac17d9c29a..6d07486a4d2a73c4e1c49647e3aac134282b3e71 100644 (file)
@@ -20,7 +20,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input size="45" maxlength="80" value="{$description}" name="description" id="description">
+                                                       <input size="45" maxlength="80" value="{$description}" name="description" id="description" {$descriptionACL}>
                                                </td>
                                        </tr>
                                </table>
                                <table summary="" width="100%">
                                <tr>
                                        <td>
-                                               <select name="SubObject[]" multiple  title="{t}Choose a variable to delete or edit{/t}" style="width:100%;" size="20" id="SubObject">
+                                               <select name="SubObject[]" multiple  title="{t}Choose a variable to delete or edit{/t}" 
+                                                       style="width:100%;" size="20" id="SubObject">
                                                        {html_options values=$SubObjectKeys output=$SubObjects}
                                                </select><br>
-                                               <input type="submit" name="AddSubObject"     value="{t}Add{/t}"         title="{t}Add{/t}">
-                                               <input type="submit" name="EditSubObject"    value="{t}Edit{/t}"    title="{t}Edit{/t}">
-                                               <input type="submit" name="DelSubObject"     value="{t}Delete{/t}"  title="{t}Delete{/t}">
+                                               <input type="submit" name="AddSubObject"     value="{t}Add{/t}"         title="{t}Add{/t}" {$cnACL}>
+                                               <input type="submit" name="EditSubObject"    value="{t}Edit{/t}"    title="{t}Edit{/t}" >
+                                               <input type="submit" name="DelSubObject"     value="{t}Delete{/t}"  title="{t}Delete{/t}" {$cnACL}>
                                        </td>
                                </tr>
                                </table>
index 9c7d7e60aaaf4106bbada7f33678f914e725d3cd..c4d6fc63817fba1265e509bdeffba744b8c76895 100644 (file)
@@ -9,7 +9,7 @@
                                                        {t}Name{/t}{$must}&nbsp;
                                                </td>
                                                <td>
-                                                       <input value="{$cn}" size="45" maxlength="80" name="cn">
+                                                       <input value="{$cn}" size="45" maxlength="80" name="cn" {$cnACL}>
                                                </td>
                                        </tr>
                                        <tr>
@@ -17,7 +17,7 @@
                                                        {t}Description{/t}&nbsp;
                                                </td>
                                                <td>
-                                                       <input value="{$description}" size="45" maxlength="80" name="description">
+                                                       <input value="{$description}" size="45" maxlength="80" name="description" {$descriptionACL}>
                                                </td>
                                        </tr>
                                </table>
@@ -35,7 +35,7 @@
                                                        </LABEL>
                                                </td>
                                                <td>
-                                                       <input type="text" name="FAIvariableContent" value="{$FAIvariableContent}" id="Content" style="width:250px;">
+                                                       <input type="text" name="FAIvariableContent" value="{$FAIvariableContent}" id="Content" style="width:250px;" {$FAIvariableContentACL}>
                                                </td>
                                        </tr>
                                </table>
@@ -45,7 +45,7 @@
 <p class="seperator">&nbsp;</p>
 <br>
 <div style="align:right;" align="right">
-       <input type="submit" value="{t}Apply{/t}"       name="SaveSubObject">&nbsp;
+       <input type="submit" value="{t}Apply{/t}"       name="SaveSubObject" {$cnACL}>&nbsp;
        <input type="submit" value="{t}Cancel{/t}"      name="CancelSubObject">
 </div>