From 3212a5d4e27b47cce45fbcf718657ced811f858d Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 25 Feb 2008 17:32:28 +0000 Subject: [PATCH] Added multi actions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9114 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_systemManagement.inc | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index 9e1fd2cb5..e626517c4 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -146,6 +146,12 @@ class systems extends plugin $s_action = "del_multiple"; } + /* Handle instant actions from layers menu */ + foreach (array("halt", "reboot", "reinstall", "update", "wake") as $act){ + if(isset($_POST['menu_action']) && preg_match("/^${act}_multiple/",$_POST['menu_action'])){ + $s_action = "${act}_multiple"; + } + } /* Check for exeeded sizelimit */ if (($message= check_sizelimit()) != ""){ @@ -476,6 +482,33 @@ class systems extends plugin } + /******************** + Action for MULTIPLE entries requested + ********************/ + if (preg_match("/(halt|reboot|reinstall|update|wake|)_multiple/", $s_action)){ + $this->dns = array(); + $ids = $this->list_get_selected_items(); + + if(count($ids)){ + $mac= array(); + $ldap = $this->config->get_ldap_link(); + + foreach($ids as $id){ + $ldap->cat ($this->terminals[$id]['dn'], array("macAddress")); + $attrs= $ldap->fetch(); + if (isset($attrs['macAddress'][0])){ + $mac[]= $attrs['macAddress'][0]; + } + } + + /* Action.... */ + $action= preg_replace('/_multiple.*$/', '', $s_action); + gosaSupportDaemon::send("gosa_trigger_action_".$action, $mac, array("macAddress" => $mac)); + + } + } + + /******************** Delete MULTIPLE entries requested, display confirm dialog ********************/ -- 2.30.2