summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bdb0121)
raw | patch | inline | side by side (parent: bdb0121)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 27 Apr 2006 12:10:41 +0000 (12:10 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 27 Apr 2006 12:10:41 +0000 (12:10 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3148 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_terminalGeneric.inc | patch | blob | history | |
plugins/admin/systems/terminal.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc
index e7c8fe4b4ff65da5afc7aa31308030566a674a10..fefa8fc74d4d0c387c07fd53f6e4409cd38fd7e3 100644 (file)
var $gotoSwapServer= "";
var $gotoSyslogServer= "";
var $gotoNtpServer= array();
+ var $gotoNtpServers= array();
var $gotoSndModule= "";
var $gotoFloppyEnable= "";
var $gotoCdromEnable= "";
var $cn= "";
var $orig_dn= "";
+ var $inheritTimeServer = true;
+
/* Plugin side filled */
var $modes= array();
}
/* Create used ntp server array */
- $this->gotoNtpServer= array("default"=>"default");
+ $this->gotoNtpServer= array();
if(isset($this->attrs['gotoNtpServer'])){
+ $this->inheritTimeServer = false;
unset($this->attrs['gotoNtpServer']['count']);
foreach($this->attrs['gotoNtpServer'] as $server){
$this->gotoNtpServer[$server] = $server;
}
}
+ /* Set inherit checkbox state */
+ if(in_array("default",$this->gotoNtpServer)){
+ $this->inheritTimeServer = true;
+ $this->gotoNtpServer=array();
+ }
+
+ /* Create available ntp options */
+ $this->gotoNtpServers = $this->config->data['SERVERS']['NTP'];
+ foreach($this->gotoNtpServers as $key => $server){
+ if($server == "default"){
+ unset($this->gotoNtpServers[$key]);
+ }
+ }
+
$this->modes["disabled"]= _("disabled");
$this->modes["text"]= _("text");
$this->modes["graphic"]= _("graphic");
foreach($_POST['gotoNtpServerSelected'] as $name){
unset($this->gotoNtpServer[$name]);
}
-
- /* if nothing is selected, add default */
- if(count($this->gotoNtpServer) == 0){
- $this->gotoNtpServer['default'] = "default";
- }
}
-
/* Fill templating stuff */
$smarty= get_smarty();
$smarty->assign("cn", $this->cn);
$smarty->assign("bases", $this->config->idepartments);
+ /* tell smarty the inherit checkbox state */
+ $smarty->assign("inheritTimeServer",$this->inheritTimeServer);
+
/* Check if terminal is online */
$query= "fping -q -r 1 -t 500 ".$this->cn;
exec ($query, $dummy, $retval);
}
}
- $smarty->assign("nfsservers", $tmp2);
- $smarty->assign("syslogservers", $this->config->data['SERVERS']['SYSLOG']);
- $smarty->assign("ntpservers", $this->config->data['SERVERS']['NTP']);
+ $smarty->assign("nfsservers", $tmp2);
+ $smarty->assign("syslogservers", $this->config->data['SERVERS']['SYSLOG']);
+ $smarty->assign("ntpservers", $this->gotoNtpServers);
/* Variables */
foreach(array("base", "gotoMode", "gotoTerminalPath", "gotoSwapServer",
/* Save terminal path to parent since it is used by termstartup, too */
$this->parent->by_object['termstartup']->gotoTerminalPath=
$this->gotoTerminalPath;
+
+ if(isset($_POST['cn'])){
+ if(isset($_POST["inheritTimeServer"])){
+ $this->inheritTimeServer = true;
+ }else{
+ $this->inheritTimeServer = false;
+ }
+ }
}
}
}
+ /* Check for valid ntpServer selection */
+ if((!$this->inheritTimeServer) && (!count($this->gotoNtpServer))){
+ $message[]= _("There must be at least one NTP server selected, or the inherit mode activated.");
+ }
+
return ($message);
}
$this->attrs= $attrs;
}
- /* Set ntpServers */
- $this->attrs['gotoNtpServer'] = array();
- foreach($this->gotoNtpServer as $server){
- $this->attrs['gotoNtpServer'][] = $server;
+ if($this->inheritTimeServer){
+ $this->attrs['gotoNtpServer'] = "default";
+ }else{
+ /* Set ntpServers */
+ $this->attrs['gotoNtpServer'] = array();
+ foreach($this->gotoNtpServer as $server){
+ $this->attrs['gotoNtpServer'][] = $server;
+ }
}
/* Write back to ldap */
index d0a7840d1f10ef0f4b8fb75ee59b6f54bad7e36b..e1f29a5c0af0a2fa9c1d3bc069e53b5a8440d583 100644 (file)
<td style="border-left:1px solid #A0A0A0;">
<table width="100%">
<tr>
- <td colspan="2"><LABEL for="gotoNtpServerSelected">{t}NTP server{/t}</LABEL><br>
+ <td colspan="2">
+ <input type="checkbox" value="1" name="inheritTimeServer"
+ {if $inheritTimeServer } checked {/if}
+ onClick="javascript: document.mainform.submit();">{t}Inherit time server attributes{/t}
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" style='padding-left:14px;padding-top:5px;'><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}>
+ title="{t}Choose server to use for synchronizing time{/t}" {$gotoNtpServerACL} {if $inheritTimeServer} disabled {/if}>
{html_options options=$gotoNtpServer_select}
</select>
<br>
- <select name="gotoNtpServers" id="gotoNtpServers" {$gotoNtpServerACL}>
+ <select name="gotoNtpServers" id="gotoNtpServers" {$gotoNtpServerACL} {if $inheritTimeServer} disabled {/if} >
{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}">
+ <input type="submit" name="addNtpServer" value="{t}Add{/t}" id="addNtpServer" {$gotoNtpServerACL}
+ {if $inheritTimeServer} disabled {/if}>
+ <input type="submit" name="delNtpServer" value="{t}Delete{/t}" id="delNtpServer" {$gotoNtpServerACL}
+ {if $inheritTimeServer} disabled {/if}>
</td>
</tr>
</table>