From b3cb20975074ea693af2aa3c75b82e1f5e6474cd Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 27 Apr 2006 11:20:04 +0000 Subject: [PATCH] gotoNtpServer is now multivalue git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3145 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_terminalGeneric.inc | 29 ++++++++-- plugins/admin/systems/terminal.tpl | 53 +++++++++---------- 2 files changed, 51 insertions(+), 31 deletions(-) diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index f991dae27..35b001d34 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -12,7 +12,7 @@ class termgeneric extends plugin var $gotoTerminalPath= ""; var $gotoSwapServer= ""; var $gotoSyslogServer= ""; - var $gotoNtpServer= ""; + var $gotoNtpServer= array(); var $gotoSndModule= ""; var $gotoFloppyEnable= ""; var $gotoCdromEnable= ""; @@ -57,6 +57,15 @@ class termgeneric extends plugin } } + /* Create used ntp server array */ + $this->gotoNtpServer= array(); + if(isset($this->attrs['gotoNtpServer'])){ + unset($this->attrs['gotoNtpServer']['count']); + foreach($this->attrs['gotoNtpServer'] as $server){ + $this->gotoNtpServer[$server] = $server; + } + } + $this->modes["disabled"]= _("disabled"); $this->modes["text"]= _("text"); $this->modes["graphic"]= _("graphic"); @@ -74,8 +83,8 @@ class termgeneric extends plugin function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ @@ -154,6 +163,20 @@ class termgeneric extends plugin return($display); } + if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers']))){ + $this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers']; + } + + if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected']))){ + foreach($_POST['gotoNtpServerSelected'] as $name){ + unset($this->gotoNtpServer[$name]); + } + if(count($this->gotoNtpServer) == 0){ + $this->gotoNtpServer['default'] = "default"; + } + } + + /* Fill templating stuff */ $smarty= get_smarty(); $smarty->assign("cn", $this->cn); diff --git a/plugins/admin/systems/terminal.tpl b/plugins/admin/systems/terminal.tpl index 3b4229454..d0a7840d1 100644 --- a/plugins/admin/systems/terminal.tpl +++ b/plugins/admin/systems/terminal.tpl @@ -2,7 +2,6 @@ - - - - + + + +
- {if $cn eq 'default'} @@ -23,15 +22,8 @@
- -
-   - + @@ -41,14 +33,23 @@ -
- +
+ +
+ +

 

+ - -
+ -
@@ -67,24 +68,20 @@
- - - +
+ - - - - - -
-
+ -
- + {html_options values=$ntpservers output=$ntpservers } + +
-- 2.30.2