From f1b7d2396864141d53cc2511b82b30d528df0a43 Mon Sep 17 00:00:00 2001 From: cajus Date: Sun, 16 Oct 2005 14:47:52 +0000 Subject: [PATCH] Fixed workgeneric to work in a generic way ;-) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1574 594d385d-05f5-0310-b6e9-bd551577e9d8 --- TODO | 12 ---- contrib/gosa.conf | 2 +- contrib/openldap/goto.schema | 6 +- .../systems/class_workstationGeneric.inc | 60 ++++++------------- plugins/admin/systems/tabs_workstation.inc | 1 - 5 files changed, 22 insertions(+), 59 deletions(-) diff --git a/TODO b/TODO index e61031a05..303c121c7 100644 --- a/TODO +++ b/TODO @@ -31,18 +31,10 @@ Things to fix before 2.4: - Re-implement profile management, divlists look pretty ugly here - Check base64_encoding/decoding is not needed everytime. -* Phone account - - Errors when phone account is diabled and a user is saved (?) - * Add function to get GOto application templates -> filled variables, etc. -* Disabling error messages doesn't work, (?) - -* Saving of initially created gofon stuff fails (?) - * Group Dialog : Primary group chkbox is broken, nothing is shown if it is checked. -======= * Base is not evaluated in several dialogs -> Creating an object in a special base results in creation in the ldap root @@ -50,10 +42,6 @@ Things to fix before 2.4: * Save FAI sub objects directly when they already exist -* FAI variables are not editable during creation - -* FAI package lists -> why do we ask for distribution if the list is already filled? - * FAI package lists behave strange diff --git a/contrib/gosa.conf b/contrib/gosa.conf index 2c2f31ed2..a6ba28ebc 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -100,8 +100,8 @@ - + diff --git a/contrib/openldap/goto.schema b/contrib/openldap/goto.schema index 96de90aa3..485a70c91 100644 --- a/contrib/openldap/goto.schema +++ b/contrib/openldap/goto.schema @@ -408,15 +408,15 @@ objectclass (1.3.6.1.4.1.10098.1.2.1.18 NAME 'gotoInstallProfile' SUP top STRUCT objectclass (1.3.6.1.4.1.10098.1.2.1.30 NAME 'gotoWorkstation' DESC 'GOto - Gonicus Terminal Concept, objectclass (v2.3)' SUP top STRUCTURAL MUST ( cn ) - MAY ( gotoSyslogServer $ gotoNtpServer $ gotoSwapServer $ gotoLpdServer $ + MAY ( gotoNtpServer $ gotoSwapServer $ gotoLpdServer $ gotoFontPath $ gotoFilesystem $ gotoFloppyEnable $ gotoCdromEnable $ - gotoLpdEnable $ gotoScannerEnable $ gotoScannerClients $ + gotoLpdEnable $ gotoScannerEnable $ gotoScannerClients $ l $ gotoRootPasswd $ gotoXdmcpServer $ gotoXMethod $ gotoSndModule $ gotoLastUser $ gotoXMonitor $ gotoXHsync $ gotoXVsync $ gotoXResolution $ gotoXColordepth $ gotoXMouseport $ gotoXMouseButtons $ gotoMode $ gotoXKbModel $ gotoXKbLayout $ gotoXKbVariant $ gotoXDriver $ gotoXMouseType $ macAddress $ gotoAutoFs $ gotoModules $ gotoAdaptPath $ gotoKernelParameters $ gotoBootKernel $ - gotoTerminalPath $ gotoLdapServer $ gotoScannerModel $ ipHostNumber $ goFonHardware ) ) + gotoLdapServer $ gotoScannerModel $ ipHostNumber $ goFonHardware ) ) # objectclass for the Terminal Conecept objectclass (1.3.6.1.4.1.10098.1.2.1.31 NAME 'gotoPrinter' diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 062073468..34b68b39e 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -8,7 +8,7 @@ class workgeneric extends plugin var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); /* Generic terminal attributes */ - var $gotoMode= "disabled"; + var $gotoMode= "locked"; var $gotoSyslogServer= ""; var $gotoNtpServer= ""; var $gotoSndModule= ""; @@ -65,9 +65,9 @@ class workgeneric extends plugin } } - $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"); /* Set base */ if ($this->dn == "new"){ @@ -89,42 +89,14 @@ class workgeneric extends plugin } if (isset($_POST['action'])){ - switch($_POST['saction']){ - case 'wake': - $cmd= search_config($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= search_config($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= search_config($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'], "terminfo", "ACTIONCMD"); + if ($cmd == ""){ + print_red(_("No ACTIONCMD definition found in your gosa.conf")); + } else { + exec ($cmd." ".$this->macAddress." ".escapeshellarg($_POST['action']), $dummy, $retval); + if ($retval != 0){ + print_red(sprintf(_("Execution of '%s' failed!"), $cmd)); + } } } @@ -148,9 +120,13 @@ class workgeneric extends plugin /* 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"), + "rescan" => _("Rescan hardware"))); } else { - $smarty->assign("actions", array("wake" => _("Wake up"))); + $smarty->assign("actions", array("wake" => _("Wake up"), + "update" => _("Scheduled update"))); } /* Arrays */ $smarty->assign("modes", $this->modes); diff --git a/plugins/admin/systems/tabs_workstation.inc b/plugins/admin/systems/tabs_workstation.inc index bb5b892a8..6913ac91e 100644 --- a/plugins/admin/systems/tabs_workstation.inc +++ b/plugins/admin/systems/tabs_workstation.inc @@ -10,7 +10,6 @@ class worktabs extends tabs function save_object($save_current= FALSE) { -echo "Take care of the l attribute. It needs to be synced in case of workstations."; tabs::save_object($save_current); } -- 2.30.2