Code

Updated activation
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Feb 2008 13:17:25 +0000 (13:17 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Feb 2008 13:17:25 +0000 (13:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8781 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_servGeneric.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/server.tpl

index 07b7bfa822d4f774815c4214e85e92162f35d16c..aeddfc9caa06ef6f16fb7ba8ebd4278105c1fe20 100644 (file)
@@ -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)); 
       }
     }
 
index 02c4508f525ac1cee5c76a9ef188127a76046267..33190041f3bc15d500cd8788323cd5d5d8f8dc25 100644 (file)
@@ -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;
       }
index 4e2d9b6a4c0147b6e7e86d460fd9df79fd647ad2..01e35a3a6a736a50baa5bd8f5bf04d5fba339cf4 100644 (file)
@@ -65,7 +65,7 @@
   <td>
 {render acl=$FAIstateACL}
    <select size="1" name="saction" title="{t}Select action to execute for this server{/t}">
-    <option disabled>&nbsp;</option>
+    <option>&nbsp;</option>
     {html_options options=$actions}
    </select>
 {/render}