From 372ace22bfb1ef00e7b1dbab5dafe69e0627d008 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 5 Mar 2008 12:53:45 +0000 Subject: [PATCH] Updated event generation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9352 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/class_terminalGeneric.inc | 35 +++---------------- .../systems/goto/class_workstationGeneric.inc | 18 ++++------ 2 files changed, 12 insertions(+), 41 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc index a47f19b50..3b4f67d73 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc @@ -44,11 +44,7 @@ class termgeneric extends plugin "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser"); var $objectclasses= array("top", "gotoTerminal", "GOhard"); - var $mapActions = array("reboot" => "", - "rescan" => "", - "wake" => "", - "memcheck" => "memcheck", - "sysinfo" => "sysinfo"); + var $validActions = array("reboot" => "", "rescan" => "", "wake" => "", "memcheck" => "", "sysinfo" => ""); var $fai_activated = FALSE; var $view_logged = FALSE; @@ -163,17 +159,8 @@ class termgeneric extends plugin $this->is_account= !$this->is_account; } - if (isset($_POST['action']) && $this->acl_is_writeable("FAIstate") && isset($this->mapActions[$_POST['saction']])){ - - - - /* Check given action */ - $mapEvent = array("wake" => "wakeup", - "instant_update" => "update"); + if (isset($_POST['action']) && $this->acl_is_writeable("FAIstate") && isset($this->validActions[$_POST['saction']])){ $action = $_POST['saction']; - if(isset($mapEvent[$action])){ - $action = $mapEvent[$action]; - } /* Check if we have an DaemonEvent for this action */ if(class_available("DaemonEvent_".$action)){ @@ -190,22 +177,10 @@ class termgeneric extends plugin } } }else{ - - msg_dialog::display(_("Missing Daemon Event"), - sprintf(_("The requested action does not exists '%s' Sending event manually."),"DaemonEvent_".$action),ERROR_DIALOG); - - /* No event found, send action manually. - */ - $method= "gosa"; - $action= $_POST['saction']; - if ($action == "reinstall" || $action == "update" || $action == "instant_update"){ - $method= "job"; - } - - gosaSupportDaemon::send("${method}_trigger_action_".$action, - $this->netConfigDNS->macAddress, - array("macAddress" => $this->netConfigDNS->macAddress)); + msg_dialog::display(_("Event error"), + sprintf(_("Event '%s' is not available!"),$action),ERROR_DIALOG); } + } /* Base select dialog */ diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index 78a6c374e..8f5ac5eca 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -46,16 +46,8 @@ class workgeneric extends plugin "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser", "l","FAIscript"); var $objectclasses= array("top", "gotoWorkstation", "GOhard"); - var $mapActions = array("reboot" => "", - "localboot" => "localboot", - "halt" => "", - "update" => "softupdate", - "reinstall" => "install", - "rescan" => "", - "wake" => "", - "memcheck" => "memcheck", - "sysinfo" => "sysinfo"); - + var $validActions = array("reboot" => "", "localboot" => "", "halt" => "", "update" => "", "reinstall" => "", + "rescan" => "", "wake" => "", "memcheck" => "", "sysinfo" => ""); var $fai_activated = FALSE; @@ -175,7 +167,7 @@ class workgeneric extends plugin } } - if ((isset($_POST['action'])) && ($this->acl_is_writeable("FAIstate")) && isset($this->mapActions[$_POST['saction']]) ){ + if ((isset($_POST['action'])) && ($this->acl_is_writeable("FAIstate")) && isset($this->validActions[$_POST['saction']]) ){ $action= $_POST['saction']; /* Check if we have an DaemonEvent for this action */ @@ -192,8 +184,12 @@ class workgeneric extends plugin $o_queue->get_error()),ERROR_DIALOG); } } + } else { + msg_dialog::display(_("Event error"), + sprintf(_("Event '%s' is not available!"),$action),ERROR_DIALOG); } + } /* Do we represent a valid terminal? */ -- 2.30.2