summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b055059)
raw | patch | inline | side by side (parent: b055059)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 22 May 2006 08:17:20 +0000 (08:17 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 22 May 2006 08:17:20 +0000 (08:17 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3486 594d385d-05f5-0310-b6e9-bd551577e9d8
TODO | patch | blob | history | |
plugins/admin/systems/class_servGeneric.inc | patch | blob | history |
index 249de715e8e1838accd78fbaaa38ebe707417f99..ae6ee31fb023fcbb2526a65dd0e32be0c3d8ad93 100644 (file)
--- a/TODO
+++ b/TODO
* Change FAIstate when triggering actions
(install, sysinfo, softupdate)
+* Fix error messages on login
+
* Fix DNS plugin
* Zones are not creatable, currently
* Error messages are partly wrong
diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc
index a28ed75b7143a9f1e2cfab8db4d832f859bdf5e0..92e5b46be38e4bc256a7986cfe3b7f767274c7b0 100644 (file)
var $l= "";
var $description= "";
var $orig_dn= "";
+ var $didAction= FALSE;
/* attribute list for save action */
var $attributes= array("cn", "description","gotoMode");
function execute()
{
- /* Call parent execute */
- plugin::execute();
+ /* Call parent execute */
+ plugin::execute();
/* Do we represent a valid server? */
if (!$this->is_account && $this->parent == NULL){
/* Check for action */
if (isset($_POST['action'])){
- switch($_POST['action']){
- case 'wake':
- $cmd= search_config($this->config->data['TABS'], "servgeneric", "WAKECMD");
- if ($cmd == ""){
- print_red(_("No WAKECMD definition found in your gosa.conf"));
- } else {
- exec ($cmd." ".$this->netConfigDNS->macAddress, $dummy, $retval);
- if ($retval != 0){
- print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
- }
- }
- break;
-
- case 'reboot':
- $cmd= search_config($this->config->data['TABS'], "servgeneric", "REBOOTCMD");
- if ($cmd == ""){
- print_red(_("No REBOOTCMD definition found in your gosa.conf"));
- } else {
- exec ($cmd." ".$this->cn, $dummy, $retval);
- if ($retval != 0){
- print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
- }
- }
- break;
-
- case 'halt':
- $cmd= search_config($this->config->data['TABS'], "servgeneric", "HALTCMD");
- if ($cmd == ""){
- print_red(_("No HALTCMD definition found in your gosa.conf"));
- } else {
- exec ($cmd." ".$this->cn, $dummy, $retval);
- if ($retval != 0){
- print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
- }
- }
- break;
+ $cmd= search_config($this->config->data['TABS'], "workgeneric", "ACTIONCMD");
+ 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;
+ }
}
}
show_ldap_error($ldap->get_error(), _("Saving server failed"));
/* Optionally execute a command after we're done */
- $this->handle_post_events($mode);
+ if(!$this->didAction){
+ $this->handle_post_events($mode);
+ }
}
}