Code

gotoNtpServer is now multivalue
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Apr 2006 11:20:04 +0000 (11:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Apr 2006 11:20:04 +0000 (11:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3145 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_terminalGeneric.inc
plugins/admin/systems/terminal.tpl

index f991dae27aa24b7bb48a0939b6200f83169242ad..35b001d341b8df2b240800f57172b28767e699f6 100644 (file)
@@ -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);
index 3b4229454e4da2b85ebaf51d21cc0a0f70ce4730..d0a7840d1f10ef0f4b8fb75ee59b6f54bad7e36b 100644 (file)
@@ -2,7 +2,6 @@
 <table summary="" style="width:100%;">
  <tr>
   <td style="width:50%; vertical-align:top;">
-
    <table summary="">
     <tr>
      {if $cn eq 'default'}
                <input type="image" name="chooseBase" src="images/folder.png" class="center" title="{t}Select a base{/t}">
     </tr>
    </table>
-
-  </td>
-
-  <td rowspan=2 style="border-left:1px solid #A0A0A0">
-   &nbsp;
   </td>
-
-  <td style="vertical-align:top;">
-
+  <td style="vertical-align:top;border-left:1px solid #A0A0A0;" >
    <table summary="">
     <tr>
      <td><LABEL for="gotoMode">{t}Mode{/t}</LABEL></td>
       </select>
      </td>
     </tr>
-   </table>
-
+    <tr>
+     <td><LABEL for="gotoSyslogServer">{t}Syslog server{/t}</LABEL></td>
+     <td>
+      <select name="gotoSyslogServer" id="gotoSyslogServer" title="{t}Choose server to use for logging{/t}" {$gotoSyslogServerACL}>
+       {html_options values=$syslogservers output=$syslogservers selected=$gotoSyslogServer_select}
+      </select>
+     </td>
+    </tr>
+       </table>
   </td>
  </tr>
+</table>
+<p class="seperator" style="margin:0px; padding:0px;">&nbsp;</p>
+<table style="width:100%;">
  <tr>
-  <td style="width:50%;">
+  <td style="width:50%;vertical-align:top;">
    <table summary="">
-    <tr><td colspan=2><div style="height:15px;"></div></td></tr>
     <tr>
      <td><LABEL for="gotoTerminalPath">{t}Root server{/t}</LABEL></td>
      <td>
     </tr>
    </table>
   </td>
-  <td style="vertical-align:top;">
-
-   <table summary="">
-    <tr><td colspan=2><div style="height:15px;"></div></td></tr>
+  <td style="border-left:1px solid #A0A0A0;">
+       <table width="100%">
     <tr>
-     <td><LABEL for="gotoSyslogServer">{t}Syslog server{/t}</LABEL></td>
-     <td>
-      <select name="gotoSyslogServer" id="gotoSyslogServer" title="{t}Choose server to use for logging{/t}" {$gotoSyslogServerACL}>
-       {html_options values=$syslogservers output=$syslogservers selected=$gotoSyslogServer_select}
+     <td colspan="2"><LABEL for="gotoNtpServerSelected">{t}NTP server{/t}</LABEL><br>
+      <select name="gotoNtpServerSelected[]" id="gotoNtpServerSelected" multiple size=5 style="width:100%;"
+                       title="{t}Choose server to use for synchronizing time{/t}" {$gotoNtpServerACL}>
+       {html_options options=$gotoNtpServer_select}
       </select>
-     </td>
-    </tr>
-    <tr>
-     <td><LABEL for="gotoNtpServer">{t}NTP server{/t}</LABEL></td>
-     <td>
-      <select name="gotoNtpServer" id="gotoNtpServer" title="{t}Choose server to use for synchronizing time{/t}" {$gotoNtpServerACL}>
-       {html_options values=$ntpservers output=$ntpservers selected=$gotoNtpServer_select}
+        <br>
+      <select name="gotoNtpServers" id="gotoNtpServers" {$gotoNtpServerACL}>
+       {html_options values=$ntpservers output=$ntpservers }
       </select>
+               <input type="submit" name="addNtpServer" value="{t}Add{/t}">
+               <input type="submit" name="delNtpServer" value="{t}Delete{/t}">
      </td>
     </tr>
    </table>