summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorDarren Embry <dse@webonastick.com>2012-07-26 18:45:52 -0400
committerDarren Embry <dse@webonastick.com>2012-07-26 18:45:52 -0400
commit82e7f8e4b0278017fc27d4d5a84b8e5e6a2ce51d (patch)
treeb2bf6d428ad396f39adbf31b756b1992e262d33f /usr
parentf5df5e8415f8c05a344bc47c6b3969ff3315aec7 (diff)
parent617152591ff0d0b5b3b8b6674d024880cb6bbf12 (diff)
downloadpfsense-82e7f8e4b0278017fc27d4d5a84b8e5e6a2ce51d.zip
pfsense-82e7f8e4b0278017fc27d4d5a84b8e5e6a2ce51d.tar.gz
Merge branch 'master' of git://github.com/bsdperimeter/pfsense
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/sbin/pbi_create49
-rw-r--r--usr/local/share/locale/en_US.ISO8859-1/LC_MESSAGES/pfSense.pot (renamed from usr/share/locale/en_US.ISO8859-1/LC_MESSAGES/pfSense.pot)0
-rw-r--r--usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.mo (renamed from usr/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.mo)bin591471 -> 591471 bytes
-rw-r--r--usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po (renamed from usr/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po)0
-rwxr-xr-xusr/local/www/exec.php2
-rwxr-xr-xusr/local/www/firewall_aliases.php171
-rwxr-xr-xusr/local/www/firewall_aliases_edit.php10
-rwxr-xr-xusr/local/www/interfaces_assign.php12
-rwxr-xr-xusr/local/www/pkg_edit.php174
-rwxr-xr-xusr/local/www/services_captiveportal.php96
-rwxr-xr-xusr/local/www/services_dnsmasq_edit.php2
-rwxr-xr-xusr/local/www/status_dhcp_leases.php4
-rw-r--r--usr/local/www/status_dhcpv6_leases.php2
-rw-r--r--usr/local/www/status_openvpn.php2
-rwxr-xr-xusr/local/www/status_services.php10
-rw-r--r--usr/local/www/system_advanced_misc.php37
-rw-r--r--usr/local/www/system_certmanager.php3
-rwxr-xr-xusr/local/www/system_gateways_edit.php201
-rw-r--r--usr/local/www/vpn_openvpn_client.php13
-rw-r--r--usr/local/www/vpn_openvpn_server.php18
-rw-r--r--usr/local/www/widgets/widgets/openvpn.widget.php2
-rw-r--r--usr/local/www/widgets/widgets/services_status.widget.php10
-rw-r--r--usr/local/www/widgets/widgets/traffic_graphs.widget.php2
-rwxr-xr-xusr/local/www/wizard.php8
-rw-r--r--usr/local/www/wizards/openvpn_wizard.inc4
25 files changed, 527 insertions, 305 deletions
diff --git a/usr/local/sbin/pbi_create b/usr/local/sbin/pbi_create
index 2508ced..30b20c5 100755
--- a/usr/local/sbin/pbi_create
+++ b/usr/local/sbin/pbi_create
@@ -1524,14 +1524,18 @@ get_pbi_progversion() {
# Get the PBI_PROGNAME
get_pbi_progname() {
- if [ -z "${PBI_PROGNAME}" ] ; then
+ if [ -z "${PBI_PROGNAME}" -o "${PBI_PROGNAME}" = " " ] ; then
load_pbi_conffile
else
return 0
fi
if [ -z "${PBI_PROGNAME}" -a -n "${PORTSDIR}" -a -n "${PBI_MAKEPORT}" ] ; then
- PBI_PROGNAME="`make -C ${PORTSDIR}/${PBI_MAKEPORT} -V PORTNAME`"
+ # Get the proper package name from the prefix + name + suffix
+ local pkgPrefix="`make -C ${PORTSDIR}/${PBI_MAKEPORT} -V PKGNAMEPREFIX`"
+ local pkgName="`make -C ${PORTSDIR}/${PBI_MAKEPORT} -V PORTNAME`"
+ local pkgSuffix="`make -C ${PORTSDIR}/${PBI_MAKEPORT} -V PKGNAMESUFFIX`"
+ PBI_PROGNAME="${pkgPrefix}${pkgName}${pkgSuffix}"
else
exit_err "Failed to locate PBI_PROGNAME"
fi
@@ -2733,6 +2737,14 @@ pbi_display_info() {
echo "MimeRegistration: YES"
fi
+ # If verbose mode, show file contents
+ if [ "$PBI_VERBOSE" = "YES" ] ; then
+ pbi_find_archive_header
+ echo "TOTALFILES: ${PBI_ARCHIVE_COUNT}"
+ echo "Archive Contents:"
+ echo "--------------------------------------"
+ tail +$PBI_SKIP_ARCHLINES "${PBI_FILENAME}" | tar tvf -
+ fi
}
# See if we need to display gui header info
@@ -3399,6 +3411,7 @@ check_create_required_vars() {
# Start the pbi_create process
do_pbi_create() {
+ get_pbi_progname
echo "Creating PBI: ${PBI_PROGNAME}-${PBI_PROGVERSION}"
mk_header_dir
@@ -3900,9 +3913,9 @@ mk_stage_dir() {
for excl in $PBI_EXCLUDELIST
do
if [ -z "$_excOpts" ] ; then
- _excOpts = "--exclude ${excl}"
+ _excOpts="--exclude ${excl}"
else
- _excOpts = "$_excOpts --exclude ${excl}"
+ _excOpts="$_excOpts --exclude ${excl}"
fi
done
fi
@@ -5305,7 +5318,7 @@ pbi_update_dl() {
local _CKSUM="$2"
# Set local download location
- _dl_loc="${PBI_APPDIR}/.`basename $PBI_UPFILE`.$$"
+ _dl_loc="${PBI_APPDIR}/.`basename $PBI_UPFILE`"
# Have a patch file to download instead, make that the active file to try
if [ -n "$_tPatch" ] ; then
@@ -5349,14 +5362,13 @@ pbi_get_file() {
_rf="${1}"
_lf="${2}"
- # Wait a sec
- sleep 1
-
init_tmpdir
- if [ -e "${_lf}" ] ; then rm "$_lf" ; fi
+ if [ -e "${_lf}" ] ; then
+ echo "Resuming download of: ${_lf}"
+ fi
if [ "$PBI_FETCH_PARSING" != "YES" ] ; then
- fetch -o "${_lf}" "${_rf}"
+ fetch -r -o "${_lf}" "${_rf}"
_err=$?
else
# Doing a front-end download, parse the output of fetch
@@ -5365,13 +5377,11 @@ pbi_get_file() {
_fSize=`cat ${PBI_TMPDIR}/.fetch-size.$$ 2>/dev/null`
_fSize="`expr ${_fSize} / 1024 2>/dev/null`"
rm "${PBI_TMPDIR}/.fetch-size.$$" 2>/dev/null
- _time=0
+ _time=1
- ( fetch -o "${_lf}" "${_rf}" >/dev/null 2>/dev/null ; echo "$?" > ${_eFile} ) &
- FETCH_PID=`ps -auwwwx | grep -v grep | grep "fetch -o ${_lf}" | awk '{print $2}'`
- FETCH_TFILE="${_lf}"
- while
- z=1
+ ( fetch -r -o "${_lf}" "${_rf}" >/dev/null 2>/dev/null ; echo "$?" > ${_eFile} ) &
+ FETCH_PID=`ps -auwwwx | grep -v grep | grep "fetch -r -o ${_lf}" | awk '{print $2}'`
+ while :
do
if [ -e "${_lf}" ] ; then
_dSize=`du -k ${_lf} | tr -d '\t' | cut -d '/' -f 1`
@@ -5391,7 +5401,7 @@ pbi_get_file() {
_err="`cat ${_eFile}`"
if [ "$_err" = "0" ]; then echo "FETCHDONE" ; fi
- unset FETCH_PID FETCH_TFILE
+ unset FETCH_PID
fi
echo ""
@@ -6698,9 +6708,8 @@ exit_trap() {
# If a download is running, kill it
if [ -n "${FETCH_PID}" ] ; then
echo "Killing ${FETCH_PID}"
- kill -9 ${FETCH_PID}
- sleep 1
- rm ${FETCH_TFILE}
+ kill -s INT ${FETCH_PID}
+ sleep 2
fi
chroot_make_cleanup
rm_tmpdir
diff --git a/usr/share/locale/en_US.ISO8859-1/LC_MESSAGES/pfSense.pot b/usr/local/share/locale/en_US.ISO8859-1/LC_MESSAGES/pfSense.pot
index add7889..add7889 100644
--- a/usr/share/locale/en_US.ISO8859-1/LC_MESSAGES/pfSense.pot
+++ b/usr/local/share/locale/en_US.ISO8859-1/LC_MESSAGES/pfSense.pot
diff --git a/usr/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.mo b/usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.mo
index 824251c..824251c 100644
--- a/usr/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.mo
+++ b/usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.mo
Binary files differ
diff --git a/usr/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po b/usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po
index 26cadb0..26cadb0 100644
--- a/usr/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po
+++ b/usr/local/share/locale/pt_BR.ISO8859-1/LC_MESSAGES/pfSense.po
diff --git a/usr/local/www/exec.php b/usr/local/www/exec.php
index 5bd7f30..4342c1d 100755
--- a/usr/local/www/exec.php
+++ b/usr/local/www/exec.php
@@ -71,7 +71,7 @@ if($_POST)
// Function: is Blank
// Returns true or false depending on blankness of argument.
-function isBlank( $arg ) { return ereg( "^\s*$", $arg ); }
+function isBlank( $arg ) { return preg_match( "/^\s*$/", $arg ); }
// Function: Puts
diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php
index c7c935f..4d46c1f 100755
--- a/usr/local/www/firewall_aliases.php
+++ b/usr/local/www/firewall_aliases.php
@@ -52,7 +52,8 @@ $a_aliases = &$config['aliases']['alias'];
if ($_POST) {
- $pconfig = $_POST;
+ if($_POST['tab'])
+ $tab = $_POST['tab'];
if ($_POST['apply']) {
$retval = 0;
@@ -163,76 +164,128 @@ include("head.inc");
<?php print_info_box_np(gettext("The alias list has been changed.") . "<br>" . gettext("You must apply the changes in order for them to take effect."));?>
<?php endif; ?>
<?php pfSense_handle_custom_code("/usr/local/pkg/firewall_aliases/pre_table"); ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont">
-<tr>
- <td width="25%" class="listhdrr"><?=gettext("Name"); ?></td>
- <td width="25%" class="listhdrr"><?=gettext("Values"); ?></td>
- <td width="25%" class="listhdr"><?=gettext("Description"); ?></td>
- <td width="10%" class="list">
- <table border="0" cellspacing="0" cellpadding="1">
+<table width="100%" border="0" cellpadding="0" cellspacing="0" >
+ <tr>
+ <td class="tabnavtbl">
+ <?php
+ $tab=($_REQUEST['tab'] == "" ? "ip" : preg_replace("/\W/","",$_REQUEST['tab']));
+ $tab_array = array();
+ $tab_array[] = array(gettext("IP"),($tab=="ip" ? true : ($tab=="host" ? true : ($tab == "network" ? true : false))), "/firewall_aliases.php?tab=ip");
+ $tab_array[] = array(gettext("Ports"), ($tab=="port"? true : false), "/firewall_aliases.php?tab=port");
+ $tab_array[] = array(gettext("Urls"), ($tab=="url"? true : false), "/firewall_aliases.php?tab=url");
+ $tab_array[] = array(gettext("All"), ($tab=="all"? true : false), "/firewall_aliases.php?tab=all");
+ display_top_tabs($tab_array);
+ ?>
+ <input type="hidden" name="tab" value="<?=htmlspecialchars($tab);?>">
+ </td>
+ </tr>
+<tr><td><div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="20%" class="listhdrr"><?=gettext("Name"); ?></td>
+ <td width="43%" class="listhdrr"><?=gettext("Values"); ?></td>
+ <td width="30%" class="listhdr"><?=gettext("Description"); ?></td>
+ <td width="7%" class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
<tr>
<td valign="middle" width="17">&nbsp;</td>
- <td valign="middle"><a href="firewall_aliases_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new alias"); ?>"></a></td>
- </tr>
- </table>
- </td>
-</tr>
- <?php $i = 0; foreach ($a_aliases as $alias): ?>
-<tr>
- <td class="listlr" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
- <?=htmlspecialchars($alias['name']);?>
- </td>
- <td class="listr" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
- <?php
- if ($alias["url"]) {
- echo $alias["url"] . "<br/>";
- }
- if ($alias["aliasurl"]) {
- echo $alias["aliasurl"] . "<br/>";
- }
- $tmpaddr = explode(" ", $alias['address']);
- $addresses = implode(", ", array_slice($tmpaddr, 0, 10));
- echo $addresses;
- if(count($tmpaddr) > 10) {
- echo "...";
- }
- ?>
- </td>
- <td class="listbg" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
- <?=htmlspecialchars($alias['descr']);?>&nbsp;
- </td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="firewall_aliases_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit alias"); ?>"></a></td>
- <td><a href="firewall_aliases.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this alias? All elements that still use it will become invalid (e.g. filter rules)!");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete alias"); ?>"></a></td>
+ <td valign="middle"><a href="firewall_aliases_edit.php?tab=<?=$tab?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" <?=dom_title(gettext("Add a new alias"));?>></a></td>
</tr>
</table>
</td>
</tr>
- <?php $i++; endforeach; ?>
+ <?php
+ asort($a_aliases);
+ foreach ($a_aliases as $i=> $alias){
+ unset ($show_alias);
+ switch ($tab){
+ case "all":
+ $show_alias= true;
+ break;
+ case "ip":
+ case "host":
+ case "network":
+ if (preg_match("/(host|network)/",$alias["type"]))
+ $show_alias= true;
+ break;
+ case "url":
+ if (preg_match("/(url)/i",$alias["type"]))
+ $show_alias= true;
+ break;
+ case "port":
+ if($alias["type"] == "port")
+ $show_alias= true;
+ break;
+ }
+ if ($show_alias){?>
+ <tr>
+ <td class="listlr" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
+ <?=htmlspecialchars($alias['name']);?>
+ </td>
+ <td class="listr" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
+ <?php
+ if ($alias["url"]) {
+ echo $alias["url"] . "<br/>";
+ }
+ if(is_array($alias["aliasurl"])) {
+ $aliasurls = implode(", ", array_slice($alias["aliasurl"], 0, 10));
+ echo $aliasurls;
+ if(count($aliasurls) > 10) {
+ echo "...<br/>";
+ }
+ echo "<br/>\n";
+ }
+ $tmpaddr = explode(" ", $alias['address']);
+ $addresses = implode(", ", array_slice($tmpaddr, 0, 10));
+ echo $addresses;
+ if(count($tmpaddr) > 10) {
+ echo "...";
+ }
+ ?>
+ </td>
+ <td class="listbg" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';">
+ <?=htmlspecialchars($alias['descr']);?>&nbsp;
+ </td>
+ <td valign="middle" nowrap class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td valign="middle"><a href="firewall_aliases_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" <?=dom_title(gettext("Edit alias")." {$alias['name']}");?>></a></td>
+ <td><a href="firewall_aliases.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this alias? All elements that still use it will become invalid (e.g. filter rules)!");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" <?=dom_title(gettext("Delete alias")." {$alias['name']}");?>></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <?php
+ }
+ }?>
+
<tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle" width="17">&nbsp;</td>
- <td valign="middle">
- <a href="firewall_aliases_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new alias"); ?>"></a></td>
- </td>
- <td valign="middle">
- <a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" title="<?=gettext("Bulk import aliases from list"); ?>" alt="" /></a>
- </td>
- </tr>
- </table>
- </td>
+ <td colspan="3"/>&nbsp;</td>
+ <td valign="middle" nowrap class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tbody>
+ <tr>
+ <td valign="middle">
+ <a href="firewall_aliases_edit.php?tab=<?=$tab?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" <?=dom_title(gettext("Add a new alias")); ?>></a>
+ </td>
+ <td valign="middle">
+ <a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" <?=dom_title(gettext("Bulk import aliases from list"));?> alt="" /></a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
</tr>
-<tr>
+
<td class="tabcont" colspan="3">
- <p><span class="vexpl"><span class="red"><strong><?=gettext("Note:"); ?><br></strong></span><?=gettext("Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped."); ?></span></p>
+ <p><span class="vexpl"><span class="red"><strong><?=gettext("Note:"); ?><br></strong></span><div style="overflow:hidden; text-align:justify;"><?=gettext("Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped."); ?></div></span></p>
</td>
</tr>
</table>
+ </div>
+ </td>
+ </tr>
+ </table>
</form>
<?php include("fend.inc"); ?>
</body>
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php
index 64b9c56..194d445 100755
--- a/usr/local/www/firewall_aliases_edit.php
+++ b/usr/local/www/firewall_aliases_edit.php
@@ -357,8 +357,11 @@ if ($_POST) {
write_config();
- header("Location: firewall_aliases.php");
- exit;
+ if($_POST['tab'])
+ header("Location: firewall_aliases.php?tab=" . htmlspecialchars ($_POST['tab']));
+ else
+ header("Location: firewall_aliases.php");
+ exit;
}
//we received input errors, copy data to prevent retype
else
@@ -573,6 +576,7 @@ EOD;
<div id="inputerrors"></div>
<form action="firewall_aliases_edit.php" method="post" name="iform" id="iform">
+<input name="tab" type="hidden" id="tab" value="<?=htmlspecialchars($pconfig['type']);?>" />
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Alias Edit"); ?></td>
@@ -704,7 +708,7 @@ EOD;
typesel_change();
update_box_type();
- var addressarray = <?= json_encode(array_exclude($pconfig['name'], get_alias_list("port"))) ?>;
+ var addressarray = <?= json_encode(array_exclude($pconfig['name'], get_alias_list($pconfig['type']))) ?>;
function createAutoSuggest() {
<?php
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index d8f5511..8b1f315 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -273,15 +273,9 @@ if ($_GET['act'] == "del") {
unset($config['interfaces'][$id]); /* delete the specified OPTn or LAN*/
- if($id == "lan") {
- unset($config['interfaces']['lan']);
- if (is_array($config['dhcpd']))
- unset($config['dhcpd']['lan']);
- unset($config['shaper']);
- unset($config['ezshaper']);
- unset($config['nat']);
- system("rm /var/dhcpd/var/db/*");
- services_dhcpd_configure();
+ if (is_array($config['dhcpd']) && is_array($config['dhcpd'][$id])) {
+ unset($config['dhcpd'][$id]);
+ services_dhcpd_configure();
}
if (count($config['filter']['rule']) > 0) {
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index 30a56a6..9c4841e 100755
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -58,7 +58,7 @@ function domTT_title($title_msg){
if (!empty($title_msg)){
$title_msg=preg_replace("/\s+/"," ",$title_msg);
$title_msg=preg_replace("/'/","\'",$title_msg);
- return "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\"";
+ return "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'delay',300,'styleClass', 'niceTitle');\"";
}
}
@@ -123,6 +123,25 @@ if($pkg['custom_php_command_before_form'] <> "")
eval($pkg['custom_php_command_before_form']);
if ($_POST) {
+ $firstfield = "";
+ $rows = 0;
+
+ $input_errors = array();
+ $reqfields = array();
+ $reqfieldsn = array();
+ foreach ($pkg['fields']['field'] as $field) {
+ if (($field['type'] == 'input') && isset($field['required'])) {
+ if($field['fieldname'])
+ $reqfields[] = $field['fieldname'];
+ if($field['fielddescr'])
+ $reqfieldsn[] = $field['fielddescr'];
+ }
+ }
+ do_input_validation($_POST, $reqfields, $reqfieldsn, &$input_errors);
+
+ if ($pkg['custom_php_validation_command'])
+ eval($pkg['custom_php_validation_command']);
+
if($_POST['act'] == "del") {
if($pkg['custom_delete_php_command']) {
if($pkg['custom_php_command_before_form'] <> "")
@@ -137,7 +156,7 @@ if ($_POST) {
eval($pkg['custom_php_resync_config_command']);
}
} else {
- if($pkg['custom_add_php_command']) {
+ if(!$input_errors && $pkg['custom_add_php_command']) {
if($pkg['donotsave'] <> "" or $pkg['preoutput'] <> "") {
?>
@@ -153,97 +172,81 @@ if ($_POST) {
}
// donotsave is enabled. lets simply exit.
- if($pkg['donotsave'] <> "") exit;
-
- $firstfield = "";
- $rows = 0;
-
- $input_errors = array();
- $reqfields = array();
- $reqfieldsn = array();
- foreach ($pkg['fields']['field'] as $field) {
- if (($field['type'] == 'input') && isset($field['required'])) {
- if($field['fieldname'])
- $reqfields[] = $field['fieldname'];
- if($field['fielddescr'])
- $reqfieldsn[] = $field['fielddescr'];
- }
- }
- do_input_validation($_POST, $reqfields, $reqfieldsn, &$input_errors);
-
- if ($pkg['custom_php_validation_command'])
- eval($pkg['custom_php_validation_command']);
+ if(empty($pkg['donotsave'])) {
- // store values in xml configration file.
- if (!$input_errors) {
- $pkgarr = array();
- foreach ($pkg['fields']['field'] as $fields) {
- switch($fields['type']){
- case "rowhelper":
- // save rowhelper items.
- #$rowhelpername=($fields['fieldname'] ? $fields['fieldname'] : "row");
- $rowhelpername="row";
- foreach($fields['rowhelper']['rowhelperfield'] as $rowhelperfield)
- foreach($_POST as $key => $value){
- if (preg_match("/^{$rowhelperfield['fieldname']}(\d+)$/",$key,$matches))
- $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']]=$value;
+ // store values in xml configration file.
+ if (!$input_errors) {
+ $pkgarr = array();
+ foreach ($pkg['fields']['field'] as $fields) {
+ switch($fields['type']){
+ case "rowhelper":
+ // save rowhelper items.
+ #$rowhelpername=($fields['fieldname'] ? $fields['fieldname'] : "row");
+ $rowhelpername="row";
+ foreach($fields['rowhelper']['rowhelperfield'] as $rowhelperfield)
+ foreach($_POST as $key => $value){
+ if (preg_match("/^{$rowhelperfield['fieldname']}(\d+)$/",$key,$matches))
+ $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']]=$value;
+ }
+ break;
+ default:
+ $fieldname = $fields['fieldname'];
+ if ($fieldname == "interface_array") {
+ $fieldvalue = $_POST[$fieldname];
+ } elseif (is_array($_POST[$fieldname])) {
+ $fieldvalue = implode(',', $_POST[$fieldname]);
+ } else {
+ $fieldvalue = trim($_POST[$fieldname]);
+ if ($fields['encoding'] == 'base64')
+ $fieldvalue = base64_encode($fieldvalue);
}
- break;
- default:
- $fieldname = $fields['fieldname'];
- if ($fieldname == "interface_array") {
- $fieldvalue = $_POST[$fieldname];
- } elseif (is_array($_POST[$fieldname])) {
- $fieldvalue = implode(',', $_POST[$fieldname]);
- } else {
- $fieldvalue = trim($_POST[$fieldname]);
- if ($fields['encoding'] == 'base64')
- $fieldvalue = base64_encode($fieldvalue);
+ if($fieldname)
+ $pkgarr[$fieldname] = $fieldvalue;
}
- if($fieldname)
- $pkgarr[$fieldname] = $fieldvalue;
- }
- }
+ }
- if (isset($id) && $a_pkg[$id])
- $a_pkg[$id] = $pkgarr;
- else
- $a_pkg[] = $pkgarr;
+ if (isset($id) && $a_pkg[$id])
+ $a_pkg[$id] = $pkgarr;
+ else
+ $a_pkg[] = $pkgarr;
- write_config($pkg['addedit_string']);
- // late running code
- if($pkg['custom_add_php_command_late'] <> "") {
- eval($pkg['custom_add_php_command_late']);
- }
+ write_config($pkg['addedit_string']);
+ // late running code
+ if($pkg['custom_add_php_command_late'] <> "") {
+ eval($pkg['custom_add_php_command_late']);
+ }
- if (isset($pkg['filter_rules_needed']))
- filter_configure();
+ if (isset($pkg['filter_rules_needed']))
+ filter_configure();
- // resync the configuration file code if defined.
- if($pkg['custom_php_resync_config_command'] <> "") {
- eval($pkg['custom_php_resync_config_command']);
- }
+ // resync the configuration file code if defined.
+ if($pkg['custom_php_resync_config_command'] <> "") {
+ eval($pkg['custom_php_resync_config_command']);
+ }
- parse_package_templates();
+ parse_package_templates();
- /* if start_command is defined, restart w/ this */
- if($pkg['start_command'] <> "")
- exec($pkg['start_command'] . ">/dev/null 2&>1");
+ /* if start_command is defined, restart w/ this */
+ if($pkg['start_command'] <> "")
+ exec($pkg['start_command'] . ">/dev/null 2&>1");
- /* if restart_command is defined, restart w/ this */
- if($pkg['restart_command'] <> "")
- exec($pkg['restart_command'] . ">/dev/null 2&>1");
+ /* if restart_command is defined, restart w/ this */
+ if($pkg['restart_command'] <> "")
+ exec($pkg['restart_command'] . ">/dev/null 2&>1");
- if($pkg['aftersaveredirect'] <> "") {
- pfSenseHeader($pkg['aftersaveredirect']);
- } elseif(!$pkg['adddeleteeditpagefields']) {
- pfSenseHeader("pkg_edit.php?xml={$xml}&id=0");
- } elseif(!$pkg['preoutput']) {
- pfSenseHeader("pkg.php?xml=" . $xml);
+ if($pkg['aftersaveredirect'] <> "") {
+ pfSenseHeader($pkg['aftersaveredirect']);
+ } elseif(!$pkg['adddeleteeditpagefields']) {
+ pfSenseHeader("pkg_edit.php?xml={$xml}&id=0");
+ } elseif(!$pkg['preoutput']) {
+ pfSenseHeader("pkg.php?xml=" . $xml);
+ }
+ exit;
+ } else {
+ $get_from_post = true;
}
+ } elseif (!$input_errors) {
exit;
- } else {
- $get_from_post = true;
}
}
@@ -593,6 +596,11 @@ if ($pkg['tabs'] <> "") {
$source_url = $pkga['source'];
eval("\$pkg_source_txt = &$source_url;");
$input="";
+ #check if show disable option is present on xml
+ if(isset($pkga['show_disable_value'])){
+ array_push($pkg_source_txt, array(($pkga['source_name']? $pkga['source_name'] : $pkga['name'])=> $pkga['show_disable_value'],
+ ($pkga['source_value']? $pkga['source_value'] : $pkga['value'])=> $pkga['show_disable_value']));
+ }
foreach ($pkg_source_txt as $opt) {
$source_name =($pkga['source_name']? $opt[$pkga['source_name']] : $opt[$pkga['name']]);
$source_value =($pkga['source_value'] ? $opt[$pkga['source_value']] : $opt[$pkga['value']]);
@@ -934,7 +942,7 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) {
$fieldname .= '[]';
$multiple = 'multiple';
}
- echo "<select id='{$fieldname}{$trc}' name='{$fieldname}{$trc}' {$size} {$multiple}>\n";
+ echo "<select style='height:22px;' id='{$fieldname}{$trc}' name='{$fieldname}{$trc}' {$size} {$multiple}>\n";
$ifaces = get_configured_interface_with_descr();
$additional_ifaces = $rowhelper['add_to_interfaces_selection'];
if (!empty($additional_ifaces))
@@ -952,7 +960,9 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) {
echo "</select>\n";
break;
case "select_source":
- echo "<select id='{$fieldname}{$trc}' name='{$fieldname}{$trc}'>\n";
+ echo "<select style='height:22px;' id='{$fieldname}{$trc}' name='{$fieldname}{$trc}'>\n";
+ if(isset($rowhelper['show_disable_value']))
+ echo "<option value='{$rowhelper['show_disable_value']}'>{$rowhelper['show_disable_value']}</option>\n";
$source_url = $rowhelper['source'];
eval("\$pkg_source_txt = &$source_url;");
foreach($pkg_source_txt as $opt) {
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php
index 6dd23aa..de2fe1d 100755
--- a/usr/local/www/services_captiveportal.php
+++ b/usr/local/www/services_captiveportal.php
@@ -76,6 +76,16 @@ if ($_GET['act'] == "viewhtml") {
exit;
}
+if (!is_array($config['ca']))
+ $config['ca'] = array();
+
+$a_ca =& $config['ca'];
+
+if (!is_array($config['cert']))
+ $config['cert'] = array();
+
+$a_cert =& $config['cert'];
+
if ($a_cp[$cpzone]) {
$pconfig['zoneid'] = $a_cp[$cpzone]['zoneid'];
$pconfig['cinterface'] = $a_cp[$cpzone]['interface'];
@@ -97,9 +107,7 @@ if ($a_cp[$cpzone]) {
$pconfig['httpslogin_enable'] = isset($a_cp[$cpzone]['httpslogin']);
$pconfig['httpsname'] = $a_cp[$cpzone]['httpsname'];
$pconfig['preauthurl'] = strtolower($a_cp[$cpzone]['preauthurl']);
- $pconfig['cert'] = base64_decode($a_cp[$cpzone]['certificate']);
- $pconfig['cacert'] = base64_decode($a_cp[$cpzone]['cacertificate']);
- $pconfig['key'] = base64_decode($a_cp[$cpzone]['private-key']);
+ $pconfig['certref'] = $a_cp[$cpzone]['certref'];
$pconfig['logoutwin_enable'] = isset($a_cp[$cpzone]['logoutwin_enable']);
$pconfig['peruserbw'] = isset($a_cp[$cpzone]['peruserbw']);
$pconfig['bwdefaultdn'] = $a_cp[$cpzone]['bwdefaultdn'];
@@ -163,17 +171,9 @@ if ($_POST) {
}
if ($_POST['httpslogin_enable']) {
- if (!$_POST['cert'] || !$_POST['key']) {
- $input_errors[] = gettext("Certificate and key must be specified for HTTPS login.");
- } else {
- if (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))
- $input_errors[] = gettext("This certificate does not appear to be valid.");
- if (!strstr($_POST['cacert'], "BEGIN CERTIFICATE") || !strstr($_POST['cacert'], "END CERTIFICATE"))
- $input_errors[] = gettext("This intermmediate certificate does not appear to be valid.");
- if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY"))
- $input_errors[] = gettext("This key does not appear to be valid.");
+ if (!$_POST['certref']) {
+ $input_errors[] = gettext("Certificate must be specified for HTTPS login.");
}
-
if (!$_POST['httpsname'] || !is_domain($_POST['httpsname'])) {
$input_errors[] = gettext("The HTTPS server name must be specified for HTTPS login.");
}
@@ -257,15 +257,16 @@ if ($_POST) {
$newcp['radmac_enable'] = $_POST['radmac_enable'] ? true : false;
$newcp['radmac_secret'] = $_POST['radmac_secret'] ? $_POST['radmac_secret'] : false;
$newcp['reauthenticateacct'] = $_POST['reauthenticateacct'];
- $newcp['httpslogin'] = $_POST['httpslogin_enable'] ? true : false;
+ if ($_POST['httpslogin_enable'])
+ $newcp['httpslogin'] = true;
+ else
+ unset($newcp['httpslogin']);
$newcp['httpsname'] = $_POST['httpsname'];
$newcp['preauthurl'] = $_POST['preauthurl'];
$newcp['peruserbw'] = $_POST['peruserbw'] ? true : false;
$newcp['bwdefaultdn'] = $_POST['bwdefaultdn'];
$newcp['bwdefaultup'] = $_POST['bwdefaultup'];
- $newcp['certificate'] = base64_encode($_POST['cert']);
- $newcp['cacertificate'] = base64_encode($_POST['cacert']);
- $newcp['private-key'] = base64_encode($_POST['key']);
+ $newcp['certref'] = $_POST['certref'];
$newcp['logoutwin_enable'] = $_POST['logoutwin_enable'] ? true : false;
$newcp['nomacfilter'] = $_POST['nomacfilter'] ? true : false;
$newcp['noconcurrentlogins'] = $_POST['noconcurrentlogins'] ? true : false;
@@ -350,6 +351,7 @@ function enable_change(enable_change) {
var endis, radius_endis;
endis = !(document.iform.enable.checked || enable_change);
radius_endis = !((!endis && document.iform.auth_method[2].checked) || enable_change);
+ https_endis = !((!endis && document.iform.httpslogin_enable.checked) || enable_change);
document.iform.cinterface.disabled = endis;
//document.iform.maxproc.disabled = endis;
@@ -388,10 +390,8 @@ function enable_change(enable_change) {
document.iform.radmac_enable.disabled = radius_endis;
document.iform.httpslogin_enable.disabled = endis;
document.iform.radmac_format.disabled = radius_endis;
- document.iform.httpsname.disabled = endis;
- document.iform.cert.disabled = endis;
- document.iform.cacert.disabled = endis;
- document.iform.key.disabled = endis;
+ document.iform.httpsname.disabled = https_endis;
+ document.iform.certref.disabled = https_endis;
document.iform.logoutwin_enable.disabled = endis;
document.iform.nomacfilter.disabled = endis;
document.iform.noconcurrentlogins.disabled = endis;
@@ -860,45 +860,43 @@ function enable_change(enable_change) {
<tr>
<td valign="top" class="vncell"><?=gettext("HTTPS login"); ?></td>
<td class="vtable">
- <input name="httpslogin_enable" type="checkbox" class="formfld" id="httpslogin_enable" value="yes" <?php if($pconfig['httpslogin_enable']) echo "checked"; ?>>
+ <input name="httpslogin_enable" type="checkbox" class="formfld" id="httpslogin_enable" value="yes" onClick="enable_change(false)" <?php if($pconfig['httpslogin_enable']) echo "checked"; ?>>
<strong><?=gettext("Enable HTTPS login"); ?></strong><br>
- <?=gettext("If enabled, the username and password will be transmitted over an HTTPS connection to protect against eavesdroppers. A server name, certificate and matching private key must also be specified below."); ?></td>
- </tr>
+ <?=gettext("If enabled, the username and password will be transmitted over an HTTPS connection to protect against eavesdroppers. A server name and certificate must also be specified below."); ?></td>
+ </tr>
<tr>
<td valign="top" class="vncell"><?=gettext("HTTPS server name"); ?> </td>
<td class="vtable">
<input name="httpsname" type="text" class="formfld unknown" id="httpsname" size="30" value="<?=htmlspecialchars($pconfig['httpsname']);?>"><br>
<?php printf(gettext("This name will be used in the form action for the HTTPS POST and should match the Common Name (CN) in your certificate (otherwise, the client browser will most likely display a security warning). Make sure captive portal clients can resolve this name in DNS and verify on the client that the IP resolves to the correct interface IP on %s."), $g['product_name']);?> </td>
- </tr>
- <tr>
- <td valign="top" class="vncell"><?=gettext("HTTPS certificate"); ?></td>
- <td class="vtable">
- <textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
- <br>
- <?=gettext("Paste a signed certificate in X.509 PEM format here."); ?></td>
- </tr>
- <tr>
- <td valign="top" class="vncell"><?=gettext("HTTPS private key"); ?></td>
- <td class="vtable">
- <textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
- <br>
- <?=gettext("Paste an RSA private key in PEM format here."); ?></td>
- </tr>
- <tr>
- <td valign="top" class="vncell"><?=gettext("HTTPS intermediate certificate"); ?></td>
- <td class="vtable">
- <textarea name="cacert" cols="65" rows="7" id="cacert" class="formpre"><?=htmlspecialchars($pconfig['cacert']);?></textarea>
- <br>
- <?=gettext("Paste a certificate in X.509 PEM format here."); ?></td>
- </tr>
+ </tr>
+ <tr id="ssl_opts">
+ <td width="22%" valign="top" class="vncell"><?=gettext("SSL Certificate"); ?></td>
+ <td width="78%" class="vtable">
+ <?php if (count($a_cert)): ?>
+ <select name="certref" id="certref" class="formselect">
+ <?php
+ foreach($a_cert as $cert):
+ $selected = "";
+ if ($pconfig['certref'] == $cert['refid'])
+ $selected = "selected";
+ ?>
+ <option value="<?=$cert['refid'];?>"<?=$selected;?>><?=$cert['descr'];?></option>
+ <?php endforeach; ?>
+ </select>
+ <?php else: ?>
+ <b><?=gettext("No Certificates defined."); ?></b> <br/>Create one under <a href="system_certmanager.php">System &gt; Cert Manager</a>.
+ <?php endif; ?>
+ </td>
+ </tr>
<tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Portal page contents"); ?></td>
- <td width="78%" class="vtable">
+ <td width="22%" valign="top" class="vncell"><?=gettext("Portal page contents"); ?></td>
+ <td width="78%" class="vtable">
<?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld file" id="htmlfile"><br>
<?php
list($host) = explode(":", $_SERVER['HTTP_HOST']);
$zoneid = $pconfig['zoneid'] ? $pconfig['zoneid'] : 8000;
- if (isset($pconfig['httpslogin'])) {
+ if ($pconfig['httpslogin_enable']) {
$port = $pconfig['listenporthttps'] ? $pconfig['listenporthttps'] : ($zoneid + 1);
$href = "https://{$host}:{$port}";
} else {
diff --git a/usr/local/www/services_dnsmasq_edit.php b/usr/local/www/services_dnsmasq_edit.php
index e77e2cb..56ad988 100755
--- a/usr/local/www/services_dnsmasq_edit.php
+++ b/usr/local/www/services_dnsmasq_edit.php
@@ -212,7 +212,7 @@ include("head.inc");
<td width="78%" class="vtable">
<input name="ip" type="text" class="formfld" id="ip" size="40" value="<?=htmlspecialchars($pconfig['ip']);?>">
<br> <span class="vexpl"><?=gettext("IP address of the host"); ?><br>
- <?=gettext("e.g."); ?> <em>192.168.100.100</em></span></td>
+ <?=gettext("e.g."); ?> <em>192.168.100.100</em> <?=gettext("or"); ?> <em>fd00:abcd::1</em></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php
index 78ea3d7..bba1886 100755
--- a/usr/local/www/status_dhcp_leases.php
+++ b/usr/local/www/status_dhcp_leases.php
@@ -371,7 +371,9 @@ foreach ($leases as $data) {
break;
}
} else {
- foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
+ foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
+ if (!is_array($dhcpifconf['range']))
+ continue;
if (($lip >= ip2ulong($dhcpifconf['range']['from'])) && ($lip <= ip2ulong($dhcpifconf['range']['to']))) {
$data['if'] = $dhcpif;
break;
diff --git a/usr/local/www/status_dhcpv6_leases.php b/usr/local/www/status_dhcpv6_leases.php
index fc77f27..7711be0 100644
--- a/usr/local/www/status_dhcpv6_leases.php
+++ b/usr/local/www/status_dhcpv6_leases.php
@@ -149,7 +149,7 @@ function parse_duid($duid_string) {
$awk = "/usr/bin/awk";
/* this pattern sticks comments into a single array item */
-$cleanpattern = "'{ gsub(\"^#.*\", \"\");} { gsub(\"^server-duid.*\", \"\");} { gsub(\";\", \"\"); print;}'";
+$cleanpattern = "'{ gsub(\"^#.*\", \"\");} { gsub(\"^server-duid.*\", \"\");} { gsub(\";$\", \"\"); print;}'";
/* We then split the leases file by } */
$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
diff --git a/usr/local/www/status_openvpn.php b/usr/local/www/status_openvpn.php
index a5ff598..adc7b39 100644
--- a/usr/local/www/status_openvpn.php
+++ b/usr/local/www/status_openvpn.php
@@ -304,7 +304,7 @@ if ($DisplayNote) {
echo "<br/><b>" . gettext("NOTE") . ":</b> " . gettext("You need to bind each OpenVPN client to enable its management daemon: use 'Local port' setting in the OpenVPN client screen");
}
-if ((empty($clients)) && (empty($servers))) {
+if ((empty($clients)) && (empty($servers)) && (empty($sk_servers))) {
echo gettext("No OpenVPN instance defined");
}
?>
diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php
index 6f02799..69f54e9 100755
--- a/usr/local/www/status_services.php
+++ b/usr/local/www/status_services.php
@@ -289,11 +289,11 @@ $pconfig['description'] = gettext("NTP clock sync");
$services[] = $pconfig;
if (is_array($config['captiveportal'])) {
- foreach ($config['captiveportal'] as $id => $setting) {
+ foreach ($config['captiveportal'] as $zone => $setting) {
if (isset($setting['enable'])) {
$pconfig = array();
$pconfig['name'] = "captiveportal";
- $pconfig['zone'] = $setting['zone'];
+ $pconfig['zone'] = $zone;
$pconfig['description'] = gettext("Captive Portal") . ": ".htmlspecialchars($setting['zone']);
$services[] = $pconfig;
}
@@ -334,14 +334,14 @@ if(isset($config['snmpd']['enable'])) {
$services[] = $pconfig;
}
-if (count($config['igmpproxy']['igmpentry']) > 0) {
+if (is_array($config['igmpproxy']['igmpentry']) && (count($config['igmpproxy']['igmpentry']) > 0)) {
$pconfig = array();
$pconfig['name'] = "igmpproxy";
- $pconfig['descritption'] = gettext("IGMP proxy");
+ $pconfig['description'] = gettext("IGMP proxy");
$services[] = $pconfig;
}
-if($config['installedpackages']['miniupnpd']['config'][0]['enable']) {
+if (isset($config['installedpackages']['miniupnpd']) && $config['installedpackages']['miniupnpd']['config'][0]['enable']) {
$pconfig = array();
$pconfig['name'] = "miniupnpd";
$pconfig['description'] = gettext("UPnP Service");
diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php
index d1d07aa..d3243bc 100644
--- a/usr/local/www/system_advanced_misc.php
+++ b/usr/local/www/system_advanced_misc.php
@@ -65,6 +65,7 @@ $pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']);
$pconfig['maxmss'] = $config['system']['maxmss'];
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
$pconfig['crypto_hardware'] = $config['system']['crypto_hardware'];
+$pconfig['thermal_hardware'] = $config['system']['thermal_hardware'];
$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
$pconfig['kill_states'] = isset($config['system']['kill_states']);
@@ -76,6 +77,9 @@ else
$crypto_modules = array('glxsb' => gettext("AMD Geode LX Security Block"),
'aesni' => gettext("AES-NI CPU-based Acceleration"));
+$thermal_hardware_modules = array( 'coretemp' => gettext("Intel Core* CPU on-die thermal sensor"),
+ 'amdtemp' => gettext("AMD K8, K10 and K11 CPU on-die thermal sensor"));
+
if ($_POST) {
unset($input_errors);
@@ -87,6 +91,9 @@ if ($_POST) {
if (!empty($_POST['crypto_hardware']) && !array_key_exists($_POST['crypto_hardware'], $crypto_modules))
$input_errors[] = gettext("Please select a valid Cryptographic Accelerator.");
+ if (!empty($_POST['thermal_hardware']) && !array_key_exists($_POST['thermal_hardware'], $thermal_hardware_modules))
+ $input_errors[] = gettext("Please select a valid Thermal Hardware Sensor.");
+
if (!$input_errors) {
if($_POST['harddiskstandby'] <> "") {
@@ -172,6 +179,11 @@ if ($_POST) {
else
unset($config['system']['crypto_hardware']);
+ if($_POST['thermal_hardware'])
+ $config['system']['thermal_hardware'] = $_POST['thermal_hardware'];
+ else
+ unset($config['system']['thermal_hardware']);
+
if($_POST['schedule_states'] == "yes")
$config['system']['schedule_states'] = true;
else
@@ -194,6 +206,7 @@ if ($_POST) {
activate_powerd();
load_crypto();
+ load_thermal_hardware();
vpn_ipsec_configure_preferoldsa();
if ($need_racoon_restart)
vpn_ipsec_force_reload();
@@ -392,6 +405,30 @@ function maxmss_checked(obj) {
<td colspan="2" class="list" height="12">&nbsp;</td>
</tr>
<tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Thermal Sensors"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Thermal Sensors"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="thermal_hardware" id="thermal_hardware">
+ <option value=""><?php echo gettext("None/ACPI"); ?></option>
+ <?php foreach ($thermal_hardware_modules as $themalmod_name => $themalmod_descr): ?>
+ <option value="<?php echo $themalmod_name; ?>" <?php if ($pconfig['thermal_hardware'] == $themalmod_name) echo " selected"; ?>><?php echo "{$themalmod_descr} ({$themalmod_name})"; ?></option>
+ <?php endforeach; ?>
+ </select>
+ <br />
+ <?=gettext("If you have a supported CPU, selecting a themal sensor will load the appropriate " .
+ "driver to read its temperature. Setting this to 'None' will attempt to read the " .
+ "temperature from an ACPI-compliant motherboard sensor instead, if one is present."); ?>
+ <br/><br/>
+ <?=gettext("If you do not have a supported thermal sensor chip in your system, this option will have no " .
+ "effect. To unload the selected module, set this option to 'none' and then reboot."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" class="list" height="12">&nbsp;</td>
+ </tr>
+ <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("IP Security"); ?></td>
</tr>
<tr>
diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php
index 6622b40..c9e9826 100644
--- a/usr/local/www/system_certmanager.php
+++ b/usr/local/www/system_certmanager.php
@@ -1097,6 +1097,9 @@ function internalca_change() {
<?php if (is_ipsec_cert($cert['refid'])): ?>
IPsec Tunnel<br/>
<?php endif; ?>
+ <?php if (is_captiveportal_cert($cert['refid'])): ?>
+ Captive Portal<br/>
+ <?php endif; ?>
</td>
<td valign="middle" nowrap class="list">
<a href="system_certmanager.php?act=exp&id=<?=$i;?>">
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 033b3e6..b7762d5 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -53,6 +53,7 @@ if (!is_array($config['gateways']['gateway_item']))
$config['gateways']['gateway_item'] = array();
$a_gateway_item = &$config['gateways']['gateway_item'];
+$apinger_default = return_apinger_defaults();
$id = $_GET['id'];
if (isset($_POST['id']))
@@ -75,10 +76,10 @@ if (isset($id) && $a_gateways[$id]) {
$pconfig['gateway'] = $a_gateways[$id]['gateway'];
$pconfig['defaultgw'] = isset($a_gateways[$id]['defaultgw']);
$pconfig['latencylow'] = $a_gateway_item[$id]['latencylow'];
- $pconfig['latencyhigh'] = $a_gateway_item[$id]['latencyhigh'];
- $pconfig['losslow'] = $a_gateway_item[$id]['losslow'];
- $pconfig['losshigh'] = $a_gateway_item[$id]['losshigh'];
- $pconfig['down'] = $a_gateway_item[$id]['down'];
+ $pconfig['latencyhigh'] = $a_gateway_item[$id]['latencyhigh'];
+ $pconfig['losslow'] = $a_gateway_item[$id]['losslow'];
+ $pconfig['losshigh'] = $a_gateway_item[$id]['losshigh'];
+ $pconfig['down'] = $a_gateway_item[$id]['down'];
$pconfig['monitor'] = $a_gateways[$id]['monitor'];
$pconfig['monitor_disable'] = isset($a_gateways[$id]['monitor_disable']);
$pconfig['descr'] = $a_gateways[$id]['descr'];
@@ -198,45 +199,141 @@ if ($_POST) {
}
}
- /* input validation */
- if($_POST['latencylow']) {
- if (! is_numeric($_POST['latencylow'])) {
- $input_errors[] = gettext("The low latency watermark needs to be a numeric value.");
- }
- }
-
- if($_POST['latencyhigh']) {
- if (! is_numeric($_POST['latencyhigh'])) {
- $input_errors[] = gettext("The high latency watermark needs to be a numeric value.");
- }
- }
- if($_POST['losslow']) {
- if (! is_numeric($_POST['losslow'])) {
- $input_errors[] = gettext("The low loss watermark needs to be a numeric value.");
- }
- }
- if($_POST['losshigh']) {
- if (! is_numeric($_POST['losshigh'])) {
- $input_errors[] = gettext("The high loss watermark needs to be a numeric value.");
- }
- }
-
- if(($_POST['latencylow']) && ($_POST['latencyhigh'])){
- if(($_POST['latencylow'] > $_POST['latencyhigh'])) {
- $input_errors[] = gettext("The High latency watermark needs to be higher then the low latency watermark");
- }
- }
-
- if(($_POST['losslow']) && ($_POST['losshigh'])){
- if($_POST['losslow'] > $_POST['losshigh']) {
- $input_errors[] = gettext("The High packet loss watermark needs to be higher then the low packet loss watermark");
- }
- }
+ /* input validation of apinger advanced parameters */
+ if($_POST['latencylow']) {
+ if (! is_numeric($_POST['latencylow'])) {
+ $input_errors[] = gettext("The low latency threshold needs to be a numeric value.");
+ } else {
+ if ($_POST['latencylow'] < 1) {
+ $input_errors[] = gettext("The low latency threshold needs to be positive.");
+ }
+ }
+ }
+
+ if($_POST['latencyhigh']) {
+ if (! is_numeric($_POST['latencyhigh'])) {
+ $input_errors[] = gettext("The high latency threshold needs to be a numeric value.");
+ } else {
+ if ($_POST['latencyhigh'] < 1) {
+ $input_errors[] = gettext("The high latency threshold needs to be positive.");
+ }
+ }
+ }
+
+ if($_POST['losslow']) {
+ if (! is_numeric($_POST['losslow'])) {
+ $input_errors[] = gettext("The low Packet Loss threshold needs to be a numeric value.");
+ } else {
+ if ($_POST['losslow'] < 1) {
+ $input_errors[] = gettext("The low Packet Loss threshold needs to be positive.");
+ }
+ if ($_POST['losslow'] >= 100) {
+ $input_errors[] = gettext("The low Packet Loss threshold needs to be less than 100.");
+ }
+ }
+ }
+
+ if($_POST['losshigh']) {
+ if (! is_numeric($_POST['losshigh'])) {
+ $input_errors[] = gettext("The high Packet Loss threshold needs to be a numeric value.");
+ } else {
+ if ($_POST['losshigh'] < 1) {
+ $input_errors[] = gettext("The high Packet Loss threshold needs to be positive.");
+ }
+ if ($_POST['losshigh'] > 100) {
+ $input_errors[] = gettext("The high Packet Loss threshold needs to be 100 or less.");
+ }
+ }
+ }
+
+ if(($_POST['latencylow']) && ($_POST['latencyhigh'])) {
+ if ((is_numeric($_POST['latencylow'])) && (is_numeric($_POST['latencyhigh']))) {
+ if(($_POST['latencylow'] > $_POST['latencyhigh'])) {
+ $input_errors[] = gettext("The high latency threshold needs to be higher than the low latency threshold");
+ }
+ }
+ } else {
+ if($_POST['latencylow']){
+ if (is_numeric($_POST['latencylow'])) {
+ if($_POST['latencylow'] > $apinger_default['latencyhigh']) {
+ $input_errors[] = gettext(sprintf("The low latency threshold needs to be less than the default high latency threshold (%d)", $apinger_default['latencyhigh']));
+ }
+ }
+ }
+ if($_POST['latencyhigh']){
+ if (is_numeric($_POST['latencyhigh'])) {
+ if($_POST['latencyhigh'] < $apinger_default['latencylow']) {
+ $input_errors[] = gettext(sprintf("The high latency threshold needs to be higher than the default low latency threshold (%d)", $apinger_default['latencylow']));
+ }
+ }
+ }
+ }
+
+ if(($_POST['losslow']) && ($_POST['losshigh'])){
+ if ((is_numeric($_POST['losslow'])) && (is_numeric($_POST['losshigh']))) {
+ if($_POST['losslow'] > $_POST['losshigh']) {
+ $input_errors[] = gettext("The high Packet Loss threshold needs to be higher than the low Packet Loss threshold");
+ }
+ }
+ } else {
+ if($_POST['losslow']){
+ if (is_numeric($_POST['losslow'])) {
+ if($_POST['losslow'] > $apinger_default['losshigh']) {
+ $input_errors[] = gettext(sprintf("The low Packet Loss threshold needs to be less than the default high Packet Loss threshold (%d)", $apinger_default['losshigh']));
+ }
+ }
+ }
+ if($_POST['losshigh']){
+ if (is_numeric($_POST['losshigh'])) {
+ if($_POST['losshigh'] < $apinger_default['losslow']) {
+ $input_errors[] = gettext(sprintf("The high Packet Loss threshold needs to be higher than the default low Packet Loss threshold (%d)", $apinger_default['losslow']));
+ }
+ }
+ }
+ }
+
+ if($_POST['interval']) {
+ if (! is_numeric($_POST['interval'])) {
+ $input_errors[] = gettext("The frequency probe interval needs to be a numeric value.");
+ } else {
+ if ($_POST['interval'] < 1) {
+ $input_errors[] = gettext("The frequency probe interval needs to be positive.");
+ }
+ }
+ }
+
if($_POST['down']) {
- if (! is_numeric($_POST['down']) || $_POST['down'] < 1) {
- $input_errors[] = gettext("The low latency watermark needs to be a numeric value.");
- }
- }
+ if (! is_numeric($_POST['down'])) {
+ $input_errors[] = gettext("The down time setting needs to be a numeric value.");
+ } else {
+ if ($_POST['down'] < 1) {
+ $input_errors[] = gettext("The down time setting needs to be positive.");
+ }
+ }
+ }
+
+ if(($_POST['interval']) && ($_POST['down'])){
+ if ((is_numeric($_POST['interval'])) && (is_numeric($_POST['down']))) {
+ if($_POST['interval'] > $_POST['down']) {
+ $input_errors[] = gettext("The Frequency Probe interval needs to be less than the down time setting.");
+ }
+ }
+ } else {
+ if($_POST['interval']){
+ if (is_numeric($_POST['interval'])) {
+ if($_POST['interval'] > $apinger_default['down']) {
+ $input_errors[] = gettext(sprintf("The Frequency Probe interval needs to be less than the default down time setting (%d)", $apinger_default['down']));
+ }
+ }
+ }
+ if($_POST['down']){
+ if (is_numeric($_POST['down'])) {
+ if($_POST['down'] < $apinger_default['interval']) {
+ $input_errors[] = gettext(sprintf("The down time setting needs to be higher than the default Frequency Probe interval (%d)", $apinger_default['interval']));
+ }
+ }
+ }
+ }
if (!$input_errors) {
$reloadif = "";
@@ -444,7 +541,7 @@ function monitor_change() {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Advanced");?></td>
<td width="78%" class="vtable">
- <?php $showbutton = (!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) || !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || (isset($pconfig['weight']) && $pconfig['weight'] > 1) || (isset($pconfig['interval']) && $pconfig['interval'])); ?>
+ <?php $showbutton = (!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) || !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || (isset($pconfig['weight']) && $pconfig['weight'] > 1) || (isset($pconfig['interval']) && ($pconfig['interval'] > $apinger_default['interval'])) || (isset($pconfig['down']) && !($pconfig['down'] == $apinger_default['down']))); ?>
<div id="showadvgatewaybox" <? if ($showbutton) echo "style='display:none'"; ?>>
<input type="button" onClick="show_advanced_gateway()" value="Advanced"></input> - Show advanced option</a>
</div>
@@ -475,7 +572,7 @@ function monitor_change() {
<?=gettext("To");?>
<input name="latencyhigh" type="text" class="formfld unknown" id="latencyhigh" size="2"
value="<?=htmlspecialchars($pconfig['latencyhigh']);?>">
- <br> <span class="vexpl"><?=gettext("These define the low and high water marks for latency in milliseconds. Default is 100/200.");?></span></td>
+ <br> <span class="vexpl"><?=gettext(sprintf("Low and high thresholds for latency in milliseconds. Default is %d/%d.", $apinger_default['latencylow'], $apinger_default['latencyhigh']));?></span></td>
</td>
</tr>
<tr>
@@ -487,7 +584,7 @@ function monitor_change() {
<?=gettext("To");?>
<input name="losshigh" type="text" class="formfld unknown" id="losshigh" size="2"
value="<?=htmlspecialchars($pconfig['losshigh']);?>">
- <br> <span class="vexpl"><?=gettext("These define the low and high water marks for packet loss in %. Default is 10/20.");?></span></td>
+ <br> <span class="vexpl"><?=gettext(sprintf("Low and high thresholds for packet loss in %%. Default is %d/%d.", $apinger_default['losslow'], $apinger_default['losshigh']));?></span></td>
</td>
</tr>
<tr>
@@ -496,7 +593,7 @@ function monitor_change() {
<input name="interval" type="text" class="formfld unknown" id="interval" size="2"
value="<?=htmlspecialchars($pconfig['interval']);?>">
<br><span class="vexpl">
- <?=gettext("This defines how often that an icmp probe will be sent in seconds. Default is 1.");?><br/><br/>
+ <?=gettext(sprintf("How often that an ICMP probe will be sent in seconds. Default is %d.", $apinger_default['interval']));?><br/><br/>
<?=gettext("NOTE: The quality graph is averaged over seconds, not intervals, so as the frequency probe is increased the accuracy of the quality graph is decreased.");?>
</span></td>
</td>
@@ -506,18 +603,12 @@ function monitor_change() {
<td width="78%" class="vtable">
<input name="down" type="text" class="formfld unknown" id="down" size="2"
value="<?=htmlspecialchars($pconfig['down']);?>">
- <br> <span class="vexpl"><?=gettext("This defines the number of bad probes before the alarm will fire. Default is 10.");?></span></td>
+ <br> <span class="vexpl"><?=gettext(sprintf("The number of seconds of failed probes before the alarm will fire. Default is %d.", $apinger_default['down']));?></span></td>
</td>
</tr>
<tr>
<td colspan="2">
- <?= gettext("NOTE: The total time before a gateway is down is the product of the Frequency Probe and the Down fields. By default this is 1*10=10 seconds."); ?><br/>
- <?php if (is_numeric($pconfig['interval']) || is_numeric($pconfig['down'])) {
- echo "<br/>";
- $interval = is_numeric($pconfig['interval']) ? $pconfig['interval'] : 1;
- $down = is_numeric($pconfig['down']) ? $pconfig['down'] : 10;
- echo gettext(sprintf("With the current configuration, the total time before this gateway would be considered down would be: %d*%d=%d seconds.", $interval, $down, $interval*$down));
- } ?>
+ <?= gettext("NOTE: The Frequency Probe interval must be less than the Down time, otherwise the gateway will seem to go down then come up again at the next probe."); ?><br/>
</td>
</tr>
</table>
@@ -546,4 +637,4 @@ function monitor_change() {
monitor_change();
</script>
</body>
-</html>
+</html> \ No newline at end of file
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php
index 425040c..f37e81b 100644
--- a/usr/local/www/vpn_openvpn_client.php
+++ b/usr/local/www/vpn_openvpn_client.php
@@ -464,6 +464,16 @@ if ($savemsg)
$aliaslist = get_configured_ip_aliases_list();
foreach ($aliaslist as $aliasip => $aliasif)
$interfaces[$aliasif.'|'.$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
+ $grouplist = return_gateway_groups_array();
+ foreach ($grouplist as $name => $group) {
+ if($group['ipprotocol'] != inet)
+ continue;
+ if($group[0]['vip'] <> "")
+ $vipif = $group[0]['vip'];
+ else
+ $vipif = $group[0]['int'];
+ $interfaces[$name] = "GW Group {$name}";
+ }
$interfaces['any'] = "any";
foreach ($interfaces as $iface => $ifacename):
$selected = "";
@@ -772,7 +782,7 @@ if ($savemsg)
"the tunnel, so that a site-to-site VPN can be " .
"established without manually changing the " .
"routing tables. Expressed as a CIDR range. If " .
- "this is a site-to-site VPN, enter here the " .
+ "this is a site-to-site VPN, enter the " .
"remote LAN here. You may leave this blank to " .
"only communicate with other clients"); ?>.
</td>
@@ -952,4 +962,3 @@ function set_checked($var,& $chk) {
}
?>
-
diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php
index 1ce9840..9198c3a 100644
--- a/usr/local/www/vpn_openvpn_server.php
+++ b/usr/local/www/vpn_openvpn_server.php
@@ -772,6 +772,16 @@ if ($savemsg)
$aliaslist = get_configured_ip_aliases_list();
foreach ($aliaslist as $aliasip => $aliasif)
$interfaces[$aliasif.'|'.$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
+ $grouplist = return_gateway_groups_array();
+ foreach ($grouplist as $name => $group) {
+ if($group['ipprotocol'] != inet)
+ continue;
+ if($group[0]['vip'] <> "")
+ $vipif = $group[0]['vip'];
+ else
+ $vipif = $group[0]['int'];
+ $interfaces[$name] = "GW Group {$name}";
+ }
$interfaces['any'] = "any";
foreach ($interfaces as $iface => $ifacename):
$selected = "";
@@ -1121,7 +1131,7 @@ if ($savemsg)
</option>
<?php endforeach; ?>
</select> <br>
- <?=gettext("The interface to which this tap instance will be, " .
+ <?=gettext("The interface to which this tap instance will be " .
"bridged. This is not done automatically. You must assign this " .
"interface and create the bridge separately. " .
"This setting controls which existing IP address and subnet " .
@@ -1134,7 +1144,7 @@ if ($savemsg)
<td width="78%" class="vtable">
<input name="serverbridge_dhcp_start" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['serverbridge_dhcp_start']);?>">
<br>
- <?=gettext("When using tap mode as multi-point server, " .
+ <?=gettext("When using tap mode as a multi-point server, " .
"you may optionally supply a DHCP range to use on the " .
"interface to which this tap instance is bridged. " .
"If these settings are left blank, DHCP will be passed " .
@@ -1203,7 +1213,7 @@ if ($savemsg)
"the tunnel, so that a site-to-site VPN can be " .
"established without manually changing the " .
"routing tables. Expressed as a CIDR range. If " .
- "this is a site-to-site VPN, enter here the " .
+ "this is a site-to-site VPN, enter the " .
"remote LAN here. You may leave this blank if " .
"you don't want a site-to-site VPN"); ?>.
</td>
@@ -1678,4 +1688,4 @@ function set_checked($var,& $chk) {
$chk = '';
}
-?>
+?> \ No newline at end of file
diff --git a/usr/local/www/widgets/widgets/openvpn.widget.php b/usr/local/www/widgets/widgets/openvpn.widget.php
index a907516..1eea8fd 100644
--- a/usr/local/www/widgets/widgets/openvpn.widget.php
+++ b/usr/local/www/widgets/widgets/openvpn.widget.php
@@ -247,7 +247,7 @@ if ($DisplayNote) {
echo "<br/><b>NOTE:</b> You need to bind each OpenVPN client to enable its management daemon: use 'Local port' setting in the OpenVPN client screen";
}
-if ((empty($clients)) && (empty($servers))) {
+if ((empty($clients)) && (empty($servers)) && (empty($sk_servers))) {
echo "No OpenVPN instance defined";
}
?>
diff --git a/usr/local/www/widgets/widgets/services_status.widget.php b/usr/local/www/widgets/widgets/services_status.widget.php
index d426b8b..bc7e9ba 100644
--- a/usr/local/www/widgets/widgets/services_status.widget.php
+++ b/usr/local/www/widgets/widgets/services_status.widget.php
@@ -82,11 +82,11 @@ $svcconfig['description'] = gettext("NTP clock sync");
$services[] = $svcconfig;
if (is_array($config['captiveportal'])) {
- foreach ($config['captiveportal'] as $id => $setting) {
+ foreach ($config['captiveportal'] as $zone => $setting) {
if (isset($setting['enable'])) {
$svcconfig = array();
$svcconfig['name'] = "captiveportal";
- $svcconfig['zone'] = $setting['zone'];
+ $svcconfig['zone'] = $zone;
$svcconfig['description'] = gettext("Captive Portal") . ": ".htmlspecialchars($setting['zone']);
$services[] = $svcconfig;
}
@@ -127,14 +127,14 @@ if(isset($config['snmpd']['enable'])) {
$services[] = $svcconfig;
}
-if (count($config['igmpproxy']['igmpentry']) > 0) {
+if (is_array($config['igmpproxy']['igmpentry']) && (count($config['igmpproxy']['igmpentry']) > 0)) {
$svcconfig = array();
$svcconfig['name'] = "igmpproxy";
$svcconfig['descritption'] = gettext("IGMP proxy");
$services[] = $svcconfig;
}
-if($config['installedpackages']['miniupnpd']['config'][0]['enable']) {
+if (isset($config['installedpackages']['miniupnpd']) && is_array($config['installedpackages']['miniupnpd']) && $config['installedpackages']['miniupnpd']['config'][0]['enable']) {
$svcconfig = array();
$svcconfig['name'] = "miniupnpd";
$svcconfig['description'] = gettext("UPnP Service");
@@ -194,7 +194,7 @@ if(isset($_POST['servicestatusfilter'])) {
<td class="widgetsubheader">&nbsp;</td>
</tr>
<?php
-$skipservices = explode(",", str_replace(" ", "", $config['widgets']['servicestatusfilter']));
+$skipservices = explode(",", $config['widgets']['servicestatusfilter']);
function service_name_compare($a, $b) {
if (strtolower($a['name']) == strtolower($b['name']))
diff --git a/usr/local/www/widgets/widgets/traffic_graphs.widget.php b/usr/local/www/widgets/widgets/traffic_graphs.widget.php
index c4ffbd3..4ca730b 100644
--- a/usr/local/www/widgets/widgets/traffic_graphs.widget.php
+++ b/usr/local/www/widgets/widgets/traffic_graphs.widget.php
@@ -52,6 +52,8 @@ if (!is_array($a_config["shown"]["item"])) {
}
$ifdescrs = get_configured_interface_with_descr();
+if (isset($config['ipsec']['enable']))
+ $ifdescrs['enc0'] = "IPsec";
if ($_POST) {
if (isset($_POST["refreshinterval"])) {
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index a40bb38..f191b98 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -3,7 +3,7 @@
/*
wizard.php
Copyright (C) 2004 Scott Ullrich
- Copyright (C) 2010 Ermal Luçi
+ Copyright (C) 2010 Ermal Luçi
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -353,7 +353,7 @@ function showchange() {
$value = $field['value'];
$name = $field['name'];
- $name = ereg_replace(" ", "", $name);
+ $name = preg_replace("/\s+/", "", $name);
$name = strtolower($name);
if($field['bindstofield'] <> "") {
@@ -838,7 +838,7 @@ if($pkg['step'][$stepid]['disableallfieldsbydefault'] <> "") {
if($field['type'] <> "submit" and $field['type'] <> "listtopic") {
if(!$field['donotdisable'] <> "") {
array_push($fieldnames_array, $field['name']);
- $fieldname = ereg_replace(" ", "", $field['name']);
+ $fieldname = preg_replace("/\s+/", "", $field['name']);
$fieldname = strtolower($fieldname);
echo "\tdocument.forms[0]." . $fieldname . ".disabled = 1;\n";
}
@@ -857,7 +857,7 @@ if($pkg['step'][$stepid]['disableallfieldsbydefault'] <> "") {
echo "\t\tcase " . $idcounter . ":\n";
$enablefields_split = explode(",", $opt['enablefields']);
foreach ($enablefields_split as $efs) {
- $fieldname = ereg_replace(" ", "", $efs);
+ $fieldname = preg_replace("/\s+/", "", $efs);
$fieldname = strtolower($fieldname);
if($fieldname <> "") {
$onchange = "\t\t\tdocument.forms[0]." . $fieldname . ".disabled = 0; \n";
diff --git a/usr/local/www/wizards/openvpn_wizard.inc b/usr/local/www/wizards/openvpn_wizard.inc
index 076bfc8..8f6fbc9 100644
--- a/usr/local/www/wizards/openvpn_wizard.inc
+++ b/usr/local/www/wizards/openvpn_wizard.inc
@@ -1,6 +1,6 @@
<?php
/*
- Copyright (C) 2010 Ermal Luçi
+ Copyright (C) 2010 Ermal Luçi
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
require_once("openvpn.inc");
function has_special_chars($text) {
- return ereg('[^A-Za-z0-9 _-]', $text);
+ return preg_match('/[^A-Za-z0-9 _-]/', $text);
}
function step1_submitphpaction() {
OpenPOWER on IntegriCloud