From: hickert Date: Tue, 4 Mar 2008 13:12:06 +0000 (+0000) Subject: Updated user Management X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=85de904242cc9e5fb6cfa09e36110302c44ba655;p=gosa.git Updated user Management -Updated event handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9310 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/users/class_divListUsers.inc b/gosa-core/plugins/admin/users/class_divListUsers.inc index ac41162b4..65c69f64a 100644 --- a/gosa-core/plugins/admin/users/class_divListUsers.inc +++ b/gosa-core/plugins/admin/users/class_divListUsers.inc @@ -187,11 +187,15 @@ class divListUsers extends MultiSelectWindow $s.= "..|". " "._("Remove")."|"."remove_multiple|\n"; - if(class_available("DaemonEvent_notify")){ + /* Add event tag */ + if(class_available("DaemonEvent")){ $events = DaemonEvent::get_event_types(USER_EVENT); - $event = $events['BY_CLASS']['DaemonEvent_notify']; - $s.= "..|---|\n"; - $s.= "..|".$event['MenuImage']." ".$event['s_Menu_Name']."|trigger_event_DaemonEvent_notify\n"; + if(count($events['BY_CLASS'])){ + $s.= "..|---|\n"; + foreach($events['BY_CLASS'] as $name => $event){ + $s.= "..|".$event['MenuImage']." ".$event['s_Menu_Name']."|event_".$name."\n"; + } + } } /* Add multiple copy & cut icons */ diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 6b76035c6..9b695c8a7 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -153,26 +153,31 @@ class userManagement extends plugin $s_action = "del_multiple"; } - if(isset($_POST['menu_action']) && preg_match("/^trigger_event_DaemonEvent_notify/",$_POST['menu_action'])){ - $s_action = "notify"; + if(isset($_POST['menu_action']) && preg_match("/^event/",$_POST['menu_action'])){ + $s_action = $_POST['menu_action']; } + /******************** Create notification event ********************/ - if($s_action == "notify"){ - + if(preg_match("/^event_/",$s_action) && class_available("DaemonEvent")){ $ids = $this->list_get_selected_items(); $uids = array(); foreach($ids as $id){ $uids[] = $this->list[$id]['uid'][0]; } if(count($uids)){ - $this->usertab = new DaemonEvent_notify($this->config); - $this->usertab->add_targets($uids); + $events = DaemonEvent::get_event_types(USER_EVENT); + $event = preg_replace("/^event_/","",$s_action); + if(isset($events['BY_CLASS'][$event])){ + $type = $events['BY_CLASS'][$event]; + $this->usertab = new $type['CLASS_NAME']($this->config); + $this->usertab->add_targets($uids); + $this->usertab->set_type(TRIGGERED_EVENT); + } } - } /* Abort event dialog */