From: hickert Date: Thu, 28 Jan 2010 17:33:15 +0000 (+0000) Subject: Updated gotomasses X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=acdfe2c59c411cd223691dc751fd111379455191;p=gosa.git Updated gotomasses -Not yet finished git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15436 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/addons/goto/class_filterGotoEvents.inc b/gosa-plugins/goto/addons/goto/class_filterGotoEvents.inc new file mode 100644 index 000000000..fdb665c14 --- /dev/null +++ b/gosa-plugins/goto/addons/goto/class_filterGotoEvents.inc @@ -0,0 +1,42 @@ +get_queued_entries($event_tags,0,9999999,"id"); + if ($o_queue->is_error()){ + msg_dialog::display(_("Error"), sprintf(_("Cannot load queue entries: %s"), "

".$o_queue->get_error()), ERROR_DIALOG); + } + + /* Assign entries by id. + */ + $data= array(); + foreach($entries as $entry){ + + $item = array(); + + $item['count'] = 0; + $item['dn']= implode($entry,", item="); + + foreach($entry as $name => $value){ + $item[] = $name; + $item[$name]=array('count' => 1, $value); + $item['count'] ++; + } + + +# /* Skip entries which will be removed within the next seconds */ +# if(isset($entry['MACADDRESS']) && in_array($entry['MACADDRESS'],$this->recently_removed)){ +# continue; +# } + $data[] = $item; + } + return($data); + } +} +?> diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc index ae0d9470f..b62f0734c 100644 --- a/gosa-plugins/goto/addons/goto/class_gotomasses.inc +++ b/gosa-plugins/goto/addons/goto/class_gotomasses.inc @@ -20,35 +20,22 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -class gotomasses extends plugin +class gotomasses extends management { - /* Definitions */ - var $plHeadline = "Deployment status"; - var $plDescription = "System deployment status"; - var $plIcon = "plugins/goto/images/goto.png"; - /* attribute list for save action */ - var $attributes= array(); - var $objectclasses= array(); + var $plHeadline = "System deployment status"; + var $plDescription = "System deployment status"; + var $plIcon = "plugins/goto/images/goto.png"; - /* Queue tasks */ var $current = FALSE; var $dialog = FALSE; var $ids_to_remove = array(); - var $divlist = NULL; var $events = array(); var $event_tags = array(); - - var $sort_by = "Schedule"; - var $sort_dir = "up"; - var $entries = array(); - var $range = 25; - var $start = 0; - var $recently_removed = array(); - function gotomasses(&$config, $dn= NULL) + function __construct(&$config, $ui) { /* Include config object */ $this->config= &$config; @@ -61,30 +48,119 @@ class gotomasses extends plugin $this->event_tags[] = $evt['s_Queued_Action']; } - /* Load filter settings */ - if(!session::is_set("gotomasses_filter")){ - $gotomasses_filter = - array( - "range" => $this->range, - "sort_by" => $this->sort_by, - "sort_dir" => $this->sort_dir); - session::set("gotomasses_filter",$gotomasses_filter); + // Build filter + # if (session::global_is_set(get_class($this)."_filter")){ + # $filter= session::global_get(get_class($this)."_filter"); + # } else { + $filter = new filter(get_template_path("deploy-filter.xml", true)); + $filter->setObjectStorage($this->storagePoints); +# } + $this->setFilter($filter); + + // Build headpage + $headpage = new listing(get_template_path("deploy-list.xml", true)); + $headpage->registerElementFilter("hostName", "gotomasses::filterHostName"); + $headpage->registerElementFilter("filterTask","gotomasses::filterTask"); + $headpage->registerElementFilter("filterPeriod","gotomasses::filterPeriod"); + $headpage->registerElementFilter("filterSchedule","gotomasses::filterSchedule"); + $headpage->setFilter($filter); + + parent::__construct($config, $ui, "Events", $headpage); + } + + static function filterHostName($mac, $name ="") + { + if(isset($name[0]) && $name[0] != "none"){ + return($name[0]); } - $gotomasses_filter = session::get("gotomasses_filter"); - foreach(array("range","sort_by","sort_dir") as $attr) { - $this->$attr = $gotomasses_filter[$attr]; + return($mac[0]); + } + + static function filterTask($tag) + { + $tag = $tag[0]; + $str = $tag; + + /* Check if this event exists as Daemon class + * In this case, display a more accurate entry. + */ + $events = DaemonEvent::get_event_types( SYSTEM_EVENT); + if(isset($events['QUEUED'][$tag])){ + $evt_name = $events['QUEUED'][$tag]; + $event_type = $events['BY_CLASS'][$evt_name]; + $str = $event_type['s_Menu_Name']; + + if(strlen($str) > 20){ + $str = substr($str,0,18)."..."; + } + + if(isset($event_type['ListImage']) && !empty($event_type['ListImage'])){ + $str = $event_type['ListImage']." ".$str; + } } + return($str); } + static function filterPeriod($periodic=array()) + { + $period = ""; + if(isset($periodic[0]) && !preg_match("/none/i",$periodic[0])){ + $tmp = explode("_", $periodic[0]); + if(count($tmp) == 2){ + $period= $tmp[0]." "._($tmp[1]); + } + } + return($period); + } + + static function filterSchedule($stamp) + { + if ($stamp['0'] == "19700101000000"){ + return(_("immediately")); + } else { + return(date("d.m.Y H:i:s",strtotime($stamp[0]))); + } + } + + + + + + + + - function execute() + + + + + + + + + + + + + + + + + + + + + + + + function _execute() { $smarty = get_smarty(); - + /************ * Handle posts ************/ - + $s_entry = $s_action = ""; $arr = array( @@ -115,7 +191,7 @@ class gotomasses extends plugin if(isset($_POST['menu_action']) && !empty($_POST['menu_action'])){ $s_action = $_POST['menu_action']; } - + /* Edit posted from list link */ if(isset($_GET['act']) && $_GET['act'] == "edit" && isset($_GET['id']) && isset($this->tasks[$_GET['id']])){ $s_action = "edit"; @@ -126,11 +202,11 @@ class gotomasses extends plugin /************ * Import CSV file ************/ - + if($s_action == "import_file" && $this->acl_is_writeable("")){ $this->dialog = new goto_import_file($this->config,$this); } - + if(isset($_POST['import_abort'])){ $this->dialog = FALSE; } @@ -178,7 +254,7 @@ class gotomasses extends plugin /************ * ADD ************/ - + if(preg_match("/^add_event_/",$s_action) && $this->acl_is_writeable("")){ $type = preg_replace("/^add_event_/","",$s_action); if(isset($this->events['BY_CLASS'][$type])){ @@ -204,7 +280,7 @@ class gotomasses extends plugin } } - + /************ * LOG VIEW ************/ @@ -352,69 +428,69 @@ class gotomasses extends plugin } } - /************ - * Handle Divlist - ************/ - - $divlist = new MultiSelectWindow($this->config,"gotoMasses",array("gotomasses")); - $divlist->SetInformation(_("This menu allows you to remove and change the properties of GOsa tasks.")); - $divlist->SetSummary(_("List of queued jobs")); - $divlist->EnableCloseButton(FALSE); - $divlist->EnableSaveButton(FALSE); - $divlist->SetHeadpageMode(); - $s = ".|"._("Actions")."|\n"; - $s.= "..| "._("Create")."\n"; - - if($this->acl_is_writeable("")){ - foreach($this->events['SCHEDULED'] as $name => $event){ - $s.= "...|".$event['MenuImage']." ".$event['s_Menu_Name']."|add_event_".$name."\n"; - } - } - if($this->acl_is_removeable()){ - $s.= "..|---|\n"; - $s.= "..| "._("Import")."|import_file\n"; - $s.= "..| "._("Remove")."|remove_multiple\n"; - } - if(preg_match("/w/",$this->getacl(""))){ - $s.= "..|---|\n"; - $s.= "..|"._("Resume")." "._("Resume")."|resume_all\n"; - $s.= "..|"._("Pause")." "._("Pause")."|pause_all\n"; - $s.= "..|"._("Abort")." "._("Abort")."|abort_process_all\n"; - $s.= "..|"._("Execute")." "._("Execute")."|execute_process_all\n"; - } - - $divlist->SetDropDownHeaderMenu($s); - - if($this->sort_dir == "up"){ - $sort_img = "/\"; - }else{ - $sort_img = "\/"; - } - - if($this->sort_by == "TargetName"){ $sort_img_1 = $sort_img; } else { $sort_img_1 = "" ;} - if($this->sort_by == "TaskID"){ $sort_img_2 = $sort_img; } else { $sort_img_2 = "" ;} - if($this->sort_by == "Schedule"){ $sort_img_3 = $sort_img; } else { $sort_img_3 = "" ;} - if($this->sort_by == "Action"){ $sort_img_4 = $sort_img; } else { $sort_img_4 = "" ;} - - /* Create divlist */ - $divlist->SetListHeader(""); - - $plug = $_GET['plug']; - $chk = ""; - - /* set Page header */ - $divlist->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'")); - $divlist->AddHeader(array("string"=>""._("Target").$sort_img_1."")); - $divlist->AddHeader(array("string"=>""._("Task").$sort_img_2."", - "attach"=>"style='width:120px;'")); - $divlist->AddHeader(array("string"=>_("Period"), - "attach"=>"style='width:60px;'")); - $divlist->AddHeader(array("string"=>""._("Schedule").$sort_img_3."", - "attach"=>"style='width:140px;'")); - $divlist->AddHeader(array("string"=>""._("Status").$sort_img_4."", - "attach"=>"style='width:80px;'")); - $divlist->AddHeader(array("string"=>_("Action"), + /************ + * Handle Divlist + ************/ + + $divlist = new MultiSelectWindow($this->config,"gotoMasses",array("gotomasses")); + $divlist->SetInformation(_("This menu allows you to remove and change the properties of GOsa tasks.")); + $divlist->SetSummary(_("List of queued jobs")); + $divlist->EnableCloseButton(FALSE); + $divlist->EnableSaveButton(FALSE); + $divlist->SetHeadpageMode(); + $s = ".|"._("Actions")."|\n"; + $s.= "..| "._("Create")."\n"; + + if($this->acl_is_writeable("")){ + foreach($this->events['SCHEDULED'] as $name => $event){ + $s.= "...|".$event['MenuImage']." ".$event['s_Menu_Name']."|add_event_".$name."\n"; + } + } + if($this->acl_is_removeable()){ + $s.= "..|---|\n"; + $s.= "..| "._("Import")."|import_file\n"; + $s.= "..| "._("Remove")."|remove_multiple\n"; + } + if(preg_match("/w/",$this->getacl(""))){ + $s.= "..|---|\n"; + $s.= "..|"._("Resume")." "._("Resume")."|resume_all\n"; + $s.= "..|"._("Pause")." "._("Pause")."|pause_all\n"; + $s.= "..|"._("Abort")." "._("Abort")."|abort_process_all\n"; + $s.= "..|"._("Execute")." "._("Execute")."|execute_process_all\n"; + } + + $divlist->SetDropDownHeaderMenu($s); + + if($this->sort_dir == "up"){ + $sort_img = "/\"; + }else{ + $sort_img = "\/"; + } + + if($this->sort_by == "TargetName"){ $sort_img_1 = $sort_img; } else { $sort_img_1 = "" ;} + if($this->sort_by == "TaskID"){ $sort_img_2 = $sort_img; } else { $sort_img_2 = "" ;} + if($this->sort_by == "Schedule"){ $sort_img_3 = $sort_img; } else { $sort_img_3 = "" ;} + if($this->sort_by == "Action"){ $sort_img_4 = $sort_img; } else { $sort_img_4 = "" ;} + + /* Create divlist */ + $divlist->SetListHeader(""); + + $plug = $_GET['plug']; + $chk = ""; + + /* set Page header */ + $divlist->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'")); + $divlist->AddHeader(array("string"=>""._("Target").$sort_img_1."")); + $divlist->AddHeader(array("string"=>""._("Task").$sort_img_2."", + "attach"=>"style='width:120px;'")); + $divlist->AddHeader(array("string"=>_("Period"), + "attach"=>"style='width:60px;'")); + $divlist->AddHeader(array("string"=>""._("Schedule").$sort_img_3."", + "attach"=>"style='width:140px;'")); + $divlist->AddHeader(array("string"=>""._("Status").$sort_img_4."", + "attach"=>"style='width:80px;'")); + $divlist->AddHeader(array("string"=>_("Action"), "attach"=>"style='border-right:0px;width:140px;'")); @@ -435,7 +511,7 @@ class gotomasses extends plugin $prio_actions.= " "; } - + /* If WAITING add pause action */ if(in_array($task['STATUS'],array("waiting")) && $this->acl_is_writeable("")){ @@ -501,7 +577,7 @@ class gotomasses extends plugin $display2= $task['HEADERTAG']; - + /* Check if this event exists as Daemon class * In this case, display a more accurate entry. */ @@ -520,7 +596,7 @@ class gotomasses extends plugin } $status = $task['STATUS']; - + if($status == "waiting"){ $status = " "._("Waiting"); } @@ -532,7 +608,7 @@ class gotomasses extends plugin } /* Special handling for all entries that have - STATUS == "processing" && PROGRESS == NUMERIC + STATUS == "processing" && PROGRESS == NUMERIC */ if($status == "processing" && isset($task['PROGRESS'])){ $percent = $task['PROGRESS']; @@ -541,15 +617,15 @@ class gotomasses extends plugin if ($percent == "goto-activation"){ $status = " "._("Locked"); - /* Show hardware detect? */ + /* Show hardware detect? */ } elseif ($percent == "goto-hardware-detection") { $status = " "._("Detection"); - /* Real percent */ + /* Real percent */ } else { - if (preg_match('/install/', $task['HEADERTAG'])){ + if (preg_match('/install/', $task['HEADERTAG'])){ $status = ""; + id='progress_".preg_replace("/:/","_",$task['MACADDRESS'])."'>"; } else { $status = preg_replace('/ /', ' ', _("in progress")); } @@ -567,49 +643,51 @@ class gotomasses extends plugin /* Create each field */ $field0 = array("string" => "" , - "attach" => "style='width:20px;".$color."'"); + "attach" => "style='width:20px;".$color."'"); $field1 = array("string" => $display, - "attach" => $tooltip."style='".$color."'"); + "attach" => $tooltip."style='".$color."'"); $field1a= array("string" => $display2, - "attach" => "style='".$color.";width:120px;'"); + "attach" => "style='".$color.";width:120px;'"); $field1b= array("string" => $period, - "attach" => "style='".$color.";width:60px;'"); + "attach" => "style='".$color.";width:60px;'"); if ($task['TIMESTAMP'] == "19700101000000"){ - $field2 = array("string" => _("immediately"),"attach" => "style='".$color.";width:140px;'"); + $field2 = array("string" => _("immediately"),"attach" => "style='".$color.";width:140px;'"); } else { - $field2 = array("string" => date("d.m.Y H:i:s",strtotime($task['TIMESTAMP'])),"attach" => "style='".$color.";width:140px;'"); + $field2 = array("string" => date("d.m.Y H:i:s",strtotime($task['TIMESTAMP'])),"attach" => "style='".$color.";width:140px;'"); } $field3 = array("string" => $status,"attach" => "style='".$color.";width:80px;'"); $field4 = array("string" => $prio_actions.$action,"attach" => "style='".$color.";text-align:right;width:140px;border-right:0px;'"); $divlist->AddElement(array($field0,$field1,$field1a,$field1b,$field2,$field3,$field4)); - } - - $smarty = get_smarty(); - $smarty->assign("events",$this->events); - $smarty->assign("start",$this->start); - $smarty->assign("start_real", ($this->start + 1)); - $smarty->assign("ranges", array("10" => "10", - "20" => "20", - "25" => "25", - "50" => "50", - "100"=> "100", - "200"=> "200", - "9999" => "*")); - - $count = $this->o_queue->number_of_queued_entries($this->event_tags); - if(!$count) $count = $this->range; + } + + $smarty = get_smarty(); + $smarty->assign("events",$this->events); + $smarty->assign("start",$this->start); + $smarty->assign("start_real", ($this->start + 1)); + $smarty->assign("ranges", array("10" => "10", + "20" => "20", + "25" => "25", + "50" => "50", + "100"=> "100", + "200"=> "200", + "9999" => "*")); + + $count = $this->o_queue->number_of_queued_entries($this->event_tags); + if(!$count) $count = $this->range; $divlist->SetListFooter(range_selector($count, $this->start, $this->range,"range")); - $smarty->assign("range",$this->range); + $smarty->assign("range",$this->range); $smarty->assign("div",$divlist->Draw()); + + return(management::execute()); return($smarty->fetch (get_template_path('gotomasses.tpl', TRUE, dirname(__FILE__)))); } /*! \brief Move an entry up or down in the queue, by updating its execution timestamp - @param $id Integer The ID of the entry which should be updated. - @param $type String "up" / "down" - @return boolean TRUE in case of success else FALSE - */ + @param $id Integer The ID of the entry which should be updated. + @param $type String "up" / "down" + @return boolean TRUE in case of success else FALSE + */ public function update_priority($id,$type = "up") { if($type == "up"){ @@ -652,7 +730,7 @@ class gotomasses extends plugin * 'waiting' */ $data = array("status" => "waiting"); - + /* Check if given ids are valid and check if the status * allows resuming. */ @@ -688,7 +766,7 @@ class gotomasses extends plugin * waiting and setting the timestamp to current time. */ $data = array( "timestamp" => date("YmdHis",time()), - "status" => "waiting"); + "status" => "waiting"); /* Only allow execution of paused or waiting entries */ @@ -745,7 +823,7 @@ class gotomasses extends plugin $tmp->add_targets($update_ids); $tmp->set_type(TRIGGERED_EVENT); $this->recently_removed = $update_ids; - + if(!$this->o_queue->append($tmp)){ msg_dialog::display(_("Error"), sprintf(_("Cannot update queue entry: %s"),$id) , ERROR_DIALOG); return(FALSE); @@ -822,7 +900,7 @@ class gotomasses extends plugin $sort.= " DESC"; } } - + /* Get entries. */ $start = $this->start; $stop = $this->range; @@ -834,9 +912,9 @@ class gotomasses extends plugin /* Assign entries by id. */ $this->entries = array(); - + foreach($entries as $entry){ - + /* Skip entries which will be removed within the next seconds */ if(isset($entry['MACADDRESS']) && in_array($entry['MACADDRESS'],$this->recently_removed)){ continue; @@ -846,10 +924,11 @@ class gotomasses extends plugin $this->recently_removed = array(); } + function save_object(){} /*! \brief Handle post jobs, like sorting. */ - function save_object() + function _save_object() { /* Check for sorting changes */ @@ -870,14 +949,14 @@ class gotomasses extends plugin if(isset($_POST['range']) && is_numeric($_POST['range'])){ $this->range = $_POST['range']; } - + /* Save filter settings */ $gotomasses_filter = session::get("gotomasses_filter"); foreach(array("range","sort_by","sort_dir") as $attr){ $gotomasses_filter[$attr] = $this->$attr; } session::set("gotomasses_filter",$gotomasses_filter); - + /* Page changed. */ if(isset($_GET['start'])){ $start = $_GET['start']; @@ -932,6 +1011,68 @@ class gotomasses extends plugin "plProvidedAcls" => array("Comment" => _("Description")) )); } + + + function set_acl_base($base) + { + $this->acl_base= $base; + } + + + function set_acl_category($category) + { + $this->acl_category= "$category/"; + } + + + function acl_is_writeable($attribute,$skip_write = FALSE) + { + if($this->read_only) return(FALSE); + $ui= get_userinfo(); + return preg_match('/w/', $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), $attribute, $skip_write)); + } + + + function acl_is_readable($attribute) + { + $ui= get_userinfo(); + return preg_match('/r/', $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), $attribute)); + } + + + function acl_is_createable($base ="") + { + if($this->read_only) return(FALSE); + $ui= get_userinfo(); + if($base == "") $base = $this->acl_base; + return preg_match('/c/', $ui->get_permissions($base, $this->acl_category.get_class($this), '0')); + } + + + function acl_is_removeable($base ="") + { + if($this->read_only) return(FALSE); + $ui= get_userinfo(); + if($base == "") $base = $this->acl_base; + return preg_match('/d/', $ui->get_permissions($base, $this->acl_category.get_class($this), '0')); + } + + function acl_is_moveable($base = "") + { + if($this->read_only) return(FALSE); + $ui= get_userinfo(); + if($base == "") $base = $this->acl_base; + return preg_match('/m/', $ui->get_permissions($base, $this->acl_category.get_class($this), '0')); + } + + + function getacl($attribute,$skip_write= FALSE) + { + $ui= get_userinfo(); + $skip_write |= $this->read_only; + return $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), $attribute,$skip_write); + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-plugins/goto/addons/goto/deploy-filter.tpl b/gosa-plugins/goto/addons/goto/deploy-filter.tpl new file mode 100644 index 000000000..227243dcf --- /dev/null +++ b/gosa-plugins/goto/addons/goto/deploy-filter.tpl @@ -0,0 +1,40 @@ +
+

+ [F]{t}Filter{/t} +

+
+ +
+ +
+ +{$TEMPLATES} 
+{$FUNCTIONAL} 
+{$POSIX} 
+{$MAIL} 
+{$SAMBA} 
+ +
+ {$SCOPE} + + + + + + +
+ + + {$NAME} +
+ + + + + +
+ {$APPLY} +
+
diff --git a/gosa-plugins/goto/addons/goto/deploy-filter.xml b/gosa-plugins/goto/addons/goto/deploy-filter.xml new file mode 100644 index 000000000..5217e5175 --- /dev/null +++ b/gosa-plugins/goto/addons/goto/deploy-filter.xml @@ -0,0 +1,82 @@ + + + + + users + + true + + + + + GotoEvents + (&(objectClass=gosaAccount)$TEMPLATES$NAME(|$FUNCTIONAL$SAMBA$POSIX$MAIL)) + dn + objectClass + givenName + sn + uid + userPassword + + auto + + + + textfield + NAME + 20 + 60 + + + (|(cn=*$*)(sn=*$*)(givenName=*$*)) + true + + GotoEvents + (&(objectClass=gosaAccount)(|(cn=*$NAME*)(sn=*$NAME*)(givenName=*$NAME*))) + cn + 0.5 + 3 + + + + + checkbox + TEMPLATES + + (!(objectClass=gosaUserTemplate)) + + + + + checkbox + FUNCTIONAL + true + + (!(|(objectClass=posixAccount)(objectClass=sambaSamAccount)(objectClass=gosaMailAccount)(objectClass=gofaxAccount)(objectClass=gofonAccount))) + + + + checkbox + POSIX + true + + (objectClass=posixAccount) + + + + checkbox + MAIL + true + + (objectClass=gosaMailAccount) + + + + checkbox + SAMBA + true + + (objectClass=sambaSamAccount) + + + diff --git a/gosa-plugins/goto/addons/goto/deploy-list.tpl b/gosa-plugins/goto/addons/goto/deploy-list.tpl new file mode 100644 index 000000000..f3bba3f7a --- /dev/null +++ b/gosa-plugins/goto/addons/goto/deploy-list.tpl @@ -0,0 +1,31 @@ + + + + + + + +
+
+

 {$HEADLINE} {$SIZELIMIT}

+
+ +
+
+ + +
{$ROOT} {$BACK} {$HOME} {$RELOAD} {$SEPARATOR} {t}Base{/t} {$BASE} {$SEPARATOR}  {$ACTIONS}
+
+
+ +
+
+ + + + {$LIST} +
+ {$FILTER} +
+ + diff --git a/gosa-plugins/goto/addons/goto/deploy-list.xml b/gosa-plugins/goto/addons/goto/deploy-list.xml new file mode 100644 index 000000000..84bbcb3be --- /dev/null +++ b/gosa-plugins/goto/addons/goto/deploy-list.xml @@ -0,0 +1,239 @@ + + + + + false + false + false + true + + + 1 + + + + FAKE_OC__gotoEvent + gotomasses + gotomasses + images/empty.png + + + + + + ||||||| + + + + MACADDRESS + string + %{filter:hostName(MACADDRESS,PLAINNAME)} + true + + + + + givenName + string + %{filter:filterTask(HEADERTAG)} + true + + + + + uid + string + %{filter:filterPeriod(PERIODIC)} + true + + + + + uid + string + %{filter:filterSchedule(TIMESTAMP)} + true + + + + + uid + string + %{filter:filterStatus(TIMESTAMP)} + true + + + + + %{filter:actions(dn,row,objectClass)} + + +
+ + + + + sub + images/lists/new.png + + + + new + entry + plugins/users/images/list_new_user.png + + + + + new_template + entry + plugins/users/images/select_template.png + + + + + + separator + + + + edit + entry + images/lists/edit.png + + + + + remove + entry + images/lists/trash.png + + + + + password + entry + plugins/users/images/list_password.png + + + + + separator + + + + lockUsers + entry + images/lists/locked.png + uniBonnAccount/password[w] + + + + + unlockUsers + entry + images/lists/unlocked.png + uniBonnAccount/password[w] + + + + + sendMessage + entry + DaemonEvent_notify + plugins/goto/images/notify.png + + + + + separator + + + + templatize + entry + plugins/users/images/wizard.png + + + + + separator + + + + exporter + + + + separator + + + + copypaste + + + + snapshot + + + + + + + + newfromtpl + entry + images/lists/new.png + gosaUserTemplate + + + + + cp + !gosaUserTemplate + copypaste + + + + edit + entry + gosaAccount + images/lists/edit.png + + + + + lock + entry + !gosaUserTemplate + %{filter:lockImage(userPassword)} + uniBonnAccount/password[w] + + + + + password + entry + !gosaUserTemplate + plugins/users/images/list_password.png + + + + + snapshot + snapshot + !gosaUserTemplate + + + + remove + entry + images/lists/trash.png + gosaAccount + users/user[d] + + + + + +
diff --git a/gosa-plugins/goto/addons/goto/main.inc b/gosa-plugins/goto/addons/goto/main.inc index af6b0ab7e..a63d2106e 100644 --- a/gosa-plugins/goto/addons/goto/main.inc +++ b/gosa-plugins/goto/addons/goto/main.inc @@ -20,12 +20,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - /* Remove locks created by this plugin */ if ($remove_lock){ if(session::is_set('gotomasses')){ - // Nothing to unlock here + $macl = session::get('gotomasses'); + $macl->remove_lock(); } } @@ -35,36 +35,22 @@ if ( $cleanup ){ session::un_set('gotomasses'); }else{ + /* Create gotomasses object on demand */ + if (!session::is_set('gotomasses')){ + $gotomasses= new gotomasses ($config, $ui); + session::set('gotomasses',$gotomasses); + } + $gotomasses = session::get('gotomasses'); + $display= $gotomasses->execute(); - /* Create gotomasses object on demand */ - if (!session::is_set('gotomasses') || isset($_POST['reload_gotomass_data'])){ - $gotomasses= new gotomasses ($config); - $gotomasses->set_acl_category("gotomasses"); - - /* Check root dn and user dn for acl informations */ - $gotomasses->set_acl_base($config->current['BASE']); - if($gotomasses->getacl("") == ""){ - $gotomasses->set_acl_base($ui->dn); - } - - /* Check if we have acl on our own base */ - if($gotomasses->getacl("") == ""){ - $gotomasses->set_acl_base(dn2base($ui->dn)); - } - session::set("gotomasses",$gotomasses); - } - $gotomasses = session::get('gotomasses'); - - /* Execute formular */ - $display= $gotomasses->save_object(); - if(isset($_POST['save_gotomass_changes'])){ - $gotomasses->save(); - } - $display= $gotomasses->execute (); - - /* Page header*/ - $display= print_header(get_template_path('plugins/goto/images/goto.png'), _("System deployment status")).$display; + /* Reset requested? */ + if (isset($_GET['reset']) && $_GET['reset'] == 1){ + session::un_set ('gotomasses'); + } - /* Store changes in session */ - session::set('gotomasses',$gotomasses); + /* Show and save dialog */ + session::set('gotomasses',$gotomasses); } + +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?>