summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b717da3)
raw | patch | inline | side by side (parent: b717da3)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 31 Jan 2008 16:24:58 +0000 (16:24 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 31 Jan 2008 16:24:58 +0000 (16:24 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8707 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc | patch | blob | history | |
gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
index 9ac6d7d1f5278980aed38507e8c2a31d995b85ec..a94547aeecf20c94234b1b1b1924be4b934cd1ad 100644 (file)
var $objectclasses= array("top", "gotoTerminal", "GOhard");
var $mapActions = array("reboot" => "",
- "instant_update" => "softupdate",
- "update" => "sceduledupdate",
- "reinstall" => "install",
"rescan" => "",
+ "wake" => "",
"memcheck" => "memcheck",
"sysinfo" => "sysinfo");
$this->is_account= !$this->is_account;
}
- if (isset($_POST['action']) && $this->acl_is_writeable("FAIstate")){
-
- /* Set FAIstate */
- if($this->fai_activated && $this->dn != "new"){
- $ldap = $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->cat($this->dn,array("objectClass"));
- $res = $ldap->fetch();
-
- $attrs = array();
- $attrs['FAIstate'] = "";
- if(isset($this->mapActions[$_POST['saction']])){
- $attrs['FAIstate'] = $this->mapActions[$_POST ['saction']];
- }
-
- for($i = 0; $i < $res['objectClass']['count'] ; $i ++){
- $attrs['objectClass'][] = $res['objectClass'][$i];
- }
-
- if(($attrs['FAIstate'] != "") && (!in_array("FAIobject",$attrs['objectClass']))){
- $attrs['objectClass'][] = "FAIobject";
- }
-
- if($attrs['FAIstate'] == ""){
-#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 terminal/generic (FAIstate) with dn '%s' failed."),$this->dn));
- }
-
- switch($_POST['saction']){
- case 'wake':
- $cmd= $this->config->search("termgeneric", "WAKECMD",array('tabs'));
-
- 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= $this->config->search("termgeneric", "REBOOTCMD",array('tabs'));
- 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= $this->config->search("termgeneric", "HALTCMD",array('tabs'));
- 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;
- }
+ 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));
}
/* 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 8b31f43295040dfe5cdd245ef1c2afdc9ab47c92..b151d3a833f49ebe02c99ae384a06e34fcc9330e 100644 (file)
"update" => "scheduledupdate",
"reinstall" => "install",
"rescan" => "",
+ "wake" => "",
"memcheck" => "memcheck",
"sysinfo" => "sysinfo");
}
}
- 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));
- } elseif ($_POST['saction'] != "wake") {
+ 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));
+
+ if ($_POST['saction'] != "wake") {
/* Set FAIstate */
if($this->fai_activated && $this->dn != "new"){
}
if($attrs['FAIstate'] == ""){
-#FIXME we should check if FAIobject is not used anymore
+ #FIXME we should check if FAIobject is not used anymore
$attrs['FAIstate'] = array();
}
}
$this->didAction= TRUE;
}
- }
}
/* Do we represent a valid terminal? */