Project

General

Profile

« Previous | Next » 

Revision aef7d92a

Added by Manuel Piovan about 5 years ago

Update services_ntpd.php

variable $min_candidate_peers
and break of long line

View differences:

src/usr/local/www/services_ntpd.php
38 38
$ntp_poll_values = system_ntp_poll_values();
39 39
$auto_pool_suffix = "pool.ntp.org";
40 40
$max_candidate_peers = 25;
41
$min_candidate_peers = 4;
41 42

  
42 43
if (!is_array($config['ntpd'])) {
43 44
	$config['ntpd'] = array();
......
60 61
	unset($input_errors);
61 62
	$pconfig = $_POST;
62 63

  
63
	if (!is_numericint($_POST['ntpmaxpeers']) || ($_POST['ntpmaxpeers'] < 4) || ($_POST['ntpmaxpeers'] > $max_candidate_peers)) {
64
		$input_errors[] = gettext("Max candidate pool peers must be a number between 4 and $max_candidate_peers");
64
	if (!is_numericint($_POST['ntpmaxpeers']) ||
65
	    ($_POST['ntpmaxpeers'] < $min_candidate_peers) ||
66
	    ($_POST['ntpmaxpeers'] > $max_candidate_peers)) {
67
		$input_errors[] = gettext("Max candidate pool peers must be a number between $min_candidate_peers and $max_candidate_peers");
65 68
	}
66 69
	
67 70
	if ((strlen($pconfig['ntporphan']) > 0) && (!is_numericint($pconfig['ntporphan']) || ($pconfig['ntporphan'] < 1) || ($pconfig['ntporphan'] > 15))) {
......
335 338
	'Max candidate pool peers',
336 339
	'number',
337 340
	$pconfig['ntpmaxpeers'],
338
	['min' => 4, 'max' => $max_candidate_peers]
341
	['min' => $min_candidate_peers, 'max' => $max_candidate_peers]
339 342
))->setHelp('Maximum candidate NTP pool peers. Remember that many servers inside pools are provided by volunteers, ' .
340 343
	'all you will gain from a higher number is extra load on the volunteer time servers. (Default: 5).');
341 344

  

Also available in: Unified diff