Commit c316a424 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) fix dependencies and uninitialized variables in ntp

parent 28e8fbcd
...@@ -33,7 +33,7 @@ require_once("services.inc"); ...@@ -33,7 +33,7 @@ require_once("services.inc");
require_once("system.inc"); require_once("system.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
if (!is_array($config['ntpd'])) if (!isset($config['ntpd']) || !is_array($config['ntpd']))
$config['ntpd'] = array(); $config['ntpd'] = array();
if (empty($config['ntpd']['interface'])) { if (empty($config['ntpd']['interface'])) {
...@@ -46,114 +46,112 @@ if ($_POST) { ...@@ -46,114 +46,112 @@ if ($_POST) {
unset($input_errors); unset($input_errors);
$pconfig = $_POST; $pconfig = $_POST;
if (!$input_errors) { if (isset($_POST['interface']) && is_array($_POST['interface']))
if (is_array($_POST['interface'])) $config['ntpd']['interface'] = implode(",", $_POST['interface']);
$config['ntpd']['interface'] = implode(",", $_POST['interface']); elseif (isset($config['ntpd']['interface']))
elseif (isset($config['ntpd']['interface'])) unset($config['ntpd']['interface']);
unset($config['ntpd']['interface']);
if (!empty($_POST['gpsport']) && file_exists('/dev/'.$_POST['gpsport']))
if (!empty($_POST['gpsport']) && file_exists('/dev/'.$_POST['gpsport'])) $config['ntpd']['gpsport'] = $_POST['gpsport'];
$config['ntpd']['gpsport'] = $_POST['gpsport']; elseif (isset($config['ntpd']['gpsport']))
elseif (isset($config['ntpd']['gpsport'])) unset($config['ntpd']['gpsport']);
unset($config['ntpd']['gpsport']);
unset($config['ntpd']['prefer']);
unset($config['ntpd']['prefer']); unset($config['ntpd']['noselect']);
unset($config['ntpd']['noselect']); $timeservers = '';
$timeservers = ''; for ($i = 0; $i < 10; $i++) {
for ($i = 0; $i < 10; $i++) { $tserver = trim($_POST["server{$i}"]);
$tserver = trim($_POST["server{$i}"]); if (!empty($tserver)) {
if (!empty($tserver)) { $timeservers .= "{$tserver} ";
$timeservers .= "{$tserver} "; if (!empty($_POST["servprefer{$i}"])) $config['ntpd']['prefer'] .= "{$tserver} ";
if (!empty($_POST["servprefer{$i}"])) $config['ntpd']['prefer'] .= "{$tserver} "; if (!empty($_POST["servselect{$i}"])) $config['ntpd']['noselect'].= "{$tserver} ";
if (!empty($_POST["servselect{$i}"])) $config['ntpd']['noselect'].= "{$tserver} ";
}
} }
if (trim($timeservers) == "")
$timeservers = "pool.ntp.org";
$config['system']['timeservers'] = trim($timeservers);
if (!empty($_POST['ntporphan']) && ($_POST['ntporphan'] < 17) && ($_POST['ntporphan'] != '12'))
$config['ntpd']['orphan'] = $_POST['ntporphan'];
elseif (isset($config['ntpd']['orphan']))
unset($config['ntpd']['orphan']);
if (!empty($_POST['logpeer']))
$config['ntpd']['logpeer'] = $_POST['logpeer'];
elseif (isset($config['ntpd']['logpeer']))
unset($config['ntpd']['logpeer']);
if (!empty($_POST['logsys']))
$config['ntpd']['logsys'] = $_POST['logsys'];
elseif (isset($config['ntpd']['logsys']))
unset($config['ntpd']['logsys']);
if (!empty($_POST['clockstats']))
$config['ntpd']['clockstats'] = $_POST['clockstats'];
elseif (isset($config['ntpd']['clockstats']))
unset($config['ntpd']['clockstats']);
if (!empty($_POST['loopstats']))
$config['ntpd']['loopstats'] = $_POST['loopstats'];
elseif (isset($config['ntpd']['loopstats']))
unset($config['ntpd']['loopstats']);
if (!empty($_POST['peerstats']))
$config['ntpd']['peerstats'] = $_POST['peerstats'];
elseif (isset($config['ntpd']['peerstats']))
unset($config['ntpd']['peerstats']);
if (empty($_POST['kod']))
$config['ntpd']['kod'] = 'on';
elseif (isset($config['ntpd']['kod']))
unset($config['ntpd']['kod']);
if (empty($_POST['nomodify']))
$config['ntpd']['nomodify'] = 'on';
elseif (isset($config['ntpd']['nomodify']))
unset($config['ntpd']['nomodify']);
if (!empty($_POST['noquery']))
$config['ntpd']['noquery'] = $_POST['noquery'];
elseif (isset($config['ntpd']['noquery']))
unset($config['ntpd']['noquery']);
if (!empty($_POST['noserve']))
$config['ntpd']['noserve'] = $_POST['noserve'];
elseif (isset($config['ntpd']['noserve']))
unset($config['ntpd']['noserve']);
if (empty($_POST['nopeer']))
$config['ntpd']['nopeer'] = 'on';
elseif (isset($config['ntpd']['nopeer']))
unset($config['ntpd']['nopeer']);
if (empty($_POST['notrap']))
$config['ntpd']['notrap'] = 'on';
elseif (isset($config['ntpd']['notrap']))
unset($config['ntpd']['notrap']);
if ((empty($_POST['statsgraph'])) != (isset($config['ntpd']['statsgraph'])));
enable_rrd_graphing();
if (!empty($_POST['statsgraph']))
$config['ntpd']['statsgraph'] = $_POST['statsgraph'];
elseif (isset($config['ntpd']['statsgraph']))
unset($config['ntpd']['statsgraph']);
if (!empty($_POST['leaptxt']))
$config['ntpd']['leapsec'] = base64_encode($_POST['leaptxt']);
elseif (isset($config['ntpd']['leapsec']))
unset($config['ntpd']['leapsec']);
if (is_uploaded_file($_FILES['leapfile']['tmp_name']))
$config['ntpd']['leapsec'] = base64_encode(file_get_contents($_FILES['leapfile']['tmp_name']));
write_config("Updated NTP Server Settings");
$retval = 0;
$retval = system_ntp_configure();
$savemsg = get_std_save_message($retval);
} }
if (trim($timeservers) == "")
$timeservers = "pool.ntp.org";
$config['system']['timeservers'] = trim($timeservers);
if (!empty($_POST['ntporphan']) && ($_POST['ntporphan'] < 17) && ($_POST['ntporphan'] != '12'))
$config['ntpd']['orphan'] = $_POST['ntporphan'];
elseif (isset($config['ntpd']['orphan']))
unset($config['ntpd']['orphan']);
if (!empty($_POST['logpeer']))
$config['ntpd']['logpeer'] = $_POST['logpeer'];
elseif (isset($config['ntpd']['logpeer']))
unset($config['ntpd']['logpeer']);
if (!empty($_POST['logsys']))
$config['ntpd']['logsys'] = $_POST['logsys'];
elseif (isset($config['ntpd']['logsys']))
unset($config['ntpd']['logsys']);
if (!empty($_POST['clockstats']))
$config['ntpd']['clockstats'] = $_POST['clockstats'];
elseif (isset($config['ntpd']['clockstats']))
unset($config['ntpd']['clockstats']);
if (!empty($_POST['loopstats']))
$config['ntpd']['loopstats'] = $_POST['loopstats'];
elseif (isset($config['ntpd']['loopstats']))
unset($config['ntpd']['loopstats']);
if (!empty($_POST['peerstats']))
$config['ntpd']['peerstats'] = $_POST['peerstats'];
elseif (isset($config['ntpd']['peerstats']))
unset($config['ntpd']['peerstats']);
if (empty($_POST['kod']))
$config['ntpd']['kod'] = 'on';
elseif (isset($config['ntpd']['kod']))
unset($config['ntpd']['kod']);
if (empty($_POST['nomodify']))
$config['ntpd']['nomodify'] = 'on';
elseif (isset($config['ntpd']['nomodify']))
unset($config['ntpd']['nomodify']);
if (!empty($_POST['noquery']))
$config['ntpd']['noquery'] = $_POST['noquery'];
elseif (isset($config['ntpd']['noquery']))
unset($config['ntpd']['noquery']);
if (!empty($_POST['noserve']))
$config['ntpd']['noserve'] = $_POST['noserve'];
elseif (isset($config['ntpd']['noserve']))
unset($config['ntpd']['noserve']);
if (empty($_POST['nopeer']))
$config['ntpd']['nopeer'] = 'on';
elseif (isset($config['ntpd']['nopeer']))
unset($config['ntpd']['nopeer']);
if (empty($_POST['notrap']))
$config['ntpd']['notrap'] = 'on';
elseif (isset($config['ntpd']['notrap']))
unset($config['ntpd']['notrap']);
if ((empty($_POST['statsgraph'])) != (isset($config['ntpd']['statsgraph'])));
enable_rrd_graphing();
if (!empty($_POST['statsgraph']))
$config['ntpd']['statsgraph'] = $_POST['statsgraph'];
elseif (isset($config['ntpd']['statsgraph']))
unset($config['ntpd']['statsgraph']);
if (!empty($_POST['leaptxt']))
$config['ntpd']['leapsec'] = base64_encode($_POST['leaptxt']);
elseif (isset($config['ntpd']['leapsec']))
unset($config['ntpd']['leapsec']);
if (is_uploaded_file($_FILES['leapfile']['tmp_name']))
$config['ntpd']['leapsec'] = base64_encode(file_get_contents($_FILES['leapfile']['tmp_name']));
write_config("Updated NTP Server Settings");
$retval = 0;
$retval = system_ntp_configure();
$savemsg = get_std_save_message($retval);
} }
$closehead = false; $closehead = false;
$pconfig = &$config['ntpd']; $pconfig = &$config['ntpd'];
...@@ -282,13 +280,17 @@ include("head.inc"); ...@@ -282,13 +280,17 @@ include("head.inc");
echo " style=\"display:none\""; echo " style=\"display:none\"";
} }
echo ">\n"; echo ">\n";
if (!isset($timeservers[$i])) {
echo "<input name=\"server{$i}\" class=\"formfld unknown\" id=\"server{$i}\" size=\"30\" value=\"{$timeservers[$i]}\" type=\"text\" />&emsp;"; $timeserverVal = null;
} else {
$timeserverVal =$timeservers[$i];
}
echo "<input name=\"server{$i}\" class=\"formfld unknown\" id=\"server{$i}\" size=\"30\" value=\"{$timeserverVal}\" type=\"text\" />&emsp;";
echo "\n<input name=\"servprefer{$i}\" class=\"formcheckbox\" id=\"servprefer{$i}\" onclick=\"CheckOffOther('servprefer{$i}', 'servselect{$i}')\" type=\"checkbox\""; echo "\n<input name=\"servprefer{$i}\" class=\"formcheckbox\" id=\"servprefer{$i}\" onclick=\"CheckOffOther('servprefer{$i}', 'servselect{$i}')\" type=\"checkbox\"";
if (substr_count($config['ntpd']['prefer'], $timeservers[$i])) echo " checked=\"checked\""; if (isset($config['ntpd']['prefer']) && substr_count($config['ntpd']['prefer'], $timeserverVal)) echo " checked=\"checked\"";
echo " />&nbsp;prefer&emsp;"; echo " />&nbsp;prefer&emsp;";
echo "\n<input name=\"servselect{$i}\" class=\"formcheckbox\" id=\"servselect{$i}\" onclick=\"CheckOffOther('servselect{$i}', 'servprefer{$i}')\" type=\"checkbox\""; echo "\n<input name=\"servselect{$i}\" class=\"formcheckbox\" id=\"servselect{$i}\" onclick=\"CheckOffOther('servselect{$i}', 'servprefer{$i}')\" type=\"checkbox\"";
if (substr_count($config['ntpd']['noselect'], $timeservers[$i])) echo " checked=\"checked\""; if (isset($config['ntpd']['noselect']) && substr_count($config['ntpd']['noselect'], $timeserverVal)) echo " checked=\"checked\"";
echo " />&nbsp;noselect\n<br />\n</div>\n"; echo " />&nbsp;noselect\n<br />\n</div>\n";
} }
?> ?>
...@@ -306,14 +308,14 @@ include("head.inc"); ...@@ -306,14 +308,14 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq">Orphan mode</td> <td width="22%" valign="top" class="vncellreq">Orphan mode</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<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 /> <input name="ntporphan" type="text" class="formfld unknown" id="ntporphan" min="1" max="16" size="20" value="<?=htmlspecialchars(isset($pconfig['orphan']) ? $pconfig['orphan']:"");?>" /><?php echo gettext("(0-15)");?><br />
<?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)."); ?> <?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)."); ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq">NTP graphs</td> <td width="22%" valign="top" class="vncellreq">NTP graphs</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="statsgraph" type="checkbox" class="formcheckbox" id="statsgraph" <?php if($pconfig['statsgraph']) echo " checked=\"checked\""; ?> /> <input name="statsgraph" type="checkbox" class="formcheckbox" id="statsgraph" <?php if(!empty($pconfig['statsgraph'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Enable rrd graphs of NTP statistics (default: disabled)."); ?> <?php echo gettext("Enable rrd graphs of NTP statistics (default: disabled)."); ?>
</td> </td>
</tr> </tr>
...@@ -322,10 +324,10 @@ include("head.inc"); ...@@ -322,10 +324,10 @@ include("head.inc");
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?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>). <?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>).
<br /><br /> <br /><br />
<input name="logpeer" type="checkbox" class="formcheckbox" id="logpeer"<?php if($pconfig['logpeer']) echo " checked=\"checked\""; ?> /> <input name="logpeer" type="checkbox" class="formcheckbox" id="logpeer"<?php if(!empty($pconfig['logpeer'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Enable logging of peer messages (default: disabled)."); ?> <?php echo gettext("Enable logging of peer messages (default: disabled)."); ?>
<br /> <br />
<input name="logsys" type="checkbox" class="formcheckbox" id="logsys"<?php if($pconfig['logsys']) echo " checked=\"checked\""; ?> /> <input name="logsys" type="checkbox" class="formcheckbox" id="logsys"<?php if(!empty($pconfig['logsys'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Enable logging of system messages (default: disabled)."); ?> <?php echo gettext("Enable logging of system messages (default: disabled)."); ?>
</td> </td>
</tr> </tr>
...@@ -338,13 +340,13 @@ include("head.inc"); ...@@ -338,13 +340,13 @@ include("head.inc");
<div id="showstatistics" style="display:none"> <div id="showstatistics" style="display:none">
<strong><?php echo gettext("Warning: ")?></strong><?php echo gettext("these options will create persistant daily log files in /var/log/ntp."); ?> <strong><?php echo gettext("Warning: ")?></strong><?php echo gettext("these options will create persistant daily log files in /var/log/ntp."); ?>
<br /><br /> <br /><br />
<input name="clockstats" type="checkbox" class="formcheckbox" id="clockstats"<?php if($pconfig['clockstats']) echo " checked=\"checked\""; ?> /> <input name="clockstats" type="checkbox" class="formcheckbox" id="clockstats"<?php if(!empty($pconfig['clockstats'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Enable logging of reference clock statistics (default: disabled)."); ?> <?php echo gettext("Enable logging of reference clock statistics (default: disabled)."); ?>
<br /> <br />
<input name="loopstats" type="checkbox" class="formcheckbox" id="loopstats"<?php if($pconfig['loopstats']) echo " checked=\"checked\""; ?> /> <input name="loopstats" type="checkbox" class="formcheckbox" id="loopstats"<?php if(!empty($pconfig['loopstats'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Enable logging of clock discipline statistics (default: disabled)."); ?> <?php echo gettext("Enable logging of clock discipline statistics (default: disabled)."); ?>
<br /> <br />
<input name="peerstats" type="checkbox" class="formcheckbox" id="peerstats"<?php if($pconfig['peerstats']) echo " checked=\"checked\""; ?> /> <input name="peerstats" type="checkbox" class="formcheckbox" id="peerstats"<?php if(!empty($pconfig['peerstats'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Enable logging of NTP peer statistics (default: disabled)."); ?> <?php echo gettext("Enable logging of NTP peer statistics (default: disabled)."); ?>
</div> </div>
</td> </td>
...@@ -358,22 +360,22 @@ include("head.inc"); ...@@ -358,22 +360,22 @@ include("head.inc");
<div id="showrestrict" style="display:none"> <div id="showrestrict" style="display:none">
<?php echo gettext("these options control access to NTP from the WAN."); ?> <?php echo gettext("these options control access to NTP from the WAN."); ?>
<br /><br /> <br /><br />
<input name="kod" type="checkbox" class="formcheckbox" id="kod"<?php if(!$pconfig['kod']) echo " checked=\"checked\""; ?> /> <input name="kod" type="checkbox" class="formcheckbox" id="kod"<?php if(empty($pconfig['kod'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Enable Kiss-o'-death packets (default: enabled)."); ?> <?php echo gettext("Enable Kiss-o'-death packets (default: enabled)."); ?>
<br /> <br />
<input name="nomodify" type="checkbox" class="formcheckbox" id="nomodify"<?php if(!$pconfig['nomodify']) echo " checked=\"checked\""; ?> /> <input name="nomodify" type="checkbox" class="formcheckbox" id="nomodify"<?php if(empty($pconfig['nomodify'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Deny state modifications (i.e. run time configuration) by ntpq and ntpdc (default: enabled)."); ?> <?php echo gettext("Deny state modifications (i.e. run time configuration) by ntpq and ntpdc (default: enabled)."); ?>
<br /> <br />
<input name="noquery" type="checkbox" class="formcheckbox" id="noquery"<?php if($pconfig['noquery']) echo " checked=\"checked\""; ?> /> <input name="noquery" type="checkbox" class="formcheckbox" id="noquery"<?php if(!empty($pconfig['noquery'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Disable ntpq and ntpdc queries (default: disabled)."); ?> <?php echo gettext("Disable ntpq and ntpdc queries (default: disabled)."); ?>
<br /> <br />
<input name="noserve" type="checkbox" class="formcheckbox" id="noserve"<?php if($pconfig['noserve']) echo " checked=\"checked\""; ?> /> <input name="noserve" type="checkbox" class="formcheckbox" id="noserve"<?php if(!empty($pconfig['noserve'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Disable all except ntpq and ntpdc queries (default: disabled)."); ?> <?php echo gettext("Disable all except ntpq and ntpdc queries (default: disabled)."); ?>
<br /> <br />
<input name="nopeer" type="checkbox" class="formcheckbox" id="nopeer"<?php if(!$pconfig['nopeer']) echo " checked=\"checked\""; ?> /> <input name="nopeer" type="checkbox" class="formcheckbox" id="nopeer"<?php if(empty($pconfig['nopeer'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Deny packets that attempt a peer association (default: enabled)."); ?> <?php echo gettext("Deny packets that attempt a peer association (default: enabled)."); ?>
<br /> <br />
<input name="notrap" type="checkbox" class="formcheckbox" id="notrap"<?php if(!$pconfig['notrap']) echo " checked=\"checked\""; ?> /> <input name="notrap" type="checkbox" class="formcheckbox" id="notrap"<?php if(empty($pconfig['notrap'])) echo " checked=\"checked\""; ?> />
<?php echo gettext("Deny mode 6 control message trap service (default: enabled)."); ?> <?php echo gettext("Deny mode 6 control message trap service (default: enabled)."); ?>
</div> </div>
</td> </td>
...@@ -389,7 +391,7 @@ include("head.inc"); ...@@ -389,7 +391,7 @@ include("head.inc");
<?php echo gettext("Normally this is only useful if this server is a stratum 1 time server.");?> <?php echo gettext("Normally this is only useful if this server is a stratum 1 time server.");?>
<br /><br /> <br /><br />
<?php echo gettext("Enter Leap second configuration as text:");?><br /> <?php echo gettext("Enter Leap second configuration as text:");?><br />
<textarea name="leaptxt" class="formpre" id="leaptxt" cols="65" rows="7"><?php $text = base64_decode(chunk_split($pconfig['leapsec'])); echo $text;?></textarea><br /> <textarea name="leaptxt" class="formpre" id="leaptxt" cols="65" rows="7"><?php $text = base64_decode(chunk_split(isset($pconfig['leapsec'])?$pconfig['leapsec']:"")); echo $text;?></textarea><br />
<strong><?php echo gettext("Or");?></strong>, <?php echo gettext("select a file to upload:");?> <strong><?php echo gettext("Or");?></strong>, <?php echo gettext("select a file to upload:");?>
<input type="file" name="leapfile" class="formfld file" id="leapfile" /> <input type="file" name="leapfile" class="formfld file" id="leapfile" />
</div> </div>
......
...@@ -30,14 +30,13 @@ ...@@ -30,14 +30,13 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("services.inc"); require_once("services.inc");
require_once("system.inc"); require_once("system.inc");
require_once("interfaces.inc");
function set_default_gps() { function set_default_gps() {
global $config; global $config;
if (!is_array($config['ntpd'])) if (!isset($config['ntpd']) || !is_array($config['ntpd']))
$config['ntpd'] = array(); $config['ntpd'] = array();
if (is_array($config['ntpd']['gps']))
unset($config['ntpd']['gps']);
$config['ntpd']['gps'] = array(); $config['ntpd']['gps'] = array();
$config['ntpd']['gps']['type'] = 'Generic'; $config['ntpd']['gps']['type'] = 'Generic';
...@@ -143,7 +142,7 @@ if ($_POST) { ...@@ -143,7 +142,7 @@ if ($_POST) {
$savemsg = get_std_save_message($retval); $savemsg = get_std_save_message($retval);
} else { } else {
/* set defaults if they do not already exist */ /* set defaults if they do not already exist */
if (!is_array($config['ntpd']) || !is_array($config['ntpd']['gps']) || empty($config['ntpd']['gps']['type'])) { if (empty($config['ntpd']['gps']['type'])) {
set_default_gps(); set_default_gps();
} }
} }
...@@ -417,7 +416,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -417,7 +416,7 @@ SureGPS = #Sure Electronics SKG16B
<?php <?php
foreach ($serialports as $port): foreach ($serialports as $port):
$shortport = substr($port,5); $shortport = substr($port,5);
$selected = ($shortport == $pconfig['port']) ? " selected=\"selected\"" : ""; $selected = ($shortport == isset($pconfig['port'])?$pconfig['port']:null) ? " selected=\"selected\"" : "";
?> ?>
<option value="<?php echo $shortport;?>"<?php echo $selected;?>><?php echo $shortport;?></option> <option value="<?php echo $shortport;?>"<?php echo $selected;?>><?php echo $shortport;?></option>
<?php <?php
...@@ -427,12 +426,12 @@ SureGPS = #Sure Electronics SKG16B ...@@ -427,12 +426,12 @@ SureGPS = #Sure Electronics SKG16B
<?php echo gettext("All serial ports are listed, be sure to pick the port with the GPS attached."); ?> <?php echo gettext("All serial ports are listed, be sure to pick the port with the GPS attached."); ?>
<br /><br /> <br /><br />
<select id="gpsspeed" name="gpsspeed" class="formselect"> <select id="gpsspeed" name="gpsspeed" class="formselect">
<option value="0"<?php if(!$pconfig['speed']) echo " selected=\"selected\""; ?>>4800</option> <option value="0"<?php if(empty($pconfig['speed'])) echo " selected=\"selected\""; ?>>4800</option>
<option value="16"<?php if($pconfig['speed'] === '16') echo " selected=\"selected\"";?>>9600</option> <option value="16"<?php if(isset($pconfig['speed']) && $pconfig['speed'] === '16') echo " selected=\"selected\"";?>>9600</option>
<option value="32"<?php if($pconfig['speed'] === '32') echo " selected=\"selected\"";?>>19200</option> <option value="32"<?php if(isset($pconfig['speed']) && $pconfig['speed'] === '32') echo " selected=\"selected\"";?>>19200</option>
<option value="48"<?php if($pconfig['speed'] === '48') echo " selected=\"selected\"";?>>38400</option> <option value="48"<?php if(isset($pconfig['speed']) && $pconfig['speed'] === '48') echo " selected=\"selected\"";?>>38400</option>
<option value="64"<?php if($pconfig['speed'] === '64') echo " selected=\"selected\"";?>>57600</option> <option value="64"<?php if(isset($pconfig['speed']) && $pconfig['speed'] === '64') echo " selected=\"selected\"";?>>57600</option>
<option value="80"<?php if($pconfig['speed'] === '80') echo " selected=\"selected\"";?>>115200</option> <option value="80"<?php if(isset($pconfig['speed']) && $pconfig['speed'] === '80') echo " selected=\"selected\"";?>>115200</option>
</select>&nbsp;<?php echo gettext("Serial port baud rate."); ?> </select>&nbsp;<?php echo gettext("Serial port baud rate."); ?>
<br /> <br />
<br /> <br />
...@@ -447,11 +446,11 @@ SureGPS = #Sure Electronics SKG16B ...@@ -447,11 +446,11 @@ SureGPS = #Sure Electronics SKG16B
<td width="22%" valign="top" class="vncellreq">NMEA sentences</td> <td width="22%" valign="top" class="vncellreq">NMEA sentences</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<select id="gpsnmea" name="gpsnmea[]" multiple="multiple" class="formselect" size="5"> <select id="gpsnmea" name="gpsnmea[]" multiple="multiple" class="formselect" size="5">
<option value="0"<?php if(!$pconfig['nmea']) echo " selected=\"selected\""; ?>>All</option> <option value="0"<?php if(empty($pconfig['nmea'])) echo " selected=\"selected\""; ?>>All</option>
<option value="1"<?php if($pconfig['nmea'] & 1) echo " selected=\"selected\"";?>>RMC</option> <option value="1"<?php if(isset($pconfig['nmea']) && $pconfig['nmea'] & 1) echo " selected=\"selected\"";?>>RMC</option>
<option value="2"<?php if($pconfig['nmea'] & 2) echo " selected=\"selected\"";?>>GGA</option> <option value="2"<?php if(isset($pconfig['nmea']) && $pconfig['nmea'] & 2) echo " selected=\"selected\"";?>>GGA</option>
<option value="4"<?php if($pconfig['nmea'] & 4) echo " selected=\"selected\"";?>>GLL</option> <option value="4"<?php if(isset($pconfig['nmea']) && $pconfig['nmea'] & 4) echo " selected=\"selected\"";?>>GLL</option>
<option value="8"<?php if($pconfig['nmea'] & 8) echo " selected=\"selected\"";?>>ZDA or ZDG</option> <option value="8"<?php if(isset($pconfig['nmea']) && $pconfig['nmea'] & 8) echo " selected=\"selected\"";?>>ZDA or ZDG</option>
</select><br /> </select><br />
<?php echo gettext("By default NTP will listen for all supported NMEA sentences. Here one or more sentences to listen for may be specified."); ?> <?php echo gettext("By default NTP will listen for all supported NMEA sentences. Here one or more sentences to listen for may be specified."); ?>
</td> </td>
...@@ -459,19 +458,19 @@ SureGPS = #Sure Electronics SKG16B ...@@ -459,19 +458,19 @@ SureGPS = #Sure Electronics SKG16B
<tr> <tr>
<td width="22%" valign="top" class="vncellreq">Fudge time 1</td> <td width="22%" valign="top" class="vncellreq">Fudge time 1</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="gpsfudge1" type="text" class="formfld unknown" id="gpsfudge1" min="-1" max="1" size="20" value="<?=htmlspecialchars($pconfig['fudge1']);?>" />(<?php echo gettext("seconds");?>)<br /> <input name="gpsfudge1" type="text" class="formfld unknown" id="gpsfudge1" min="-1" max="1" size="20" value="<?=htmlspecialchars(isset($pconfig['fudge1'])?$pconfig['fudge1']:"");?>" />(<?php echo gettext("seconds");?>)<br />
<?php echo gettext("Fudge time 1 is used to specify the GPS PPS signal offset");?> (<?php echo gettext("default");?>: 0.0).</td> <?php echo gettext("Fudge time 1 is used to specify the GPS PPS signal offset");?> (<?php echo gettext("default");?>: 0.0).</td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq">Fudge time 2</td> <td width="22%" valign="top" class="vncellreq">Fudge time 2</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="gpsfudge2" type="text" class="formfld unknown" id="gpsfudge2" min="-1" max="1" size="20" value="<?=htmlspecialchars($pconfig['fudge2']);?>" />(<?php echo gettext("seconds");?>)<br /> <input name="gpsfudge2" type="text" class="formfld unknown" id="gpsfudge2" min="-1" max="1" size="20" value="<?=htmlspecialchars(isset($pconfig['fudge2'])?$pconfig['fudge2']:"");?>" />(<?php echo gettext("seconds");?>)<br />
<?php echo gettext("Fudge time 2 is used to specify the GPS time offset");?> (<?php echo gettext("default");?>: 0.0).</td> <?php echo gettext("Fudge time 2 is used to specify the GPS time offset");?> (<?php echo gettext("default");?>: 0.0).</td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq">Stratum</td> <td width="22%" valign="top" class="vncellreq">Stratum</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="gpsstratum" type="text" class="formfld unknown" id="gpsstratum" max="16" size="20" value="<?=htmlspecialchars($pconfig['stratum']);?>" /><?php echo gettext("(0-16)");?><br /> <input name="gpsstratum" type="text" class="formfld unknown" id="gpsstratum" max="16" size="20" value="<?=htmlspecialchars(isset($pconfig['stratum'])?$pconfig['stratum']:"");?>" /><?php echo gettext("(0-16)");?><br />
<?php echo gettext("This may be used to change the GPS Clock stratum");?> (<?php echo gettext("default");?>: 0). <?php echo gettext("This may be useful if, for some reason, you want ntpd to prefer a different clock"); ?></td> <?php echo gettext("This may be used to change the GPS Clock stratum");?> (<?php echo gettext("default");?>: 0). <?php echo gettext("This may be useful if, for some reason, you want ntpd to prefer a different clock"); ?></td>
</tr> </tr>
<tr> <tr>
...@@ -487,7 +486,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -487,7 +486,7 @@ SureGPS = #Sure Electronics SKG16B
<table> <table>
<tr> <tr>
<td> <td>
<input name="gpsprefer" type="checkbox" class="formcheckbox" id="gpsprefer" onclick="ToggleOther('gpsprefer', 'gpsselect')"<?php if(!$pconfig['prefer']) echo " checked=\"checked\""; ?> /> <input name="gpsprefer" type="checkbox" class="formcheckbox" id="gpsprefer" onclick="ToggleOther('gpsprefer', 'gpsselect')"<?php if(empty($pconfig['prefer'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("NTP should prefer this clock (default: enabled)."); ?></span> <span class="vexpl"><?php echo gettext("NTP should prefer this clock (default: enabled)."); ?></span>
...@@ -495,7 +494,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -495,7 +494,7 @@ SureGPS = #Sure Electronics SKG16B
</tr> </tr>
<tr> <tr>
<td> <td>
<input name="gpsselect" type="checkbox" class="formcheckbox" id="gpsselect" onclick="ToggleOther('gpsselect', 'gpsprefer')"<?php if($pconfig['noselect']) echo " checked=\"checked\""; ?> /> <input name="gpsselect" type="checkbox" class="formcheckbox" id="gpsselect" onclick="ToggleOther('gpsselect', 'gpsprefer')"<?php if(!empty($pconfig['noselect'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("NTP should not use this clock, it will be displayed for reference only(default: disabled)."); ?></span> <span class="vexpl"><?php echo gettext("NTP should not use this clock, it will be displayed for reference only(default: disabled)."); ?></span>
...@@ -503,7 +502,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -503,7 +502,7 @@ SureGPS = #Sure Electronics SKG16B
</tr> </tr>
<tr> <tr>
<td> <td>
<input name="gpsflag1" type="checkbox" class="formcheckbox" id="gpsflag1"<?php if($pconfig['flag1']) echo " checked=\"checked\""; ?> /> <input name="gpsflag1" type="checkbox" class="formcheckbox" id="gpsflag1"<?php if(!empty($pconfig['flag1'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("Enable PPS signal processing (default: enabled)."); ?></span> <span class="vexpl"><?php echo gettext("Enable PPS signal processing (default: enabled)."); ?></span>
...@@ -511,7 +510,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -511,7 +510,7 @@ SureGPS = #Sure Electronics SKG16B
</tr> </tr>
<tr> <tr>
<td> <td>
<input name="gpsflag2" type="checkbox" class="formcheckbox" id="gpsflag2"<?php if($pconfig['flag2']) echo " checked=\"checked\""; ?> /> <input name="gpsflag2" type="checkbox" class="formcheckbox" id="gpsflag2"<?php if(!empty($pconfig['flag2'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("Enable falling edge PPS signal processing (default: rising edge)."); ?></span> <span class="vexpl"><?php echo gettext("Enable falling edge PPS signal processing (default: rising edge)."); ?></span>
...@@ -519,7 +518,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -519,7 +518,7 @@ SureGPS = #Sure Electronics SKG16B
</tr> </tr>
<tr> <tr>
<td> <td>
<input name="gpsflag3" type="checkbox" class="formcheckbox" id="gpsflag3"<?php if($pconfig['flag3']) echo " checked=\"checked\""; ?> /> <input name="gpsflag3" type="checkbox" class="formcheckbox" id="gpsflag3"<?php if(!empty($pconfig['flag3'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("Enable kernel PPS clock discipline (default: enabled)."); ?></span> <span class="vexpl"><?php echo gettext("Enable kernel PPS clock discipline (default: enabled)."); ?></span>
...@@ -527,7 +526,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -527,7 +526,7 @@ SureGPS = #Sure Electronics SKG16B
</tr> </tr>
<tr> <tr>
<td> <td>
<input name="gpsflag4" type="checkbox" class="formcheckbox" id="gpsflag4"<?php if($pconfig['flag4']) echo " checked=\"checked\""; ?> /> <input name="gpsflag4" type="checkbox" class="formcheckbox" id="gpsflag4"<?php if(!empty($pconfig['flag4'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("Obscure location in timestamp (default: unobscured)."); ?></span> <span class="vexpl"><?php echo gettext("Obscure location in timestamp (default: unobscured)."); ?></span>
...@@ -535,7 +534,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -535,7 +534,7 @@ SureGPS = #Sure Electronics SKG16B
</tr> </tr>
<tr> <tr>
<td> <td>
<input name="gpssubsec" type="checkbox" class="formcheckbox" id="gpssubsec"<?php if($pconfig['subsec']) echo " checked=\"checked\""; ?> /> <input name="gpssubsec" type="checkbox" class="formcheckbox" id="gpssubsec"<?php if(!empty($pconfig['subsec'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("Log the sub-second fraction of the received time stamp (default: Not logged).<br />Note: enabling this will rapidly fill the log, but is useful for tuning Fudge time 2."); ?></span> <span class="vexpl"><?php echo gettext("Log the sub-second fraction of the received time stamp (default: Not logged).<br />Note: enabling this will rapidly fill the log, but is useful for tuning Fudge time 2."); ?></span>
...@@ -547,7 +546,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -547,7 +546,7 @@ SureGPS = #Sure Electronics SKG16B
<tr> <tr>
<td width="22%" valign="top" class="vncellreq">Clock ID</td> <td width="22%" valign="top" class="vncellreq">Clock ID</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="gpsrefid" type="text" class="formfld unknown" id="gpsrefid" maxlength= "4" size="20" value="<?=htmlspecialchars($pconfig['refid']);?>" /><?php echo gettext("(1 to 4 charactors)");?><br /> <input name="gpsrefid" type="text" class="formfld unknown" id="gpsrefid" maxlength= "4" size="20" value="<?=htmlspecialchars(isset($pconfig['refid'])?$pconfig['refid']:"");?>" /><?php echo gettext("(1 to 4 charactors)");?><br />
<?php echo gettext("This may be used to change the GPS Clock ID");?> (<?php echo gettext("default");?>: GPS).</td> <?php echo gettext("This may be used to change the GPS Clock ID");?> (<?php echo gettext("default");?>: GPS).</td>
</tr> </tr>
<tr> <tr>
...@@ -558,7 +557,7 @@ SureGPS = #Sure Electronics SKG16B ...@@ -558,7 +557,7 @@ SureGPS = #Sure Electronics SKG16B
</div> </div>
<div id="showgpsinit" style="display:none"> <div id="showgpsinit" style="display:none">
<p> <p>
<textarea name="gpsinitcmd" class="formpre" id="gpsinitcmd" cols="65" rows="7"><?=htmlspecialchars(base64_decode($pconfig['initcmd'])); /*resultmatch*/?></textarea><br /> <textarea name="gpsinitcmd" class="formpre" id="gpsinitcmd" cols="65" rows="7"><?=htmlspecialchars(base64_decode(isset($pconfig['initcmd'])?$pconfig['initcmd']:"")); /*resultmatch*/?></textarea><br />
<?php echo gettext("Note: Commands entered here will be sent to the GPS during initialization. Please read and understand your GPS documentation before making any changes here.");?><br /><br /> <?php echo gettext("Note: Commands entered here will be sent to the GPS during initialization. Please read and understand your GPS documentation before making any changes here.");?><br /><br />
<strong><?php echo gettext("NMEA checksum calculator");?>:</strong> <strong><?php echo gettext("NMEA checksum calculator");?>:</strong>
<br /> <br />
......
...@@ -29,63 +29,62 @@ ...@@ -29,63 +29,62 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("services.inc"); require_once("services.inc");
require_once("system.inc"); require_once("system.inc");
require_once("interfaces.inc");
if (!is_array($config['ntpd'])) if (!isset($config['ntpd']) || !is_array($config['ntpd']))
$config['ntpd'] = array(); $config['ntpd'] = array();
if (!is_array($config['ntpd']['pps'])) if (!isset($config['ntpd']['pps']))
$config['ntpd']['pps'] = array(); $config['ntpd']['pps'] = array();
if ($_POST) { if ($_POST) {
unset($input_errors); unset($input_errors);
if (!$input_errors) { if (!empty($_POST['ppsport']) && file_exists('/dev/'.$_POST['ppsport']))
if (!empty($_POST['ppsport']) && file_exists('/dev/'.$_POST['ppsport'])) $config['ntpd']['pps']['port'] = $_POST['ppsport'];
$config['ntpd']['pps']['port'] = $_POST['ppsport']; /* if port is not set, remove all the pps config */
/* if port is not set, remove all the pps config */ else unset($config['ntpd']['pps']);
else unset($config['ntpd']['pps']);
if (!empty($_POST['ppsfudge1']))
if (!empty($_POST['ppsfudge1'])) $config['ntpd']['pps']['fudge1'] = $_POST['ppsfudge1'];
$config['ntpd']['pps']['fudge1'] = $_POST['ppsfudge1']; elseif (isset($config['ntpd']['pps']['fudge1']))
elseif (isset($config['ntpd']['pps']['fudge1'])) unset($config['ntpd']['pps']['fudge1']);
unset($config['ntpd']['pps']['fudge1']);
if (!empty($_POST['ppsstratum']) && ($_POST['ppsstratum']) < 17 )
if (!empty($_POST['ppsstratum']) && ($_POST['ppsstratum']) < 17 ) $config['ntpd']['pps']['stratum'] = $_POST['ppsstratum'];
$config['ntpd']['pps']['stratum'] = $_POST['ppsstratum']; elseif (isset($config['ntpd']['pps']['stratum']))
elseif (isset($config['ntpd']['pps']['stratum'])) unset($config['ntpd']['pps']['stratum']);
unset($config['ntpd']['pps']['stratum']);
if (!empty($_POST['ppsselect']))
if (!empty($_POST['ppsselect'])) $config['ntpd']['pps']['noselect'] = $_POST['ppsselect'];
$config['ntpd']['pps']['noselect'] = $_POST['ppsselect']; elseif (isset($config['ntpd']['pps']['noselect']))
elseif (isset($config['ntpd']['pps']['noselect'])) unset($config['ntpd']['pps']['noselect']);
unset($config['ntpd']['pps']['noselect']);
if (!empty($_POST['ppsflag2']))
if (!empty($_POST['ppsflag2'])) $config['ntpd']['pps']['flag2'] = $_POST['ppsflag2'];
$config['ntpd']['pps']['flag2'] = $_POST['ppsflag2']; elseif (isset($config['ntpd']['pps']['flag2']))
elseif (isset($config['ntpd']['pps']['flag2'])) unset($config['ntpd']['pps']['flag2']);
unset($config['ntpd']['pps']['flag2']);
if (!empty($_POST['ppsflag3']))
if (!empty($_POST['ppsflag3'])) $config['ntpd']['pps']['flag3'] = $_POST['ppsflag3'];
$config['ntpd']['pps']['flag3'] = $_POST['ppsflag3']; elseif (isset($config['ntpd']['pps']['flag3']))
elseif (isset($config['ntpd']['pps']['flag3'])) unset($config['ntpd']['pps']['flag3']);
unset($config['ntpd']['pps']['flag3']);
if (!empty($_POST['ppsflag4']))
if (!empty($_POST['ppsflag4'])) $config['ntpd']['pps']['flag4'] = $_POST['ppsflag4'];
$config['ntpd']['pps']['flag4'] = $_POST['ppsflag4']; elseif (isset($config['ntpd']['pps']['flag4']))
elseif (isset($config['ntpd']['pps']['flag4'])) unset($config['ntpd']['pps']['flag4']);
unset($config['ntpd']['pps']['flag4']);
if (!empty($_POST['ppsrefid']))
if (!empty($_POST['ppsrefid'])) $config['ntpd']['pps']['refid'] = $_POST['ppsrefid'];
$config['ntpd']['pps']['refid'] = $_POST['ppsrefid']; elseif (isset($config['ntpd']['pps']['refid']))
elseif (isset($config['ntpd']['pps']['refid'])) unset($config['ntpd']['pps']['refid']);
unset($config['ntpd']['pps']['refid']);
write_config("Updated NTP PPS Settings");
write_config("Updated NTP PPS Settings");
$retval = 0;
$retval = 0; $retval = system_ntp_configure();
$retval = system_ntp_configure(); $savemsg = get_std_save_message($retval);
$savemsg = get_std_save_message($retval);
}
} }
$pconfig = &$config['ntpd']['pps']; $pconfig = &$config['ntpd']['pps'];
...@@ -143,7 +142,7 @@ include("head.inc"); ...@@ -143,7 +142,7 @@ include("head.inc");
<option value="">none</option> <option value="">none</option>
<?php foreach ($serialports as $port): <?php foreach ($serialports as $port):
$shortport = substr($port,5); $shortport = substr($port,5);
$selected = ($shortport == $pconfig['port']) ? " selected=\"selected\"" : "";?> $selected = ($shortport == isset($pconfig['port'])?$pconfig['port']:null) ? " selected=\"selected\"" : "";?>
<option value="<?php echo $shortport;?>"<?php echo $selected;?>><?php echo $shortport;?></option> <option value="<?php echo $shortport;?>"<?php echo $selected;?>><?php echo $shortport;?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select>&nbsp; </select>&nbsp;
...@@ -154,13 +153,13 @@ include("head.inc"); ...@@ -154,13 +153,13 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq">Fudge time</td> <td width="22%" valign="top" class="vncellreq">Fudge time</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="ppsfudge1" type="text" class="formfld unknown" id="ppsfudge1" min="-1" max="1" size="20" value="<?=htmlspecialchars($pconfig['fudge1']);?>" />(<?php echo gettext("seconds");?>)<br /> <input name="ppsfudge1" type="text" class="formfld unknown" id="ppsfudge1" min="-1" max="1" size="20" value="<?=htmlspecialchars(isset($pconfig['fudge1'])?$pconfig['fudge1']:"");?>" />(<?php echo gettext("seconds");?>)<br />
<?php echo gettext("Fudge time is used to specify the PPS signal offset from the actual second such as the transmission delay between the transmitter and the receiver.");?> (<?php echo gettext("default");?>: 0.0).</td> <?php echo gettext("Fudge time is used to specify the PPS signal offset from the actual second such as the transmission delay between the transmitter and the receiver.");?> (<?php echo gettext("default");?>: 0.0).</td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq">Stratum</td> <td width="22%" valign="top" class="vncellreq">Stratum</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="ppsstratum" type="text" class="formfld unknown" id="ppsstratum" max="16" size="20" value="<?=htmlspecialchars($pconfig['stratum']);?>" /><?php echo gettext("(0-16)");?><br /> <input name="ppsstratum" type="text" class="formfld unknown" id="ppsstratum" max="16" size="20" value="<?=htmlspecialchars(isset($pconfig['stratum'])?$pconfig['stratum']:"");?>" /><?php echo gettext("(0-16)");?><br />
<?php echo gettext("This may be used to change the PPS Clock stratum");?> (<?php echo gettext("default");?>: 0). <?php echo gettext("This may be useful if, for some reason, you want ntpd to prefer a different clock and just monitor this source."); ?></td> <?php echo gettext("This may be used to change the PPS Clock stratum");?> (<?php echo gettext("default");?>: 0). <?php echo gettext("This may be useful if, for some reason, you want ntpd to prefer a different clock and just monitor this source."); ?></td>
</tr> </tr>
<tr> <tr>
...@@ -176,7 +175,7 @@ include("head.inc"); ...@@ -176,7 +175,7 @@ include("head.inc");
<table> <table>
<tr> <tr>
<td> <td>
<input name="ppsflag2" type="checkbox" class="formcheckbox" id="ppsflag2"<?php if($pconfig['flag2']) echo " checked=\"checked\""; ?> /> <input name="ppsflag2" type="checkbox" class="formcheckbox" id="ppsflag2"<?php if(!empty($pconfig['flag2'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("Enable falling edge PPS signal processing (default: rising edge)."); ?></span> <span class="vexpl"><?php echo gettext("Enable falling edge PPS signal processing (default: rising edge)."); ?></span>
...@@ -184,7 +183,7 @@ include("head.inc"); ...@@ -184,7 +183,7 @@ include("head.inc");
</tr> </tr>
<tr> <tr>
<td> <td>
<input name="ppsflag3" type="checkbox" class="formcheckbox" id="ppsflag3"<?php if($pconfig['flag3']) echo " checked=\"checked\""; ?> /> <input name="ppsflag3" type="checkbox" class="formcheckbox" id="ppsflag3"<?php if(!empty($pconfig['flag3'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("Enable kernel PPS clock discipline (default: disabled)."); ?></span> <span class="vexpl"><?php echo gettext("Enable kernel PPS clock discipline (default: disabled)."); ?></span>
...@@ -192,7 +191,7 @@ include("head.inc"); ...@@ -192,7 +191,7 @@ include("head.inc");
</tr> </tr>
<tr> <tr>
<td> <td>
<input name="ppsflag4" type="checkbox" class="formcheckbox" id="ppsflag4"<?php if($pconfig['flag4']) echo " checked=\"checked\""; ?> /> <input name="ppsflag4" type="checkbox" class="formcheckbox" id="ppsflag4"<?php if(!empty($pconfig['flag4'])) echo " checked=\"checked\""; ?> />
</td> </td>
<td> <td>
<span class="vexpl"><?php echo gettext("Record a timestamp once for each second, useful for constructing Allan deviation plots (default: disabled)."); ?></span> <span class="vexpl"><?php echo gettext("Record a timestamp once for each second, useful for constructing Allan deviation plots (default: disabled)."); ?></span>
...@@ -204,7 +203,7 @@ include("head.inc"); ...@@ -204,7 +203,7 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq">Clock ID</td> <td width="22%" valign="top" class="vncellreq">Clock ID</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="ppsrefid" type="text" class="formfld unknown" id="ppsrefid" maxlength= "4" size="20" value="<?php htmlspecialchars($pconfig['refid']);?>" /><?php echo gettext("(1 to 4 charactors)");?><br /> <input name="ppsrefid" type="text" class="formfld unknown" id="ppsrefid" maxlength= "4" size="20" value="<?php htmlspecialchars(isset($pconfig['refid'])?$pconfig['refid']:"");?>" /><?php echo gettext("(1 to 4 charactors)");?><br />
<?php echo gettext("This may be used to change the PPS Clock ID");?> (<?php echo gettext("default");?>: PPS).</td> <?php echo gettext("This may be used to change the PPS Clock ID");?> (<?php echo gettext("default");?>: PPS).</td>
</tr> </tr>
<tr> <tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment