From: cajus Date: Fri, 8 Feb 2008 13:17:25 +0000 (+0000) Subject: Updated activation X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=712dbeb2c45e376e8ef6be35115bd5f16a7e4379;p=gosa.git Updated activation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8781 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc index 07b7bfa82..aeddfc9ca 100644 --- a/gosa-plugins/systems/admin/systems/class_servGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_servGeneric.inc @@ -34,6 +34,7 @@ class servgeneric extends plugin "update" => "sceduledupdate", "reinstall" => "install", "rescan" => "", + "wake" => "", "memcheck" => "memcheck", "sysinfo" => "sysinfo"); @@ -104,17 +105,12 @@ class servgeneric extends plugin } /* Check for action */ - if (isset($_POST['action']) && $this->acl_is_writeable("FAIstate")){ - $cmd = $this->config->search("workgeneric", "ACTIONCMD",array('tabs')); - if ($cmd == ""){ - print_red(_("No ACTIONCMD definition found in your gosa.conf")); - } else { - - exec ($cmd." ".$this->netConfigDNS->macAddress." ".escapeshellarg($_POST['saction']), $dummy, $retval); - if ($retval != 0){ - print_red(sprintf(_("Execution of '%s' failed!"), $cmd)); - } else { - $this->didAction= TRUE; + if ((isset($_POST['action'])) && ($this->acl_is_writeable("FAIstate")) && isset($this->mapActions[$_POST['saction']]) ){ + gosaSupportDaemon::send("gosa_trigger_action_".$_POST['saction'], $this->netConfigDNS->ipHostNumber, array("macAddress" => $this->netConfigDNS->macAddress)); + + $this->didAction= TRUE; + + if ($_POST['saction'] != "wake") { /* Set FAIstate */ if($this->fai_activated && $this->dn != "new"){ @@ -138,15 +134,14 @@ class servgeneric extends plugin } if($attrs['FAIstate'] == ""){ -#FIXME we should check if FAIobject is used anymore + #FIXME we should check if FAIobject is used anymore $attrs['FAIstate'] = array(); } $ldap->cd($this->dn); $ldap->modify($attrs); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/generic (FAIstate) with dn '%s' failed."),$this->dn)); - } + show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/generic (FAIstate) with dn '%s' failed."),$this->dn)); } } diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index 02c4508f5..33190041f 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -853,7 +853,7 @@ class systems extends plugin $dialog = TRUE; } } - if(isset($this->systab->by_object[$this->systab->current]->netConfigDNS) && + if(isset($this->systab->current) && isset($this->systab->by_object[$this->systab->current]->netConfigDNS) && $this->systab->by_object[$this->systab->current]->netConfigDNS->dialog){ $dialog = TRUE; } diff --git a/gosa-plugins/systems/admin/systems/server.tpl b/gosa-plugins/systems/admin/systems/server.tpl index 4e2d9b6a4..01e35a3a6 100644 --- a/gosa-plugins/systems/admin/systems/server.tpl +++ b/gosa-plugins/systems/admin/systems/server.tpl @@ -65,7 +65,7 @@ {render acl=$FAIstateACL} {/render}