Project

General

Profile

Download (18.4 KB) Statistics
| Branch: | Tag: | Revision:
1 cf180ccc jim-p
<?php
2
/*
3
	services_ntpd.php
4
5 c1e68244 nagyrobi
	Copyright (C) 2013	Dagorlad
6 cf180ccc jim-p
	Copyright (C) 2012	Jim Pingle
7 ce77a9c4 Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
8 cf180ccc jim-p
	All rights reserved.
9
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
/*
32
	pfSense_MODULE:	ntpd
33
*/
34
35
##|+PRIV
36
##|*IDENT=page-services-ntpd
37
##|*NAME=Services: NTP
38
##|*DESCR=Allow access to the 'Services: NTP' page.
39
##|*MATCH=services_ntpd.php*
40
##|-PRIV
41
42
require("guiconfig.inc");
43 c1e68244 nagyrobi
require_once('rrd.inc');
44
require_once("shaper.inc");
45 cf180ccc jim-p
46 08005d0a Ermal
if (!is_array($config['ntpd']))
47
	$config['ntpd'] = array();
48
49
if (empty($config['ntpd']['interface'])) {
50
	if (is_array($config['installedpackages']['openntpd']) && is_array($config['installedpackages']['openntpd']['config']) &&
51
	    is_array($config['installedpackages']['openntpd']['config'][0]) && !empty($config['installedpackages']['openntpd']['config'][0]['interface'])) {
52 46ca7f3d jim-p
		$pconfig['interface'] = explode(",", $config['installedpackages']['openntpd']['config'][0]['interface']);
53 cf180ccc jim-p
		unset($config['installedpackages']['openntpd']);
54 08005d0a Ermal
		write_config("Upgraded settings from openttpd");
55 cf180ccc jim-p
	} else
56
		$pconfig['interface'] = array();
57 08005d0a Ermal
} else
58 cf180ccc jim-p
	$pconfig['interface'] = explode(",", $config['ntpd']['interface']);
59
60
if ($_POST) {
61
62
	unset($input_errors);
63
	$pconfig = $_POST;
64
65
	if (!$input_errors) {
66 58168f4e jim-p
		if (is_array($_POST['interface']))
67
			$config['ntpd']['interface'] = implode(",", $_POST['interface']);
68
		elseif (isset($config['ntpd']['interface']))
69
			unset($config['ntpd']['interface']);
70 cf180ccc jim-p
71 5c8843d5 jim-p
		if (!empty($_POST['gpsport']) && file_exists('/dev/'.$_POST['gpsport']))
72
			$config['ntpd']['gpsport'] = $_POST['gpsport'];
73 6162b068 jim-p
		elseif (isset($config['ntpd']['gpsport']))
74 5c8843d5 jim-p
			unset($config['ntpd']['gpsport']);
75
76 c1e68244 nagyrobi
		unset($config['ntpd']['prefer']);
77
		unset($config['ntpd']['noselect']);
78
		$timeservers = '';
79
		for ($i = 0; $i < 10; $i++) {
80 08005d0a Ermal
			$tserver = trim($_POST["server{$i}"]);
81 c1e68244 nagyrobi
			if (!empty($tserver)) {
82
				$timeservers .= "{$tserver} ";
83
				if (!empty($_POST["servprefer{$i}"])) $config['ntpd']['prefer'] .= "{$tserver} ";
84
				if (!empty($_POST["servselect{$i}"])) $config['ntpd']['noselect'].= "{$tserver} ";
85
			}
86
		}
87 4e6b0a0e nagyrobi
		if (trim($timeservers) == "")
88
			$timeservers = "pool.ntp.org";
89 c1e68244 nagyrobi
		$config['system']['timeservers'] = trim($timeservers);
90
91
		if (!empty($_POST['ntporphan']) && ($_POST['ntporphan'] < 17) && ($_POST['ntporphan'] != '12'))
92
			$config['ntpd']['orphan'] = $_POST['ntporphan'];
93
		elseif (isset($config['ntpd']['orphan']))
94
			unset($config['ntpd']['orphan']);
95
96
		if (!empty($_POST['logpeer']))
97
			$config['ntpd']['logpeer'] = $_POST['logpeer'];
98
		elseif (isset($config['ntpd']['logpeer']))
99
			unset($config['ntpd']['logpeer']);
100
101
		if (!empty($_POST['logsys']))
102
			$config['ntpd']['logsys'] = $_POST['logsys'];
103
		elseif (isset($config['ntpd']['logsys']))
104
			unset($config['ntpd']['logsys']);
105
106
		if (!empty($_POST['clockstats']))
107
			$config['ntpd']['clockstats'] = $_POST['clockstats'];
108
		elseif (isset($config['ntpd']['clockstats']))
109
			unset($config['ntpd']['clockstats']);
110
111
		if (!empty($_POST['loopstats']))
112
			$config['ntpd']['loopstats'] = $_POST['loopstats'];
113
		elseif (isset($config['ntpd']['loopstats']))
114
			unset($config['ntpd']['loopstats']);
115
116
		if (!empty($_POST['peerstats']))
117
			$config['ntpd']['peerstats'] = $_POST['peerstats'];
118
		elseif (isset($config['ntpd']['peerstats']))
119
			unset($config['ntpd']['peerstats']);
120
121
		if (empty($_POST['kod']))
122
			$config['ntpd']['kod'] = 'on';
123
		elseif (isset($config['ntpd']['kod']))
124
			unset($config['ntpd']['kod']);
125
126
		if (empty($_POST['nomodify']))
127
			$config['ntpd']['nomodify'] = 'on';
128
		elseif (isset($config['ntpd']['nomodify']))
129
			unset($config['ntpd']['nomodify']);
130
131
		if (!empty($_POST['noquery']))
132
			$config['ntpd']['noquery'] = $_POST['noquery'];
133
		elseif (isset($config['ntpd']['noquery']))
134
			unset($config['ntpd']['noquery']);
135
136
		if (!empty($_POST['noserve']))
137
			$config['ntpd']['noserve'] = $_POST['noserve'];
138
		elseif (isset($config['ntpd']['noserve']))
139
			unset($config['ntpd']['noserve']);
140
141
		if (empty($_POST['nopeer']))
142
			$config['ntpd']['nopeer'] = 'on';
143
		elseif (isset($config['ntpd']['nopeer']))
144
			unset($config['ntpd']['nopeer']);
145
146
		if (empty($_POST['notrap']))
147
			$config['ntpd']['notrap'] = 'on';
148
		elseif (isset($config['ntpd']['notrap']))
149
			unset($config['ntpd']['notrap']);
150
151 e2caaee8 k-paulius
		if ((empty($_POST['statsgraph'])) == (isset($config['ntpd']['statsgraph'])))
152
			$enable_rrd_graphing = true;
153 c1e68244 nagyrobi
		if (!empty($_POST['statsgraph']))
154
			$config['ntpd']['statsgraph'] = $_POST['statsgraph'];
155
		elseif (isset($config['ntpd']['statsgraph']))
156
			unset($config['ntpd']['statsgraph']);
157 5a27b146 Renato Botelho
		if (isset($enable_rrd_graphing))
158 e2caaee8 k-paulius
			enable_rrd_graphing();
159 c1e68244 nagyrobi
160
		if (!empty($_POST['leaptxt']))
161
			$config['ntpd']['leapsec'] = base64_encode($_POST['leaptxt']);
162
		elseif (isset($config['ntpd']['leapsec']))
163
			unset($config['ntpd']['leapsec']);
164
165
		if (is_uploaded_file($_FILES['leapfile']['tmp_name']))
166
			$config['ntpd']['leapsec'] = base64_encode(file_get_contents($_FILES['leapfile']['tmp_name']));
167
168 cf180ccc jim-p
		write_config("Updated NTP Server Settings");
169
170
		$retval = 0;
171
		$retval = system_ntp_configure();
172
		$savemsg = get_std_save_message($retval);
173
174
	}
175
}
176 d9555fc5 Colin Fleming
$closehead = false;
177 c1e68244 nagyrobi
$pconfig = &$config['ntpd'];
178 63d5a5e0 Jean Cyr
if (empty($pconfig['interface']))
179
	$pconfig['interface'] = array();
180
else
181
	$pconfig['interface'] = explode(",", $pconfig['interface']);
182 cf180ccc jim-p
$pgtitle = array(gettext("Services"),gettext("NTP"));
183 b32dd0a6 jim-p
$shortcut_section = "ntp";
184 cf180ccc jim-p
include("head.inc");
185
186
?>
187
188 c1e68244 nagyrobi
<script type="text/javascript">
189 d9555fc5 Colin Fleming
//<![CDATA[
190 c1e68244 nagyrobi
	//Generic show an advanced option function
191
	function show_advanced(showboxID, configvalueID) {
192
		document.getElementById(showboxID).innerHTML='';
193
		aodiv = document.getElementById(configvalueID);
194
		aodiv.style.display = "block";
195
	}
196
197
	//Insure only one of two mutually exclusive options are checked
198
	function CheckOffOther(clicked, checkOff) {
199
		if (document.getElementById(clicked).checked) {
200
			document.getElementById(checkOff).checked=false;
201
		}
202
	}
203
204
	//Show another time server line, limited to 10 servers
205
	function NewTimeServer(add) {
206
		//If the last line has a value
207
		var CheckServer = 'server' + (add - 1);
208
		var LastId = document.getElementById(CheckServer);
209
		if (document.getElementById(CheckServer).value != '') {
210
			if (add < 10) {
211
				var TimeServerID = 'timeserver' + add;
212
				document.getElementById(TimeServerID).style.display = 'block';
213
				//then revise the add another server line
214
				if (add < 9) {
215
					var next = add + 1;
216 d9555fc5 Colin Fleming
					var newdiv = '<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?php echo gettext("Add another Time server");?>" onclick="NewTimeServer(' + next + ')" alt="add" />\n';
217 c1e68244 nagyrobi
					document.getElementById('addserver').innerHTML=newdiv;
218
				}else{
219
					document.getElementById('addserver').style.display = 'none';
220
				}
221
			}
222
		}
223
	}
224 d9555fc5 Colin Fleming
//]]>
225 c1e68244 nagyrobi
</script>
226 d9555fc5 Colin Fleming
</head>
227 c1e68244 nagyrobi
228 cf180ccc jim-p
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
229
<?php include("fbegin.inc"); ?>
230 c1e68244 nagyrobi
<form action="services_ntpd.php" method="post" name="iform" id="iform" enctype="multipart/form-data" accept-charset="utf-8">
231 cf180ccc jim-p
<?php if ($input_errors) print_input_errors($input_errors); ?>
232
<?php if ($savemsg) print_info_box($savemsg); ?>
233
234 d9555fc5 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="ntpd">
235 c1e68244 nagyrobi
  <tr>
236
	<td>
237
<?php
238
	$tab_array = array();
239
	$tab_array[] = array(gettext("NTP"), true, "services_ntpd.php");
240
	$tab_array[] = array(gettext("Serial GPS"), false, "services_ntpd_gps.php");
241
	$tab_array[] = array(gettext("PPS"), false, "services_ntpd_pps.php");
242
	display_top_tabs($tab_array);
243
?>
244
	</td>
245
  </tr>
246
  <tr>
247
	<td>
248
		<div id="mainarea">
249 d9555fc5 Colin Fleming
		<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
250 c1e68244 nagyrobi
			<tr>
251
				<td colspan="2" valign="top" class="listtopic"><?=gettext("NTP Server Configuration"); ?></td>
252
			</tr>
253
			<tr>
254
				<td width="22%" valign="top" class="vncellreq">Interface(s)</td>
255
				<td width="78%" class="vtable">
256 cf180ccc jim-p
<?php
257
	$interfaces = get_configured_interface_with_descr();
258
	$carplist = get_configured_carp_interface_list();
259
	foreach ($carplist as $cif => $carpip)
260
		$interfaces[$cif] = $carpip." (".get_vip_descr($carpip).")";
261
	$aliaslist = get_configured_ip_aliases_list();
262
	foreach ($aliaslist as $aliasip => $aliasif)
263
		$interfaces[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
264
	$size = (count($interfaces) < 10) ? count($interfaces) : 10;
265
?>
266 d9555fc5 Colin Fleming
			<select id="interface" name="interface[]" multiple="multiple" class="formselect" size="<?php echo $size; ?>">
267 cf180ccc jim-p
<?php	
268
	foreach ($interfaces as $iface => $ifacename) {
269
		if (!is_ipaddr(get_interface_ip($iface)) && !is_ipaddr($iface))
270
			continue;
271
		echo "<option value='{$iface}'";
272 c1e68244 nagyrobi
		if (is_array($pconfig['interface']))
273 482c93e5 Ermal
			if (in_array($iface, $pconfig['interface'])) echo " selected=\"selected\"";
274 88c24958 jim-p
		echo ">" . htmlspecialchars($ifacename) . "</option>\n";
275 cf180ccc jim-p
	} ?>
276 c1e68244 nagyrobi
					</select>
277 8cd558b6 ayvis
					<br />
278
					<br /><?php echo gettext("Interfaces without an IP address will not be shown."); ?>
279
					<br />
280
					<br /><?php echo gettext("Selecting no interfaces will listen on all interfaces with a wildcard."); ?>
281
					<br /><?php echo gettext("Selecting all interfaces will explicitly listen on only the interfaces/IPs specified."); ?>
282 c1e68244 nagyrobi
				</td>
283
			</tr>
284
			<tr>
285
				<td width="22%" valign="top" class="vncellreq">Time servers</td>
286
				<td width="78%" class="vtable">
287
					<?php
288
					$timeservers = explode( ' ', $config['system']['timeservers']);
289
					for ($i = $j = 0; $i < 10; $i++){
290
						echo "<div id=\"timeserver{$i}\"";
291
						if ((isset($timeservers[$i])) || ($i < 3)) {
292
							$j++;
293
						}else{
294
							echo " style=\"display:none\"";
295
						}
296
						echo ">\n";
297
						
298 d9555fc5 Colin Fleming
						echo "<input name=\"server{$i}\" class=\"formfld unknown\" id=\"server{$i}\" size=\"30\" value=\"{$timeservers[$i]}\" type=\"text\" />&emsp;";
299
						echo "\n<input name=\"servprefer{$i}\" class=\"formcheckbox\" id=\"servprefer{$i}\" onclick=\"CheckOffOther('servprefer{$i}', 'servselect{$i}')\" type=\"checkbox\"";
300 10221050 k-paulius
						if (isset($config['ntpd']['prefer']) && isset($timeservers[$i]) && substr_count($config['ntpd']['prefer'], $timeservers[$i])) echo " checked=\"checked\"";
301 d9555fc5 Colin Fleming
						echo " />&nbsp;prefer&emsp;";
302
						echo "\n<input name=\"servselect{$i}\" class=\"formcheckbox\" id=\"servselect{$i}\" onclick=\"CheckOffOther('servselect{$i}', 'servprefer{$i}')\" type=\"checkbox\"";
303 10221050 k-paulius
						if (isset($config['ntpd']['noselect']) && isset($timeservers[$i]) && substr_count($config['ntpd']['noselect'], $timeservers[$i])) echo " checked=\"checked\"";
304 d9555fc5 Colin Fleming
						echo " />&nbsp;noselect\n<br />\n</div>\n";
305 c1e68244 nagyrobi
					}
306
					?>
307
					<div id="addserver">
308 d9555fc5 Colin Fleming
					<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?php echo gettext("Add another Time server");?>" onclick="NewTimeServer(<?php echo $j;?>)" alt="add" />
309 c1e68244 nagyrobi
					</div>
310 8cd558b6 ayvis
					<br />
311 c1e68244 nagyrobi
					<?php echo gettext('For best results three to five servers should be configured here.'); ?>
312 8cd558b6 ayvis
					<br />
313 c1e68244 nagyrobi
					<?php echo gettext('The <i>prefer</i> option indicates that NTP should favor the use of this server more than all others.'); ?>
314 8cd558b6 ayvis
					<br />
315 c1e68244 nagyrobi
					<?php echo gettext('The <i>noselect</i> option indicates that NTP should not use this server for time, but stats for this server will be collected and displayed.'); ?>
316
				</td>
317
			</tr>
318
			<tr>
319
				<td width="22%" valign="top" class="vncellreq">Orphan mode</td>
320
				<td width="78%" class="vtable">
321 d9555fc5 Colin Fleming
					<input name="ntporphan" type="text" class="formfld unknown" id="ntporphan" min="1" max="16" size="20" value="<?=htmlspecialchars($pconfig['orphan']);?>" /><?php echo gettext("(0-15)");?><br />
322 c1e68244 nagyrobi
					<?php echo gettext("Orphan mode allows the system clock to be used when no other clocks are available. The number here specifies the stratum reported during orphan mode and should normally be set to a number high enough to insure that any other servers available to clients are preferred over this server. (default: 12)."); ?>
323
				</td>
324
			</tr>
325
			<tr>
326
				<td width="22%" valign="top" class="vncellreq">NTP graphs</td>
327
				<td width="78%" class="vtable">
328 d9555fc5 Colin Fleming
					<input name="statsgraph" type="checkbox" class="formcheckbox" id="statsgraph" <?php if($pconfig['statsgraph']) echo " checked=\"checked\""; ?> />
329 8cb4f5b1 Chris Buechler
					<?php echo gettext("Enable RRD graphs of NTP statistics (default: disabled)."); ?>
330 c1e68244 nagyrobi
				</td>
331
			</tr>
332
			<tr>
333
				<td width="22%" valign="top" class="vncellreq">Syslog logging</td>
334
				<td width="78%" class="vtable">
335
					<?php echo gettext("These options enable additional messages from NTP to be written to the System Log");?> (<a href="diag_logs_ntpd.php"><?php echo gettext("Status > System Logs > NTP"); ?></a>).
336 8cd558b6 ayvis
					<br /><br />
337 d9555fc5 Colin Fleming
					<input name="logpeer" type="checkbox" class="formcheckbox" id="logpeer"<?php if($pconfig['logpeer']) echo " checked=\"checked\""; ?> />
338 c1e68244 nagyrobi
					<?php echo gettext("Enable logging of peer messages (default: disabled)."); ?>
339 8cd558b6 ayvis
					<br />
340 d9555fc5 Colin Fleming
					<input name="logsys" type="checkbox" class="formcheckbox" id="logsys"<?php if($pconfig['logsys']) echo " checked=\"checked\""; ?> />
341 c1e68244 nagyrobi
					<?php echo gettext("Enable logging of system messages (default: disabled)."); ?>
342
				</td>
343
			</tr>
344
			<tr>
345
				<td width="22%" valign="top" class="vncellreq">Statistics logging</td>
346
				<td width="78%" class="vtable">
347
					<div id="showstatisticsbox">
348 d9555fc5 Colin Fleming
					<input type="button" onclick="show_advanced('showstatisticsbox', 'showstatistics')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show statistics logging options");?>
349 c1e68244 nagyrobi
					</div>
350
					<div id="showstatistics" style="display:none">
351 d6fa899d Phil Davis
					<strong><?php echo gettext("Warning: ")?></strong><?php echo gettext("these options will create persistent daily log files in /var/log/ntp."); ?>
352 8cd558b6 ayvis
					<br /><br />
353 d9555fc5 Colin Fleming
					<input name="clockstats" type="checkbox" class="formcheckbox" id="clockstats"<?php if($pconfig['clockstats']) echo " checked=\"checked\""; ?> />
354 c1e68244 nagyrobi
					<?php echo gettext("Enable logging of reference clock statistics (default: disabled)."); ?>
355 8cd558b6 ayvis
					<br />
356 d9555fc5 Colin Fleming
					<input name="loopstats" type="checkbox" class="formcheckbox" id="loopstats"<?php if($pconfig['loopstats']) echo " checked=\"checked\""; ?> />
357 c1e68244 nagyrobi
					<?php echo gettext("Enable logging of clock discipline statistics (default: disabled)."); ?>
358 8cd558b6 ayvis
					<br />
359 d9555fc5 Colin Fleming
					<input name="peerstats" type="checkbox" class="formcheckbox" id="peerstats"<?php if($pconfig['peerstats']) echo " checked=\"checked\""; ?> />
360 c1e68244 nagyrobi
					<?php echo gettext("Enable logging of NTP peer statistics (default: disabled)."); ?>
361
					</div>
362
				</td>
363
			</tr>
364
			<tr>
365
				<td width="22%" valign="top" class="vncellreq">Access restrictions</td>
366
				<td width="78%" class="vtable">
367
					<div id="showrestrictbox">
368 d9555fc5 Colin Fleming
					<input type="button" onclick="show_advanced('showrestrictbox', 'showrestrict')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show access restriction options");?>
369 c1e68244 nagyrobi
					</div>
370
					<div id="showrestrict" style="display:none">
371
					<?php echo gettext("these options control access to NTP from the WAN."); ?>
372 8cd558b6 ayvis
					<br /><br />
373 d9555fc5 Colin Fleming
					<input name="kod" type="checkbox" class="formcheckbox" id="kod"<?php if(!$pconfig['kod']) echo " checked=\"checked\""; ?> />
374 c1e68244 nagyrobi
					<?php echo gettext("Enable Kiss-o'-death packets (default: enabled)."); ?>
375 8cd558b6 ayvis
					<br />
376 d9555fc5 Colin Fleming
					<input name="nomodify" type="checkbox" class="formcheckbox" id="nomodify"<?php if(!$pconfig['nomodify']) echo " checked=\"checked\""; ?> />
377 c1e68244 nagyrobi
					<?php echo gettext("Deny state modifications (i.e. run time configuration) by ntpq and ntpdc (default: enabled)."); ?>
378 8cd558b6 ayvis
					<br />
379 d7563eeb Renato Botelho
					<input name="noquery" type="checkbox" class="formcheckbox" id="noquery"<?php if($pconfig['noquery']) echo " checked=\"checked\""; ?> />
380 c1e68244 nagyrobi
					<?php echo gettext("Disable ntpq and ntpdc queries (default: disabled)."); ?>
381 8cd558b6 ayvis
					<br />
382 d9555fc5 Colin Fleming
					<input name="noserve" type="checkbox" class="formcheckbox" id="noserve"<?php if($pconfig['noserve']) echo " checked=\"checked\""; ?> />
383 c1e68244 nagyrobi
					<?php echo gettext("Disable all except ntpq and ntpdc queries (default: disabled)."); ?>
384 8cd558b6 ayvis
					<br />
385 d9555fc5 Colin Fleming
					<input name="nopeer" type="checkbox" class="formcheckbox" id="nopeer"<?php if(!$pconfig['nopeer']) echo " checked=\"checked\""; ?> />
386 c1e68244 nagyrobi
					<?php echo gettext("Deny packets that attempt a peer association (default: enabled)."); ?>
387 8cd558b6 ayvis
					<br />
388 d9555fc5 Colin Fleming
					<input name="notrap" type="checkbox" class="formcheckbox" id="notrap"<?php if(!$pconfig['notrap']) echo " checked=\"checked\""; ?> />
389 c1e68244 nagyrobi
					<?php echo gettext("Deny mode 6 control message trap service (default: enabled)."); ?>
390
					</div>
391
				</td>
392
			</tr>
393
			<tr>
394
				<td width="22%" valign="top" class="vncellreq">Leap seconds</td>
395
				<td width="78%" class="vtable">
396
					<div id="showleapsecbox">
397 d9555fc5 Colin Fleming
					<input type="button" onclick="show_advanced('showleapsecbox', 'showleapsec')" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show Leap second configuration");?>
398 c1e68244 nagyrobi
					</div>
399
					<div id="showleapsec" style="display:none">
400 d6fa899d Phil Davis
					<?php echo gettext("A leap second file allows NTP to advertise an upcoming leap second addition or subtraction.");?>
401 c1e68244 nagyrobi
					<?php echo gettext("Normally this is only useful if this server is a stratum 1 time server.");?>
402 8cd558b6 ayvis
					<br /><br />
403 c1e68244 nagyrobi
					<?php echo gettext("Enter Leap second configuration as text:");?><br />
404 8cd558b6 ayvis
					<textarea name="leaptxt" class="formpre" id="leaptxt" cols="65" rows="7"><?php $text = base64_decode(chunk_split($pconfig['leapsec'])); echo $text;?></textarea><br />
405 c1e68244 nagyrobi
					<strong><?php echo gettext("Or");?></strong>, <?php echo gettext("select a file to upload:");?>
406 d9555fc5 Colin Fleming
					<input type="file" name="leapfile" class="formfld file" id="leapfile" />
407 c1e68244 nagyrobi
					</div>
408
				</td>
409
			</tr>
410
			<tr>
411
				<td width="22%" valign="top">&nbsp;</td>
412
				<td width="78%">
413 d9555fc5 Colin Fleming
				<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
414 c1e68244 nagyrobi
				</td>
415
			</tr>
416
		</table>
417 cf180ccc jim-p
</div></td></tr></table>
418
</form>
419
<?php include("fend.inc"); ?>
420
</body>
421
</html>