diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc
index b712323cc0a584fb65ed23a45b41e3ce332996d4..33a49bcb040347a9de0ab30398f0989b91ac99b5 100644 (file)
var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
/* Generic terminal attributes */
- var $gotoMode= "disabled";
- var $gotoTerminalPath= "";
- var $gotoSwapServer= "";
+ var $gotoMode= "locked";
var $gotoSyslogServer= "";
var $gotoNtpServer= "";
var $gotoSndModule= "";
var $ghGfxAdapter= "-";
var $ghSoundAdapter= "-";
var $gotoLastUser= "-";
-
+ var $FAIscript="";
+ var $didAction= FALSE;
/* Needed values and lists */
var $base= "";
var $cn= "";
+ var $l= "";
var $orig_dn= "";
/* Plugin side filled */
var $modes= array();
/* attribute list for save action */
- var $attributes= array("gotoMode", "gotoTerminalPath", "macAddress",
- "gotoSwapServer", "gotoSyslogServer", "gotoNtpServer",
+ var $ignore_account= TRUE;
+ var $attributes= array("gotoMode", "macAddress", "gotoSyslogServer", "gotoNtpServer",
"gotoFloppyEnable", "gotoCdromEnable", "cn", "gotoSndModule",
"ghCpuType", "ghMemSize", "ghUsbSupport", "ipHostNumber",
- "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser");
- var $objectclasses= array("top", "gotoWorkstation", "GOhard");
+ "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser", "l","FAIscript");
+ var $objectclasses= array("top", "gotoWorkstation", "GOhard","FAIobject");
function workgeneric ($config, $dn= NULL)
{
/* Load available modes */
$ldap= $this->config->get_ldap_link();
$ldap->cd ($this->config->current['BASE']);
- $ldap->search ("(objectClass=gotoInstallProfile)");
+ $ldap->search ("(objectClass=gotoInstallProfile)",array("cn"));
while ($attrs= $ldap->fetch()){
$this->modes[]= $attrs["cn"][0];
}
}
}
- $this->modes["disabled"]= _("disabled");
- $this->modes["text"]= _("text");
- $this->modes["graphic"]= _("graphic");
+ $this->modes["active"]= _("Activated");
+ $this->modes["locked"]= _("Locked");
+ $this->modes["memcheck"]= _("Memory test");
+ $this->modes["sysinfo"]= _("System analysis");
/* Set base */
if ($this->dn == "new"){
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Do we need to flip is_account state? */
if (isset($_POST['modify_state'])){
$this->is_account= !$this->is_account;
}
if (isset($_POST['action'])){
- switch($_POST['saction']){
- case 'wake':
- $cmd= $this->search($this->config->data['TABS'], "terminfo", "WAKECMD");
- if ($cmd == ""){
- print_red(_("No WAKECMD definition found in your gosa.conf"));
- } else {
- exec ($cmd." ".$this->macAddress, $dummy, $retval);
- if ($retval != 0){
- print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
- }
- }
- break;
-
- case 'reboot':
- $cmd= $this->search($this->config->data['TABS'], "terminfo", "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= $this->search($this->config->data['TABS'], "terminfo", "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->macAddress." ".escapeshellarg($_POST['saction']), $dummy, $retval);
+ if ($retval != 0){
+ print_red(sprintf(_("Execution of '%s' failed!"), $cmd));
+ } else {
+ $this->didAction= TRUE;
+ }
}
}
/* Do we represent a valid terminal? */
if (!$this->is_account && $this->parent == NULL){
- $display= "<img src=\"images/stop.png\" align=center> <b>".
+ $display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
_("This 'dn' has no workstation features.")."</b>";
return($display);
}
/* Fill templating stuff */
$smarty= get_smarty();
$smarty->assign("cn", $this->cn);
+ $smarty->assign("l", $this->l);
$smarty->assign("bases", $this->config->idepartments);
-
+ $smarty->assign("staticAddress", "");
+
/* Check if workstation is online */
$query= "fping -q -r 1 -t 500 ".$this->cn;
exec ($query, $dummy, $retval);
/* Offline */
if ($retval == 0){
- $smarty->assign("actions", array("halt" => _("Switch off"), "reboot" => _("Reboot")));
+ $smarty->assign("actions", array("halt" => _("Switch off"), "reboot" => _("Reboot"),
+ "instant_update" => _("Instant update"),
+ "update" => _("Scheduled update"),
+ "reinstall" => _("Reinstall"),
+ "rescan" => _("Rescan hardware")));
} else {
- $smarty->assign("actions", array("wake" => _("Wake up")));
+ $smarty->assign("actions", array("wake" => _("Wake up"),
+ "reinstall" => _("Reinstall"),
+ "update" => _("Scheduled update")));
}
/* Arrays */
$smarty->assign("modes", $this->modes);
$smarty->assign("ntpservers", $this->config->data['SERVERS']['NTP']);
/* Variables */
- foreach(array("base", "gotoMode", "gotoTerminalPath", "gotoSwapServer",
- "gotoSyslogServer", "gotoNtpServer") as $val){
-
+ foreach(array("base", "gotoMode", "gotoSyslogServer", "gotoNtpServer") as $val){
$smarty->assign($val."_select", $this->$val);
$smarty->assign($val."ACL", chkacl($this->acl, $val));
}
$smarty->assign("ipHostNumber", $this->ipHostNumber);
$smarty->assign("macAddress", $this->macAddress);
+ $smarty->assign("actionACL", chkacl($this->acl, 'action'));
/* Show main page */
$smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
}
-
- /* Save terminal path to parent since it is used by termstartup, too */
- $this->parent->by_object['termstartup']->gotoTerminalPath=
- $this->gotoTerminalPath;
}
plugin::save();
/* Strip out 'default' values */
- foreach (array("gotoTerminalPath", "gotoSwapServer", "gotoSyslogServer") as $val){
+ foreach (array("gotoSyslogServer") as $val){
if ($this->attrs[$val] == "default"){
$this->attrs[$val]= array();
$ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
$ldap->cd($this->dn);
$ldap->add($this->attrs);
- $this->handle_post_events("add");
+ if(!$this->didAction){
+ $this->handle_post_events("add");
+ }
} else {
if ($this->orig_dn != $this->dn){
$this->move($this->orig_dn, $this->dn);
}
$ldap->cd($this->dn);
$ldap->modify($this->attrs);
- $this->handle_post_events("modify");
+ if(!$this->didAction){
+ $this->handle_post_events("modify");
+ }
}
show_ldap_error($ldap->get_error());
-
- /* Optionally execute a command after we're done */
- $this->postcreate();
}
}