summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/diag_logs_filter.php69
-rwxr-xr-xusr/local/www/interfaces.php10
-rwxr-xr-xusr/local/www/pkg_mgr.php2
-rwxr-xr-xusr/local/www/pkg_mgr_install.php260
-rw-r--r--usr/local/www/services_ntpd.php359
-rw-r--r--usr/local/www/status_rrd_graph_img.php10
-rwxr-xr-xusr/local/www/system.php5
-rw-r--r--usr/local/www/system_authservers.php8
-rw-r--r--usr/local/www/system_certmanager.php10
-rw-r--r--usr/local/www/wizards/setup_wizard.xml4
10 files changed, 551 insertions, 186 deletions
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php
index e4cf996..0daefcf 100755
--- a/usr/local/www/diag_logs_filter.php
+++ b/usr/local/www/diag_logs_filter.php
@@ -46,6 +46,20 @@
require("guiconfig.inc");
require_once("filter_log.inc");
+# --- AJAX RESOLVE ---
+if (isset($_POST['resolve'])) {
+ $ip = strtolower($_POST['resolve']);
+ $res = (is_ipaddr($ip) ? gethostbyaddr($ip) : '');
+
+ if ($res && $res != $ip)
+ $response = array('resolve_ip' => $ip, 'resolve_text' => $res);
+ else
+ $response = array('resolve_ip' => $ip, 'resolve_text' => gettext("Cannot resolve"));
+
+ echo json_encode(str_replace("\\","\\\\", $response)); // single escape chars can break JSON decode
+ exit;
+}
+
function getGETPOSTsettingvalue($settingname, $default)
{
$settingvalue = $default;
@@ -351,25 +365,21 @@ include("head.inc");
}
$srcstr = $filterent['srcip'] . get_port_with_service($filterent['srcport'], $proto);
+ $src_htmlclass = str_replace(array('.', ':'), '-', $filterent['srcip']);
$dststr = $filterent['dstip'] . get_port_with_service($filterent['dstport'], $proto);
+ $dst_htmlclass = str_replace(array('.', ':'), '-', $filterent['dstip']);
?>
<td class="listMRr nowrap">
- <a onclick="javascript:getURL('diag_dns.php?host=<?php echo "{$filterent['srcip']}"; ?>&amp;dialog_output=true', outputrule);" title="<?=gettext("Reverse Resolve with DNS");?>">
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log_d.gif" alt="Icon Reverse Resolve with DNS"/></a>
- <a href="diag_dns.php?host=<?php echo $filterent['srcip']; ?>" title="<?=gettext("Reverse Resolve with DNS");?>">
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/></a>
+ <img onclick="javascript:resolve_with_ajax('<?php echo "{$filterent['srcip']}"; ?>');" title="<?=gettext("Click to resolve");?>" class="ICON-<?= $src_htmlclass; ?>" border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/>
<a href="easyrule.php?<?php echo "action=block&amp;int={$int}&amp;src={$filterent['srcip']}&amp;ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Add to Block List");?>" onclick="return confirm('<?=gettext("Do you really want to add this BLOCK rule?")."\n\n".gettext("Easy Rule is still experimental.")."\n".gettext("Continue at risk of your own peril.")."\n".gettext("Backups are also nice.")?>')">
<img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_block_add.gif" alt="Icon Easy Rule: Add to Block List" /></a>
- <?php echo $srcstr;?>
+ <?php echo $srcstr . '<span class="RESOLVE-' . $src_htmlclass . '"></span>';?>
</td>
<td class="listMRr nowrap">
- <a onclick="javascript:getURL('diag_dns.php?host=<?php echo "{$filterent['dstip']}"; ?>&amp;dialog_output=true', outputrule);" title="<?=gettext("Reverse Resolve with DNS");?>">
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log_d.gif" alt="Icon Reverse Resolve with DNS" /></a>
- <a href="diag_dns.php?host=<?php echo $filterent['dstip']; ?>" title="<?=gettext("Reverse Resolve with DNS");?>">
- <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS" /></a>
+ <img onclick="javascript:resolve_with_ajax('<?php echo "{$filterent['dstip']}"; ?>');" title="<?=gettext("Click to resolve");?>" class="ICON-<?= $dst_htmlclass; ?>" border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/>
<a href="easyrule.php?<?php echo "action=pass&amp;int={$int}&amp;proto={$proto}&amp;src={$filterent['srcip']}&amp;dst={$filterent['dstip']}&amp;dstport={$filterent['dstport']}&amp;ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Pass this traffic");?>" onclick="return confirm('<?=gettext("Do you really want to add this PASS rule?")."\n\n".gettext("Easy Rule is still experimental.")."\n".gettext("Continue at risk of your own peril.")."\n".gettext("Backups are also nice.");?>')">
<img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_pass_add.gif" alt="Icon Easy Rule: Pass this traffic" /></a>
- <?php echo $dststr;?>
+ <?php echo $dststr . '<span class="RESOLVE-' . $dst_htmlclass . '"></span>';?>
</td>
<?php
if ($filterent['proto'] == "TCP")
@@ -415,5 +425,44 @@ include("head.inc");
<p><span class="vexpl"><a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F">TCP Flags</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, W - CWR</span></p>
<?php include("fend.inc"); ?>
+
+<!-- AJAXY STUFF -->
+<script type="text/javascript">
+
+function resolve_with_ajax(ip_to_resolve) {
+ var url = "/diag_logs_filter.php";
+
+ jQuery.ajax(
+ url,
+ {
+ type: 'post',
+ dataType: 'json',
+ data: {
+ resolve: ip_to_resolve,
+ },
+ complete: resolve_ip_callback
+ });
+
+}
+
+function resolve_ip_callback(transport) {
+ var response = jQuery.parseJSON(transport.responseText);
+ var resolve_class = htmlspecialchars(response.resolve_ip.replace(/[.:]/g, '-'));
+ var resolve_text = '<small><br/>' + htmlspecialchars(response.resolve_text) + '</small>';
+
+ jQuery('span.RESOLVE-' + resolve_class).html(resolve_text);
+ jQuery('img.ICON-' + resolve_class).removeAttr('title');
+ jQuery('img.ICON-' + resolve_class).removeAttr('alt');
+ jQuery('img.ICON-' + resolve_class).attr('src', '/themes/<?= $g['theme']; ?>/images/icons/icon_log_d.gif');
+ jQuery('img.ICON-' + resolve_class).prop('onclick', null);
+ // jQuery cautions that "removeAttr('onclick')" fails in some versions of IE
+}
+
+// From http://stackoverflow.com/questions/5499078/fastest-method-to-escape-html-tags-as-html-entities
+function htmlspecialchars(str) {
+ return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;');
+}
+</script>
+
</body>
</html>
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index 83fc745..db66071 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -1712,7 +1712,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Gateway"); ?></td>
+ <td width="22%" valign="top" class="vncell"><?=gettext("IPv4 Upstream Gateway"); ?></td>
<td width="78%" class="vtable">
<select name="gateway" class="formselect" id="gateway">
<option value="none" selected="selected"><?=gettext("None"); ?></option>
@@ -1733,7 +1733,8 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
- or <strong><a onclick="show_add_gateway();" href="#gatewaysection"><?=gettext("add a new one."); ?></a></strong>
<br/>
<div id='addgwbox'>
- <?=gettext("If this interface is an Internet connection, select an existing Gateway from the list or add one using the link above"); ?>
+ <?=gettext("If this interface is an Internet connection, select an existing Gateway from the list or add a new one using the link above."); ?><br/>
+ <?=gettext("On local LANs the upstream gateway should be \"none\"."); ?>
</div>
<div id='notebox'>
</div>
@@ -1817,7 +1818,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Gateway IPv6"); ?></td>
+ <td width="22%" valign="top" class="vncell"><?=gettext("IPv6 Upstream Gateway"); ?></td>
<td width="78%" class="vtable">
<select name="gatewayv6" class="formselect" id="gatewayv6">
<option value="none" selected="selected"><?=gettext("None"); ?></option>
@@ -1838,7 +1839,8 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
- or <strong><a onclick="show_add_gateway_v6();" href="#gatewayv6section"><?=gettext("add a new one."); ?></a></strong>
<br/>
<div id='addgwboxv6'>
- <?=gettext("If this interface is an Internet connection, select an existing Gateway from the list or add a new one using the link above"); ?>
+ <?=gettext("If this interface is an Internet connection, select an existing Gateway from the list or add a new one using the link above."); ?><br/>
+ <?=gettext("On local LANs the upstream gateway should be \"none\"."); ?>
</div>
<div id='noteboxv6'>
</div>
diff --git a/usr/local/www/pkg_mgr.php b/usr/local/www/pkg_mgr.php
index 1773021..dea82b8 100755
--- a/usr/local/www/pkg_mgr.php
+++ b/usr/local/www/pkg_mgr.php
@@ -255,7 +255,7 @@ include("head.inc");
?>
</td>
<td valign="middle" class="list nowrap" width="17">
- <a onclick="return confirm('<?=gettext("Do you really want to install ".ucfirst($index['name'])." package?"); ?>')" href="pkg_mgr_install.php?id=<?=$index['name'];?>"><img <?=domTT_title(gettext("Install ".ucfirst($index['name'])." package."))?> src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a>
+ <a href="pkg_mgr_install.php?id=<?=$index['name'];?>"><img <?=domTT_title(gettext("Install ".ucfirst($index['name'])." package."))?> src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a>
</td></tr>
<?php
endif;
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php
index 289505c..79bb9f2 100755
--- a/usr/local/www/pkg_mgr_install.php
+++ b/usr/local/www/pkg_mgr_install.php
@@ -48,6 +48,8 @@ require_once("filter.inc");
require_once("shaper.inc");
require_once("pkg-utils.inc");
+global $static_output;
+
$static_output = "";
$static_status = "";
$sendto = "output";
@@ -55,6 +57,33 @@ $sendto = "output";
$pgtitle = array(gettext("System"),gettext("Package Manager"),gettext("Install Package"));
include("head.inc");
+if ($_POST) {
+ if (isset($_POST['pkgcancel']) || (empty($_POST['id']) && $_POST['mode'] != 'reinstallall')) {
+ header("Location: pkg_mgr_installed.php");
+ return;
+ }
+} else if ($_GET) {
+ switch ($_GET['mode']) {
+ case 'showlog':
+ break;
+ case 'installedinfo':
+ case 'reinstallxml':
+ case 'reinstallpkg':
+ case 'delete':
+ if (empty($_GET['pkg'])) {
+ header("Location: pkg_mgr_installed.php");
+ return;
+ }
+ break;
+ default:
+ if (empty($_GET['id'])) {
+ header("Location: pkg_mgr_installed.php");
+ return;
+ }
+ break;
+ }
+}
+
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
@@ -65,17 +94,53 @@ include("head.inc");
<tr>
<td>
<?php
-// $version = file_get_contents("/etc/version");
$tab_array = array();
$tab_array[] = array(gettext("Available packages"), false, "pkg_mgr.php");
-// $tab_array[] = array("Packages for any platform", false, "pkg_mgr.php?ver=none");
-// $tab_array[] = array("Packages for a different platform", $requested_version == "other" ? true : false, "pkg_mgr.php?ver=other");
$tab_array[] = array(gettext("Installed packages"), false, "pkg_mgr_installed.php");
$tab_array[] = array(gettext("Package Installer"), true, "");
display_top_tabs($tab_array);
?>
</td>
</tr>
+<?php if ((empty($_GET['mode']) && $_GET['id']) || (!empty($_GET['mode']) && (!empty($_GET['pkg']) || $_GET['mode'] == 'reinstallall') && ($_GET['mode'] != 'installedinfo' && $_GET['mode'] != 'showlog'))):
+ if (empty($_GET['mode']) && $_GET['id']) {
+ $pkgname = str_replace(array("<", ">", ";", "&", "'", '"'), "", htmlspecialchars_decode($_GET['id'], ENT_QUOTES | ENT_HTML401));
+ $pkgmode = 'installed';
+ } else if (!empty($_GET['mode']) && !empty($_GET['pkg'])) {
+ $pkgname = str_replace(array("<", ">", ";", "&", "'", '"'), "", htmlspecialchars_decode($_GET['pkg'], ENT_QUOTES | ENT_HTML401));
+ $pkgmode = str_replace(array("<", ">", ";", "&", "'", '"'), "", htmlspecialchars_decode($_GET['mode'], ENT_QUOTES | ENT_HTML401));
+ }
+ switch ($pkgmode) {
+ case 'reinstallxml':
+ case 'reinstallpkg':
+ $pkgtxt = 'reinstalled';
+ break;
+ case 'delete':
+ $pkgtxt = 'deleted';
+ break;
+ default:
+ $pkgtxt = $pkgmode;
+ break;
+ }
+?>
+ <tr>
+ <td class="tabcont" align="center">
+ <table style="height:15;colspacing:0" width="420" border="0" cellpadding="0" cellspacing="0" summary="images">
+ <tr>
+ <td class="tabcont" align="center">Package:<b><?=$pkgname;?></b> will be <?=$pkgtxt;?>.<br/>
+ Please confirm the action on this package.<br/>
+ </td>
+ <td class="tabcont" align="center">
+ <input type="hidden" name="id" value="<?=$pkgname;?>" />
+ <input type="hidden" name="mode" value="<?=$pkgmode;?>" />
+ <input type="submit" name="pkgconfirm" id="pkgconfirm" value="Confirm"/>
+ <input type="submit" name="pkgcancel" id="pkgcancel" value="Cancel"/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+<?php endif; if (!empty($_POST['id']) || $_GET['mode'] == 'showlog' || ($_GET['mode'] == 'installedinfo' && !empty($_GET['pkg']))): ?>
<tr>
<td class="tabcont" align="center">
<table style="height:15;colspacing:0" width="420" border="0" cellpadding="0" cellspacing="0" summary="images">
@@ -99,6 +164,7 @@ include("head.inc");
<textarea cols="80" rows="35" name="output" id="output" wrap="hard"></textarea>
</td>
</tr>
+<?php endif; ?>
</table>
</div>
</form>
@@ -114,112 +180,112 @@ Rounded("div#mainareapkg","bl br","#FFF","#eeeeee","smooth");
ob_flush();
-$pkgname = str_replace(array("<", ">", ";", "&", "'"), "", htmlspecialchars_decode($_GET['pkg']));
-switch($_GET['mode']) {
- case "showlog":
- case "installedinfo":
- /* These cases do not make changes. */
- $fs_mounted_rw = false;
- break;
- default:
- /* All other cases make changes, so mount rw fs */
- conf_mount_rw();
- $fs_mounted_rw = true;
- /* Write out configuration to create a backup prior to pkg install. */
- write_config(gettext("Creating restore point before package installation."));
+if ($_GET) {
+ $pkgname = str_replace(array("<", ">", ";", "&", "'", '"'), "", htmlspecialchars_decode($_GET['pkg'], ENT_QUOTES | ENT_HTML401));
+ switch($_GET['mode']) {
+ case 'showlog':
+ if (strpos($pkgname, ".")) {
+ update_output_window(gettext("Something is wrong on the request."));
+ } else if (file_exists("/tmp/pkg_mgr_{$pkgname}.log"))
+ update_output_window(@file_get_contents("/tmp/pkg_mgr_{$pkgname}.log"));
+ else
+ update_output_window(gettext("Log was not retrievable."));
break;
-}
-
-switch($_GET['mode']) {
- case "delete":
- uninstall_package($pkgname);
- update_status(gettext("Package deleted."));
- $static_output .= "\n" . gettext("Package deleted.");
- update_output_window($static_output);
- filter_configure();
- break;
- case "showlog":
- $id = htmlspecialchars($pkgname);
- if(strpos($id, "."))
- exit;
- update_output_window(file_get_contents("/tmp/pkg_mgr_{$id}.log"));
- break;
- case "reinstallxml":
- case "reinstallpkg":
- delete_package_xml($pkgname);
- if (install_package($pkgname) < 0) {
- update_status(gettext("Package reinstallation failed."));
- $static_output .= "\n" . gettext("Package reinstallation failed.");
- update_output_window($static_output);
- } else {
- update_status(gettext("Package reinstalled."));
- $static_output .= "\n" . gettext("Package reinstalled.");
- update_output_window($static_output);
- filter_configure();
- }
- file_put_contents("/tmp/{$pkgname}.info", $static_output);
- echo "<script type='text/javascript'>document.location=\"pkg_mgr_install.php?mode=installedinfo&pkg={$pkgname}\";</script>";
- break;
- case "installedinfo":
- if(file_exists("/tmp/{$pkgname}.info")) {
- $filename = escapeshellcmd("/tmp/{$pkgname}.info");
- $status = file_get_contents($filename);
+ case 'installedinfo':
+ if (file_exists("/tmp/{$pkgname}.info")) {
+ $status = @file_get_contents("/tmp/{$pkgname}.info");
update_status("{$pkgname} " . gettext("installation completed."));
update_output_window($status);
} else
update_output_window(sprintf(gettext("Could not find %s."), $pkgname));
break;
- case "reinstallall":
- if (is_array($config['installedpackages']['package'])) {
- $todo = array();
- foreach($config['installedpackages']['package'] as $package)
- $todo[] = array('name' => $package['name'], 'version' => $package['version']);
- foreach($todo as $pkgtodo) {
- $static_output = "";
- if($pkgtodo['name']) {
- update_output_window($static_output);
- uninstall_package($pkgtodo['name']);
- install_package($pkgtodo['name']);
+ default:
+ break;
+ }
+} else if ($_POST) {
+ $pkgid = str_replace(array("<", ">", ";", "&", "'", '"'), "", htmlspecialchars_decode($_POST['id'], ENT_QUOTES | ENT_HTML401));
+
+ /* All other cases make changes, so mount rw fs */
+ conf_mount_rw();
+ /* Write out configuration to create a backup prior to pkg install. */
+ write_config(gettext("Creating restore point before package installation."));
+
+ switch ($_POST['mode']) {
+ case 'delete':
+ uninstall_package($pkgid);
+ update_status(gettext("Package deleted."));
+ $static_output .= "\n" . gettext("Package deleted.");
+ update_output_window($static_output);
+ filter_configure();
+ break;
+ case 'reinstallxml':
+ case 'reinstallpkg':
+ delete_package_xml($pkgid);
+ if (install_package($pkgid) < 0) {
+ update_status(gettext("Package reinstallation failed."));
+ $static_output .= "\n" . gettext("Package reinstallation failed.");
+ update_output_window($static_output);
+ } else {
+ update_status(gettext("Package reinstalled."));
+ $static_output .= "\n" . gettext("Package reinstalled.");
+ update_output_window($static_output);
+ filter_configure();
+ }
+ @file_put_contents("/tmp/{$pkgid}.info", $static_output);
+ $pkgid = htmlspecialchars($pkgid);
+ echo "<script type='text/javascript'>document.location=\"pkg_mgr_install.php?mode=installedinfo&pkg={$pkgid}\";</script>";
+ break;
+ case 'reinstallall':
+ if (is_array($config['installedpackages']) && is_array($config['installedpackages']['package'])) {
+ $todo = array();
+ foreach($config['installedpackages']['package'] as $package)
+ $todo[] = array('name' => $package['name'], 'version' => $package['version']);
+ foreach($todo as $pkgtodo) {
+ $static_output = "";
+ if($pkgtodo['name']) {
+ update_output_window($static_output);
+ uninstall_package($pkgtodo['name']);
+ install_package($pkgtodo['name']);
+ }
}
+ update_status(gettext("All packages reinstalled."));
+ $static_output .= "\n" . gettext("All packages reinstalled.");
+ update_output_window($static_output);
+ filter_configure();
+ } else
+ update_output_window(gettext("No packages are installed."));
+ break;
+ case 'installed':
+ default:
+ $status = install_package($pkgid);
+ if($status == -1) {
+ update_status(gettext("Installation of") . " {$pkgid} " . gettext("FAILED!"));
+ $static_output .= "\n" . gettext("Installation halted.");
+ update_output_window($static_output);
+ } else {
+ $status_a = gettext(sprintf("Installation of %s completed.", $pkgid));
+ update_status($status_a);
+ $status = get_after_install_info($pkgid);
+ if($status)
+ $static_output .= "\n" . gettext("Installation completed.") . "\n{$pkgid} " . gettext("setup instructions") . ":\n{$status}";
+ else
+ $static_output .= "\n" . gettext("Installation completed. Please check to make sure that the package is configured from the respective menu then start the package.");
+
+ @file_put_contents("/tmp/{$pkgid}.info", $static_output);
+ echo "<script type='text/javascript'>document.location=\"pkg_mgr_install.php?mode=installedinfo&pkg={$pkgid}\";</script>";
}
- update_status(gettext("All packages reinstalled."));
- $static_output .= "\n" . gettext("All packages reinstalled.");
- update_output_window($static_output);
filter_configure();
- } else
- update_output_window(gettext("No packages are installed."));
- break;
- default:
- $pkgid = htmlspecialchars($_GET['id']);
- $status = install_package($pkgid);
- if($status == -1) {
- update_status(gettext("Installation of") . " {$pkgid} " . gettext("FAILED!"));
- $static_output .= "\n" . gettext("Installation halted.");
- update_output_window($static_output);
- } else {
- $status_a = gettext("Installation of") . " {$pkgid} " . gettext("completed.");
- update_status($status_a);
- $status = get_after_install_info($pkgid);
- if($status)
- $static_output .= "\n" . gettext("Installation completed.") . "\n{$pkgid} " . gettext("setup instructions") . ":\n{$status}";
- else
- $static_output .= "\n" . gettext("Installation completed. Please check to make sure that the package is configured from the respective menu then start the package.");
- file_put_contents("/tmp/{$pkgid}.info", $static_output);
- echo "<script type='text/javascript'>document.location=\"pkg_mgr_install.php?mode=installedinfo&pkg={$pkgid}\";</script>";
- }
- filter_configure();
- break;
-}
+ break;
+ }
-// Delete all temporary package tarballs and staging areas.
-unlink_if_exists("/tmp/apkg_*");
-rmdir_recursive("/var/tmp/instmp*");
+ // Delete all temporary package tarballs and staging areas.
+ unlink_if_exists("/tmp/apkg_*");
+ rmdir_recursive("/var/tmp/instmp*");
-// close log
-if($fd_log)
- fclose($fd_log);
+ // close log
+ if($fd_log)
+ fclose($fd_log);
-if($fs_mounted_rw) {
/* Restore to read only fs */
conf_mount_ro();
}
diff --git a/usr/local/www/services_ntpd.php b/usr/local/www/services_ntpd.php
index c68476b..5c75bc7 100644
--- a/usr/local/www/services_ntpd.php
+++ b/usr/local/www/services_ntpd.php
@@ -2,6 +2,7 @@
/*
services_ntpd.php
+ Copyright (C) 2013 Dagorlad
Copyright (C) 2012 Jim Pingle
All rights reserved.
@@ -38,14 +39,21 @@
##|-PRIV
require("guiconfig.inc");
+require_once('rrd.inc');
+require_once("shaper.inc");
-if (empty($config['ntpd']['interface']))
- if ($config['installedpackages']['openntpd'] && empty($config['installedpackages']['openntpd']['config'][0]['interface'])) {
+if (!is_array($config['ntpd']))
+ $config['ntpd'] = array();
+
+if (empty($config['ntpd']['interface'])) {
+ if (is_array($config['installedpackages']['openntpd']) && is_array($config['installedpackages']['openntpd']['config']) &&
+ is_array($config['installedpackages']['openntpd']['config'][0]) && !empty($config['installedpackages']['openntpd']['config'][0]['interface'])) {
$pconfig['interface'] = explode(",", $config['installedpackages']['openntpd']['config'][0]['interface']);
unset($config['installedpackages']['openntpd']);
+ write_config("Upgraded settings from openttpd");
} else
$pconfig['interface'] = array();
-else
+} else
$pconfig['interface'] = explode(",", $config['ntpd']['interface']);
if ($_POST) {
@@ -64,6 +72,94 @@ if ($_POST) {
elseif (isset($config['ntpd']['gpsport']))
unset($config['ntpd']['gpsport']);
+ unset($config['ntpd']['prefer']);
+ unset($config['ntpd']['noselect']);
+ $timeservers = '';
+ for ($i = 0; $i < 10; $i++) {
+ $tserver = trim($_POST["server{$i}"]);
+ if (!empty($tserver)) {
+ $timeservers .= "{$tserver} ";
+ if (!empty($_POST["servprefer{$i}"])) $config['ntpd']['prefer'] .= "{$tserver} ";
+ if (!empty($_POST["servselect{$i}"])) $config['ntpd']['noselect'].= "{$tserver} ";
+ }
+ }
+ $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;
@@ -73,27 +169,81 @@ if ($_POST) {
}
}
+$pconfig = &$config['ntpd'];
$pgtitle = array(gettext("Services"),gettext("NTP"));
$shortcut_section = "ntp";
include("head.inc");
?>
+<script type="text/javascript">
+
+ //Generic show an advanced option function
+ function show_advanced(showboxID, configvalueID) {
+ document.getElementById(showboxID).innerHTML='';
+ aodiv = document.getElementById(configvalueID);
+ aodiv.style.display = "block";
+ }
+
+ //Insure only one of two mutually exclusive options are checked
+ function CheckOffOther(clicked, checkOff) {
+ if (document.getElementById(clicked).checked) {
+ document.getElementById(checkOff).checked=false;
+ }
+ }
+
+ //Show another time server line, limited to 10 servers
+ function NewTimeServer(add) {
+ //If the last line has a value
+ var CheckServer = 'server' + (add - 1);
+ var LastId = document.getElementById(CheckServer);
+ if (document.getElementById(CheckServer).value != '') {
+ if (add < 10) {
+ var TimeServerID = 'timeserver' + add;
+ document.getElementById(TimeServerID).style.display = 'block';
+ //then revise the add another server line
+ if (add < 9) {
+ var next = add + 1;
+ 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 + ')">\n';
+ document.getElementById('addserver').innerHTML=newdiv;
+ }else{
+ document.getElementById('addserver').style.display = 'none';
+ }
+ }
+ }
+ }
+
+</script>
+
+
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<form action="services_ntpd.php" method="post" name="iform" id="iform">
+<form action="services_ntpd.php" method="post" name="iform" id="iform" enctype="multipart/form-data" accept-charset="utf-8">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td><div id="mainarea">
-<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
-<tr>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("NTP Server Configuration"); ?></td>
-</tr>
-<tr>
- <td width="22%" valign="top" class="vncellreq">Interface(s)</td>
- <td width="78%" class="vtable">
+ <tr>
+ <td>
+<?php
+ $tab_array = array();
+ $tab_array[] = array(gettext("NTP"), true, "services_ntpd.php");
+ $tab_array[] = array(gettext("Serial GPS"), false, "services_ntpd_gps.php");
+ $tab_array[] = array(gettext("PPS"), false, "services_ntpd_pps.php");
+ display_top_tabs($tab_array);
+?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("NTP Server Configuration"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Interface(s)</td>
+ <td width="78%" class="vtable">
<?php
$interfaces = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
@@ -104,54 +254,157 @@ include("head.inc");
$interfaces[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
$size = (count($interfaces) < 10) ? count($interfaces) : 10;
?>
- <select id="interface" name="interface[]" multiple="true" class="formselect" size="<?php echo $size; ?>">
+ <select id="interface" name="interface[]" multiple="true" class="formselect" size="<?php echo $size; ?>">
<?php
foreach ($interfaces as $iface => $ifacename) {
if (!is_ipaddr(get_interface_ip($iface)) && !is_ipaddr($iface))
continue;
echo "<option value='{$iface}'";
- if (in_array($iface, $pconfig['interface']))
- echo "selected";
+ if (is_array($pconfig['interface']))
+ if (in_array($iface, $pconfig['interface'])) echo " selected=\"selected\"";
echo ">{$ifacename}</option>\n";
} ?>
- </select>
- <br/>
- <br/><?php echo gettext("Interfaces without an IP address will not be shown."); ?>
- <br/>
- <br/><?php echo gettext("Selecting no interfaces will listen on all interfaces with a wildcard."); ?>
- <br/><?php echo gettext("Selecting all interfaces will explicitly listen on only the interfaces/IPs specified."); ?>
- </td>
-</tr>
-<?php /* Probing would be nice, but much more complex. Would need to listen to each port for 1s+ and watch for strings. */ ?>
-<?php $serialports = glob("/dev/cua?[0-9]{,.[0-9]}", GLOB_BRACE); ?>
-<?php if (!empty($serialports)): ?>
-<tr>
- <td width="22%" valign="top" class="vncellreq">Serial GPS</td>
- <td width="78%" class="vtable">
- <select name="gpsport">
- <option value="">none</option>
- <?php foreach ($serialports as $port):
- $shortport = substr($port,5);
- $selected = ($shortport == $config['ntpd']['gpsport']) ? " selected" : "";?>
- <option value="<?php echo $shortport;?>"<?php echo $selected;?>><?php echo $shortport;?></option>
- <?php endforeach; ?>
- </select>
- <br/>
- <br/><?php echo gettext("The GPS must provide NMEA format output!"); ?>
- <br/>
- <br/><?php echo gettext("All serial ports are listed, be sure to pick only the port with the GPS attached."); ?>
- <br/>
- <br/><?php echo gettext("It is best to configure at least 2 servers under"); ?> <a href="system.php"><?php echo gettext("System > General"); ?></a> <?php echo gettext("to avoid loss of sync if the GPS data is not valid over time. Otherwise ntpd may only use values from the unsynchronized local clock when providing time to clients."); ?>
- </td>
-</tr>
-<?php endif; ?>
-<tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)">
- </td>
-</tr>
-</table>
+ </select>
+ <br/>
+ <br/><?php echo gettext("Interfaces without an IP address will not be shown."); ?>
+ <br/>
+ <br/><?php echo gettext("Selecting no interfaces will listen on all interfaces with a wildcard."); ?>
+ <br/><?php echo gettext("Selecting all interfaces will explicitly listen on only the interfaces/IPs specified."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Time servers</td>
+ <td width="78%" class="vtable">
+ <?php
+ $timeservers = explode( ' ', $config['system']['timeservers']);
+ for ($i = $j = 0; $i < 10; $i++){
+ echo "<div id=\"timeserver{$i}\"";
+ if ((isset($timeservers[$i])) || ($i < 3)) {
+ $j++;
+ }else{
+ echo " style=\"display:none\"";
+ }
+ echo ">\n";
+
+ echo "<input name=\"server{$i}\" class=\"formfld unknown\" id=\"server{$i}\" size=\"30\" value=\"{$timeservers[$i]}\" type=\"text\">&emsp;";
+ 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';
+ echo '>&nbsp;prefer&emsp;';
+ 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';
+ echo ">&nbsp;noselect\n<br/>\n</div>\n";
+ }
+ ?>
+ <div id="addserver">
+ <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;?>)">
+ </div>
+ <br/>
+ <?php echo gettext('For best results three to five servers should be configured here.'); ?>
+ <br/>
+ <?php echo gettext('The <i>prefer</i> option indicates that NTP should favor the use of this server more than all others.'); ?>
+ <br/>
+ <?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.'); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Orphan mode</td>
+ <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>
+ <?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>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">NTP graphs</td>
+ <td width="78%" class="vtable">
+ <input name="statsgraph" type="checkbox" class="formcheckbox" id="statsgraph" <?php if($pconfig['statsgraph']) echo ' checked'; ?>>
+ <?php echo gettext("Enable rrd graphs of NTP statistics (default: disabled)."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Syslog logging</td>
+ <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>).
+ <br/><br/>
+ <input name="logpeer" type="checkbox" class="formcheckbox" id="logpeer"<?php if($pconfig['logpeer']) echo ' checked'; ?>>
+ <?php echo gettext("Enable logging of peer messages (default: disabled)."); ?>
+ <br/>
+ <input name="logsys" type="checkbox" class="formcheckbox" id="logsys"<?php if($pconfig['logsys']) echo ' checked'; ?>>
+ <?php echo gettext("Enable logging of system messages (default: disabled)."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Statistics logging</td>
+ <td width="78%" class="vtable">
+ <div id="showstatisticsbox">
+ <input type="button" onClick="show_advanced('showstatisticsbox', 'showstatistics')" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show statistics logging options");?></a>
+ </div>
+ <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."); ?>
+ <br/><br/>
+ <input name="clockstats" type="checkbox" class="formcheckbox" id="clockstats"<?php if($pconfig['clockstats']) echo ' checked'; ?>>
+ <?php echo gettext("Enable logging of reference clock statistics (default: disabled)."); ?>
+ <br/>
+ <input name="loopstats" type="checkbox" class="formcheckbox" id="loopstats"<?php if($pconfig['loopstats']) echo ' checked'; ?>>
+ <?php echo gettext("Enable logging of clock discipline statistics (default: disabled)."); ?>
+ <br/>
+ <input name="peerstats" type="checkbox" class="formcheckbox" id="peerstats"<?php if($pconfig['peerstats']) echo ' checked'; ?>>
+ <?php echo gettext("Enable logging of NTP peer statistics (default: disabled)."); ?>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Access restrictions</td>
+ <td width="78%" class="vtable">
+ <div id="showrestrictbox">
+ <input type="button" onClick="show_advanced('showrestrictbox', 'showrestrict')" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show access restriction options");?></a>
+ </div>
+ <div id="showrestrict" style="display:none">
+ <?php echo gettext("these options control access to NTP from the WAN."); ?>
+ <br/><br/>
+ <input name="kod" type="checkbox" class="formcheckbox" id="kod"<?php if(!$pconfig['kod']) echo ' checked'; ?>>
+ <?php echo gettext("Enable Kiss-o'-death packets (default: enabled)."); ?>
+ <br/>
+ <input name="nomodify" type="checkbox" class="formcheckbox" id="nomodify"<?php if(!$pconfig['nomodify']) echo ' checked'; ?>>
+ <?php echo gettext("Deny state modifications (i.e. run time configuration) by ntpq and ntpdc (default: enabled)."); ?>
+ <br/>
+ <input name="noquery" type="checkbox" class="formcheckbox" id="noquery"<?php if($pconfig['noquery']) echo ' checked'; ?>>
+ <?php echo gettext("Disable ntpq and ntpdc queries (default: disabled)."); ?>
+ <br/>
+ <input name="noserve" type="checkbox" class="formcheckbox" id="noserve"<?php if($pconfig['noserve']) echo ' checked'; ?>>
+ <?php echo gettext("Disable all except ntpq and ntpdc queries (default: disabled)."); ?>
+ <br/>
+ <input name="nopeer" type="checkbox" class="formcheckbox" id="nopeer"<?php if(!$pconfig['nopeer']) echo ' checked'; ?>>
+ <?php echo gettext("Deny packets that attempt a peer association (default: enabled)."); ?>
+ <br/>
+ <input name="notrap" type="checkbox" class="formcheckbox" id="notrap"<?php if(!$pconfig['notrap']) echo ' checked'; ?>>
+ <?php echo gettext("Deny mode 6 control message trap service (default: enabled)."); ?>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Leap seconds</td>
+ <td width="78%" class="vtable">
+ <div id="showleapsecbox">
+ <input type="button" onClick="show_advanced('showleapsecbox', 'showleapsec')" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show Leap second configuration");?></a>
+ </div>
+ <div id="showleapsec" style="display:none">
+ <?php echo gettext("A leap second file allows NTP to advertize an upcoming leap second addition or subtraction.");?>
+ <?php echo gettext("Normally this is only useful if this server is a stratum 1 time server.");?>
+ <br/><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/>
+ <strong><?php echo gettext("Or");?></strong>, <?php echo gettext("select a file to upload:");?>
+ <input type="file" name="leapfile" class="formfld file" id="leapfile">
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>">
+ </td>
+ </tr>
+ </table>
</div></td></tr></table>
</form>
<?php include("fend.inc"); ?>
diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php
index 4a55103..b139d5a 100644
--- a/usr/local/www/status_rrd_graph_img.php
+++ b/usr/local/www/status_rrd_graph_img.php
@@ -201,7 +201,7 @@ if ($altq_list_queues[$curif]) {
$speedlimit = ($upstream + $downstream);
-/* Set default colors explicity, the theme can then override them below.
+/* Set default colors explicitly, the theme can then override them below.
This prevents missing colors in themes from crashing the graphs. */
/* Traffic Outbound Out-P-4, Out-B-4, Out-P-6, Out-B-6 */
$colortrafficup = array('666666', 'CCCCCC', '2217AA', '625AE7');
@@ -397,11 +397,11 @@ if((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdatabas
$graphcmd .= "CDEF:\"$curif-bytes_t_pass=$curif-bytes_in_t_pass,$curif-bytes_out_t_pass,+\" ";
$graphcmd .= "CDEF:\"$curif-bytes_t_block=$curif-bytes_in_t_block,$curif-bytes_out_t_block,+\" ";
- $graphcmd .= "CDEF:\"$curif-bytes_t=$curif-bytes_in_t_pass,$curif-bytes_out_t_block,+\" ";
+ $graphcmd .= "CDEF:\"$curif-bytes_t=$curif-bytes_t_pass,$curif-bytes_t_block,+\" ";
$graphcmd .= "CDEF:\"$curif-bytes_t_pass6=$curif-bytes_in6_t_pass,$curif-bytes_out6_t_pass,+\" ";
$graphcmd .= "CDEF:\"$curif-bytes_t_block6=$curif-bytes_in6_t_block,$curif-bytes_out6_t_block,+\" ";
- $graphcmd .= "CDEF:\"$curif-bytes_t6=$curif-bytes_in6_t_pass,$curif-bytes_out6_t_block,+\" ";
+ $graphcmd .= "CDEF:\"$curif-bytes_t6=$curif-bytes_t_pass6,$curif-bytes_t_block6,+\" ";
$graphcmd .= "VDEF:\"$curif-in_bits_95=$curif-in_bits,95,PERCENT\" ";
$graphcmd .= "CDEF:\"$curif-out_bits_mul=$curif-out_bits,$multiplier,*\" ";
$perc = $multiplier > 0 ? "95" : "5";
@@ -516,8 +516,8 @@ elseif(strstr($curdatabase, "-throughput.rrd")) {
$graphcmd .= "CDEF:\"{$ifname}-out_bits_pass={$ifname}-out_bytes_pass,8,*\" ";
$graphcmd .= "CDEF:\"{$ifname}-bits_io_pass={$ifname}-in_bits_pass,{$ifname}-out_bits_pass,+\" ";
- $graphcmd .= "CDEF:\"{$ifname}-in_bits_block={$ifname}-in_bytes,8,*\" ";
- $graphcmd .= "CDEF:\"{$ifname}-out_bits_block={$ifname}-out_bytes,8,*\" ";
+ $graphcmd .= "CDEF:\"{$ifname}-in_bits_block={$ifname}-in_bytes_block,8,*\" ";
+ $graphcmd .= "CDEF:\"{$ifname}-out_bits_block={$ifname}-out_bytes_block,8,*\" ";
$graphcmd .= "CDEF:\"{$ifname}-bits_io_block={$ifname}-in_bits_block,{$ifname}-out_bits_block,+\" ";
$graphcmd .= "CDEF:\"{$ifname}-bytes_in_pass={$ifname}-in_bytes_pass,0,$speedlimit,LIMIT,UN,0,{$ifname}-in_bytes_pass,IF,$average,*\" ";
diff --git a/usr/local/www/system.php b/usr/local/www/system.php
index ead4700..28811b7 100755
--- a/usr/local/www/system.php
+++ b/usr/local/www/system.php
@@ -140,11 +140,6 @@ if ($_POST) {
}
}
- if ($_POST['webguiport'] && (!is_numericint($_POST['webguiport']) ||
- ($_POST['webguiport'] < 1) || ($_POST['webguiport'] > 65535))) {
- $input_errors[] = gettext("A valid TCP/IP port must be specified for the webConfigurator port.");
- }
-
$direct_networks_list = explode(" ", filter_get_direct_networks_list());
for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
$dnsitem = "dns{$dnscounter}";
diff --git a/usr/local/www/system_authservers.php b/usr/local/www/system_authservers.php
index 96c7216..cbf5ebd 100644
--- a/usr/local/www/system_authservers.php
+++ b/usr/local/www/system_authservers.php
@@ -601,9 +601,9 @@ function select_clicked() {
<td>
<input name="ldapauthcontainers" type="text" class="formfld unknown" id="ldapauthcontainers" size="40" value="<?=htmlspecialchars($pconfig['ldap_authcn']);?>"/>
<input type="button" onclick="select_clicked();" value="<?=gettext("Select");?>" />
- <br /><?=gettext("Note: Semi-Colon separated. This will be prepended to the search base dn above or you can specify full container path.");?>
- <br /><?=gettext("Example: CN=Users;DC=example");?>
- <br /><?=gettext("Example: CN=Users,DC=example,DC=com;OU=OtherUsers,DC=example,DC=com ");?>
+ <br /><?=gettext("Note: Semi-Colon separated. This will be prepended to the search base dn above or you can specify full container path containing a dc= component.");?>
+ <br /><?=gettext("Example:");?> CN=Users;DC=example,DC=com
+ <br /><?=gettext("Example:");?> OU=Staff;OU=Freelancers
</td>
</tr>
</table>
@@ -620,7 +620,7 @@ function select_clicked() {
<td>
<input name="ldap_extended_query" type="text" class="formfld unknown" id="ldap_extended_query" size="40" value="<?=htmlspecialchars($pconfig['ldap_extended_query']);?>"/>
- <br /><?=gettext("Example: CN=Groupname,OU=MyGroups,DC=example,DC=com;OU=OtherUsers,DC=example,DC=com ");?>
+ <br /><?=gettext("Example:");?> &amp;(objectClass=inetOrgPerson)(mail=*@example.com)
</td>
</tr>
</table>
diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php
index 1add2fc..0dc3f6c 100644
--- a/usr/local/www/system_certmanager.php
+++ b/usr/local/www/system_certmanager.php
@@ -302,15 +302,15 @@ if ($_POST) {
}else if (($reqdfields[$i] != "descr") && preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\.\"\']/", $_POST["$reqdfields[$i]"]))
array_push($input_errors, "The field '" . $reqdfieldsn[$i] . "' contains invalid characters.");
}
-
- if (isset($_POST["keylen"]) && !in_array($_POST["keylen"], $cert_keylens))
+
+ if (($pconfig['method'] != "external") && isset($_POST["keylen"]) && !in_array($_POST["keylen"], $cert_keylens))
array_push($input_errors, gettext("Please select a valid Key Length."));
- if (!in_array($_POST["digest_alg"], $openssl_digest_algs))
+ if (($pconfig['method'] != "external") && !in_array($_POST["digest_alg"], $openssl_digest_algs))
array_push($input_errors, gettext("Please select a valid Digest Algorithm."));
- if (isset($_POST["csr_keylen"]) && !in_array($_POST["csr_keylen"], $cert_keylens))
+ if (($pconfig['method'] == "external") && isset($_POST["csr_keylen"]) && !in_array($_POST["csr_keylen"], $cert_keylens))
array_push($input_errors, gettext("Please select a valid Key Length."));
- if (!in_array($_POST["csr_digest_alg"], $openssl_digest_algs))
+ if (($pconfig['method'] == "external") && !in_array($_POST["csr_digest_alg"], $openssl_digest_algs))
array_push($input_errors, gettext("Please select a valid Digest Algorithm."));
}
diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml
index daf32dd..b7d9e6c 100644
--- a/usr/local/www/wizards/setup_wizard.xml
+++ b/usr/local/www/wizards/setup_wizard.xml
@@ -193,7 +193,7 @@
<option>
<name>Static</name>
<value>Static</value>
- <enablefields>ipaddress,subnetmask,gateway</enablefields>
+ <enablefields>ipaddress,subnetmask,upstreamgateway</enablefields>
</option>
<option>
<name>DHCP</name>
@@ -262,7 +262,7 @@
<type>subnet_select</type>
</field>
<field>
- <name>Gateway</name>
+ <name>Upstream Gateway</name>
<bindstofield>wizardtemp->wangateway</bindstofield>
<type>input</type>
<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
OpenPOWER on IntegriCloud