1 <?php
2 class logonManagementDialog extends plugin
3 {
4 /* CLI vars */
5 var $cli_summary = "Manage server basic objects";
6 var $cli_description = "Some longer text\nfor help";
7 var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
9 /* attribute list for save action */
10 var $ignore_account = TRUE;
11 var $attributes = array("LogonName","LogonPriority","LogonLast","LogonOverload","LogonData");
12 var $objectclasses = array("whatever");
13 var $use_existing = false;
15 var $LogonName =""; // Name for the LogonScript
16 var $LogonPriority =""; // Priority defines the order in which the scripts will be processed
17 var $LogonLast =""; // Is this script marked as the last, all following scripts will be skipped
18 var $LogonOverload =""; // If Overload is activated this script is overlaodable by a group script with same prio
19 var $LogonData =""; // The script itself
20 var $nameIsEditable = true;
22 var $real_LogonName = "";
24 function logonManagementDialog ($config, $dn= NULL,$data=false)
25 {
26 plugin::plugin ($config, $dn);
28 if($data){
29 $this->LogonName = $data['LogonName'];
30 $this->LogonPriority = $data['LogonPriority'];
31 $this->LogonOverload = $data['LogonOverload'];
32 $this->LogonLast = $data['LogonLast'];
33 $this->LogonData = $data['LogonData'];
34 $this->nameIsEditable = false;
35 $this->real_LogonName = $data['LogonName'];
36 }
37 }
39 function execute()
40 {
41 $smarty= get_smarty();
42 $display= "";
44 foreach($this->attributes as $attr){
45 $smarty->assign($attr,$this->$attr);
46 if($this->$attr){
47 $smarty->assign($attr."CHK"," checked ");
48 }else{
49 $smarty->assign($attr."CHK","");
50 }
51 }
52 $prios=array(1,2,3,4,5,6,7,8,9,10);
53 $smarty->assign("LogonPrioritys",$prios);
54 $smarty->assign("LogonPriorityKeys",$prios);
56 if(!$this->nameIsEditable){
57 $smarty->assign("LogonNameACL"," disabled ");
58 }else{
59 $smarty->assign("LogonNameACL","");
60 }
62 $display.= $smarty->fetch(get_template_path('logonManagement.tpl', TRUE,dirname(__FILE__)));
63 return($display);
64 }
66 function save_object()
67 {
68 if(isset($_POST['dialogissubmitted'])){
69 foreach($this->attributes as $attr){
70 if(isset($_POST[$attr])){
71 $this->$attr= $_POST[$attr];
72 }else{
73 $this->$attr = false;
74 }
75 }
76 }
77 }
79 function save()
80 {
81 $a_return= array();
82 foreach($this->attributes as $attr){
83 $a_return[$attr]=$this->$attr;
84 }
86 if(!$this->nameIsEditable){
87 $a_return['LogonName']=$this->real_LogonName;
88 }
90 return($a_return);
91 }
93 }
94 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
95 ?>