34 |
34 |
require_once('rrd.inc');
|
35 |
35 |
require_once("shaper.inc");
|
36 |
36 |
|
37 |
|
global $ntp_poll_min_default, $ntp_poll_max_default;
|
|
37 |
global $ntp_poll_min_default, $ntp_poll_max_default, $ntp_server_types;
|
38 |
38 |
$ntp_poll_values = system_ntp_poll_values();
|
39 |
39 |
$auto_pool_suffix = "pool.ntp.org";
|
40 |
40 |
$max_candidate_peers = 25;
|
... | ... | |
79 |
79 |
}
|
80 |
80 |
|
81 |
81 |
for ($i = 0; $i < NUMTIMESERVERS; $i++) {
|
82 |
|
if (isset($pconfig["servselect{$i}"]) && (isset($pconfig["servispool{$i}"]) ||
|
|
82 |
if (isset($pconfig["servselect{$i}"]) && (($pconfig["servistype{$i}"] == 'pool') ||
|
83 |
83 |
(substr_compare($pconfig["server{$i}"], $auto_pool_suffix, strlen($pconfig["server{$i}"]) - strlen($auto_pool_suffix), strlen($auto_pool_suffix)) === 0))) {
|
84 |
84 |
$input_errors[] = gettext("It is not possible to use 'No Select' for pools.");
|
85 |
85 |
}
|
... | ... | |
121 |
121 |
unset($config['ntpd']['prefer']);
|
122 |
122 |
unset($config['ntpd']['noselect']);
|
123 |
123 |
unset($config['ntpd']['ispool']);
|
|
124 |
unset($config['ntpd']['ispeer']);
|
124 |
125 |
$timeservers = '';
|
125 |
126 |
|
126 |
127 |
for ($i = 0; $i < NUMTIMESERVERS; $i++) {
|
... | ... | |
133 |
134 |
if (isset($_POST["servselect{$i}"])) {
|
134 |
135 |
$config['ntpd']['noselect'] .= "{$tserver} ";
|
135 |
136 |
}
|
136 |
|
if (isset($_POST["servispool{$i}"])) {
|
|
137 |
if ($_POST["servistype{$i}"] == 'pool') {
|
137 |
138 |
$config['ntpd']['ispool'] .= "{$tserver} ";
|
|
139 |
} elseif ($_POST["servistype{$i}"] == 'peer') {
|
|
140 |
$config['ntpd']['ispeer'] .= "{$tserver} ";
|
138 |
141 |
}
|
139 |
142 |
}
|
140 |
143 |
}
|
... | ... | |
329 |
332 |
isset($config['ntpd']['noselect']) && isset($timeservers[$counter]) && substr_count($config['ntpd']['noselect'], $timeservers[$counter])
|
330 |
333 |
))->sethelp('No Select');
|
331 |
334 |
|
332 |
|
$group->add(new Form_Checkbox(
|
333 |
|
'servispool' . $counter,
|
334 |
|
null,
|
|
335 |
if ((substr_compare($timeservers[$counter], $auto_pool_suffix, strlen($timeservers[$counter]) - strlen($auto_pool_suffix), strlen($auto_pool_suffix)) === 0) || (isset($config['ntpd']['ispool']) && isset($timeservers[$counter]) && substr_count($config['ntpd']['ispool'], $timeservers[$counter]))) {
|
|
336 |
$servertype = 'pool';
|
|
337 |
} elseif (isset($config['ntpd']['ispeer']) && isset($timeservers[$counter]) && substr_count($config['ntpd']['ispeer'], $timeservers[$counter])) {
|
|
338 |
$servertype = 'peer';
|
|
339 |
} else {
|
|
340 |
$servertype = 'server';
|
|
341 |
}
|
|
342 |
|
|
343 |
$group->add(new Form_Select(
|
|
344 |
'servistype' . $counter,
|
335 |
345 |
null,
|
336 |
|
(substr_compare($timeservers[$counter], $auto_pool_suffix, strlen($timeservers[$counter]) - strlen($auto_pool_suffix), strlen($auto_pool_suffix)) === 0)
|
337 |
|
|| (isset($config['ntpd']['ispool']) && isset($timeservers[$counter]) && substr_count($config['ntpd']['ispool'], $timeservers[$counter]))
|
338 |
|
))->sethelp('Is a Pool');
|
|
346 |
$servertype,
|
|
347 |
$ntp_server_types
|
|
348 |
))->sethelp('Type')->setWidth(2);
|
339 |
349 |
|
340 |
350 |
$group->add(new Form_Button(
|
341 |
351 |
'deleterow' . $counter,
|
... | ... | |
363 |
373 |
'are configured and they disagree, %2$sneither%3$s will be believed. Options:%1$s' .
|
364 |
374 |
'%2$sPrefer%3$s - NTP should favor the use of this server more than all others.%1$s' .
|
365 |
375 |
'%2$sNo Select%3$s - NTP should not use this server for time, but stats for this server will be collected and displayed.%1$s' .
|
366 |
|
'%2$sIs a Pool%3$s - this entry is a pool of NTP servers and not a single address. This is assumed for *.pool.ntp.org.',
|
|
376 |
'%2$sType%3$s - Server, Peer or a Pool of NTP servers and not a single address. This is assumed for *.pool.ntp.org.',
|
367 |
377 |
'<br />',
|
368 |
378 |
'<b>',
|
369 |
379 |
'</b>',
|