Code

Added multi actions
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Feb 2008 17:32:28 +0000 (17:32 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Feb 2008 17:32:28 +0000 (17:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9114 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_systemManagement.inc

index 9e1fd2cb5457c989fcf03b18532fdf52fc8acca6..e626517c405bcdc5b76e4e8bcfefcabf5e5644da 100644 (file)
@@ -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
      ********************/