Code

Some changes, 80% ready i think
[gosa.git] / plugins / personal / environment / class_logonManagementDialog.inc
index 819cee44aa57150d33d6868f5ffa64d581551b09..55b16c7df4ed6135bc32ec4a0db1c6bedec8783d 100644 (file)
@@ -8,12 +8,15 @@ class logonManagementDialog extends plugin
 
   /* attribute list for save action */
   var $ignore_account       = TRUE;
-  var $attributes           = array();
+  var $attributes           = array("LogonName","LogonPriority","LogonLast","LogonOverload","LogonData");
   var $objectclasses        = array("whatever");
   var $use_existing         = false;  
 
-  var $baseDir              = "../kioskProfiles/";
-  var $filePrefix           = ".kioskProfile";
+  var $LogonName      ="";  // Name for the LogonScript
+  var $LogonPriority  ="";  // Priority defines the order in which the scripts will be processed 
+  var $LogonLast      ="";  // Is this script marked as the last, all following scripts will be skipped
+  var $LogonOverload  ="";  // If Overload is activated this script is overlaodable by a group script with same prio
+  var $LogonData      ="";  // The script itself
 
   function logonManagementDialog ($config, $dn= NULL,$use_existing=false )
   {
@@ -25,10 +28,44 @@ class logonManagementDialog extends plugin
   {
     $smarty= get_smarty();
     $display= "";
+
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr,$this->$attr);
+      if($this->$attr){
+        $smarty->assign($attr."CHK"," checked ");
+      }else{
+        $smarty->assign($attr."CHK","");
+      }
+    }
+    $prios=array(1,2,3,4,5,6,7,8,9,10);
+    $smarty->assign("LogonPrioritys",$prios);
+    $smarty->assign("LogonPriorityKeys",$prios);
     $display.= $smarty->fetch(get_template_path('logonManagement.tpl', TRUE,dirname(__FILE__)));
     return($display);
   }
 
+  function save_object()
+  {
+    if(isset($_POST['dialogissubmitted'])){
+      foreach($this->attributes as $attr){
+        if(isset($_POST[$attr])){
+          $this->$attr= $_POST[$attr]; 
+        }else{
+          $this->$attr = false;
+        }
+      }
+    }
+  }
+
+  function save()
+  {
+    $a_return= array();
+    foreach($this->attributes as $attr){
+      $a_return[$attr]=$this->$attr;
+    }  
+    return($a_return); 
+  }
+
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>