From: cajus Date: Mon, 25 Feb 2008 17:32:28 +0000 (+0000) Subject: Added multi actions X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3212a5d4e27b47cce45fbcf718657ced811f858d;p=gosa.git Added multi actions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9114 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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 ********************/