From: hickert Date: Thu, 25 Aug 2005 14:01:10 +0000 (+0000) Subject: Some changes, 80% ready i think X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ddc46ef5c583b665d103ad3bd3b00ea7c99d621d;p=gosa.git Some changes, 80% ready i think git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1220 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index c3bfcd836..d0b694cff 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -238,10 +238,28 @@ class environment extends plugin * Perform add Delete edit Posts */ - $this->gotoLogonScripts = array("asdf"=>"one","aaaa"=>"two","121"=>"3"); - - $smarty->assign("gotoLogonScripts",$this->gotoLogonScripts); - $smarty->assign("gotoLogonScriptKeys",array_flip($this->gotoLogonScripts)); + /* Dialog Save */ + if(isset($_POST['LogonSave'])){ + $this->dialog->save_object(); + if(count($this->dialog->check())!=0){ + foreach($this->dialog->check() as $msg){ + print_red($msg); + } + }else{ + $tmp = $this->dialog->save(); + unset($this->dialog); + $this->dialog=NULL; + $this->is_dialog=false; + $this->gotoLogonScripts[$tmp['LogonName']]=$tmp; + } + } + + /* Dialog Quit without saving */ + if(isset($_POST['LogonCancel'])){ + $this->is_dialog= false; + unset($this->dialog); + $this->dialog= NULL; + } /* Check Edit Del New Posts for a selected LogonScript */ if(isset($_POST['gotoLogonScriptNew'])||isset($_POST['gotoLogonScriptEdit'])||isset($_POST['gotoLogonScriptDel'])){ @@ -271,7 +289,11 @@ class environment extends plugin $this->dialog = new logonManagementDialog($this->config,$this->dn,$is_entry); } } - + + /* Append List to smarty*/ + $smarty->assign("gotoLogonScripts", $this->printOutLogonScripts()); + $smarty->assign("gotoLogonScriptKeys",array_flip($this->printOutLogonScripts())); + /* In this section server shares will be defined * A user can select one of the given shares and a mount point * and attach this combination to his setup. @@ -473,7 +495,7 @@ class environment extends plugin if(isset($_POST['iamposted'])){ plugin::save_object(); foreach($this->attributes as $s_attr){ - if(in_array($s_attr,array("gotoShares","gotoHotplugDevices","gotoPrinters"))) continue; + if(in_array($s_attr,array("gotoShares","gotoHotplugDevices","gotoPrinters","gotoLogonScripts"))) continue; if(isset($_POST[$s_attr])){ $this->$s_attr = $_POST[$s_attr]; }else{ @@ -688,28 +710,37 @@ function printOutHotPlugDevices() return($a_return); } -/* Generates ListBox frienly output of used printer devices - * Append ' - admin' if printer is used in admin mode - */ -function printOutPrinterDevices() + /* Generates ListBox frienly output of used printer devices + * Append ' - admin' if printer is used in admin mode + */ + function printOutPrinterDevices() { - $a_return = array(); - if(is_array($this->gotoPrinters)){ - foreach($this->gotoPrinters as $printer){ + $a_return = array(); + if(is_array($this->gotoPrinters)){ + foreach($this->gotoPrinters as $printer){ if($printer['mode'] == "admin"){ - $a_return[$printer['cn'][0]]= $printer['cn'][0]." - "._("Admin"); + $a_return[$printer['cn'][0]]= $printer['cn'][0]." - "._("Admin"); }else{ - $a_return[$printer['cn'][0]]= $printer['cn'][0]; + $a_return[$printer['cn'][0]]= $printer['cn'][0]; } } } - return($a_return); + return($a_return); } - - - - + /* Generates ListBox frienly output of used logonscripts + */ + function printOutLogonScripts() + { + print_a($this->gotoLogonScripts); + $a_return = array(); + if(is_array($this->gotoLogonScripts)){ + foreach($this->gotoLogonScripts as $script){ + $a_return[$script['LogonName']]= $script['LogonName']; + } + } + return($a_return); + } } diff --git a/plugins/personal/environment/class_logonManagementDialog.inc b/plugins/personal/environment/class_logonManagementDialog.inc index 819cee44a..55b16c7df 100644 --- a/plugins/personal/environment/class_logonManagementDialog.inc +++ b/plugins/personal/environment/class_logonManagementDialog.inc @@ -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: ?> diff --git a/plugins/personal/environment/logonManagement.tpl b/plugins/personal/environment/logonManagement.tpl index 2f204b947..d5abcbd68 100644 --- a/plugins/personal/environment/logonManagement.tpl +++ b/plugins/personal/environment/logonManagement.tpl @@ -1 +1,62 @@ -TESTESSTEST +

 {t}Logon management{/t}

+ + + + + + + + + + + +
+ + + + + + + + + +
{t}Name{/t} + + +
{t}Priority{/t} + + +
+
+ + + + + + + + + +
+ + {t}Last proceeded script{/t} +
+ + {t}Overloadable{/t} +
+
+ + + + +
+ +
+
+ +

+ + +