summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2011-01-25 12:31:47 -0500
committerScott Ullrich <sullrich@pfsense.org>2011-01-25 12:31:47 -0500
commit620ac186ea01e168fbae8d69ce00fffc833ba9ae (patch)
treeaca7ae5f40406b1c45f92194d090d72c5ad2cda5 /usr/local
parent79e99eb47e898159fd9e1b70e957b383326714c0 (diff)
downloadpfsense-620ac186ea01e168fbae8d69ce00fffc833ba9ae.zip
pfsense-620ac186ea01e168fbae8d69ce00fffc833ba9ae.tar.gz
Misc fixups
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/guiconfig.inc11
-rwxr-xr-xusr/local/www/services_captiveportal.php2
-rwxr-xr-xusr/local/www/services_captiveportal_filemanager.php2
-rwxr-xr-xusr/local/www/services_captiveportal_hostname.php18
-rwxr-xr-xusr/local/www/services_captiveportal_hostname_edit.php25
-rwxr-xr-xusr/local/www/services_captiveportal_ip.php2
-rwxr-xr-xusr/local/www/services_captiveportal_mac.php2
-rw-r--r--usr/local/www/services_captiveportal_vouchers.php2
8 files changed, 32 insertions, 32 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 7835e77..ab5a1c9 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -899,10 +899,12 @@ function display_top_tabs(& $tab_array, $no_drop_down = false) {
if ($tab_array_indent == '') {
$tab_array_indent = 0;
}
+
if ($tab_array_space == '') {
$tab_array_space = 1;
}
- if ($tab_array_char_limit == '' && !$no_drop_down) {
+
+ if ($tab_array_char_limit == '') {
$tab_array_char_limit = 82;
}
@@ -953,6 +955,11 @@ function display_top_tabs(& $tab_array, $no_drop_down = false) {
foreach ($tab_array as $ta)
$tabcharcount = $tabcharcount + strlen($ta[0]);
+ if($no_drop_down == true) {
+ $tabcharcount = 0;
+ unset($tab_array_char_limit);
+ }
+
// If the character count of the tab names is > 670
// then show a select item dropdown menubox.
if($tabcharcount > $tab_array_char_limit) {
@@ -972,7 +979,6 @@ function display_top_tabs(& $tab_array, $no_drop_down = false) {
echo " function tabs_will_go(obj){ document.location = obj.value; }";
echo "</script>";
} else {
- //////>>>
echo "<div class=\"newtabmenu\" style=\"margin:{$tab_array_space}px {$tab_array_indent}px; width:775px;\">\n";
echo "<!-- Tabbed bar code-->\n";
echo "<ul class=\"newtabmenu\">\n";
@@ -986,7 +992,6 @@ function display_top_tabs(& $tab_array, $no_drop_down = false) {
$tabscounter++;
}
echo "</ul>\n</div>\n";
- ////////>>>>
}
}
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php
index 332d053..89dfa80 100755
--- a/usr/local/www/services_captiveportal.php
+++ b/usr/local/www/services_captiveportal.php
@@ -314,7 +314,7 @@ function enable_change(enable_change) {
$tab_array[] = array(gettext("Captive portal"), true, "services_captiveportal.php");
$tab_array[] = array(gettext("Pass-through MAC"), false, "services_captiveportal_mac.php");
$tab_array[] = array(gettext("Allowed IP addresses"), false, "services_captiveportal_ip.php");
- $tab_array[] = array(gettext("Allowed Hostnames"), true, "services_captiveportal_hostname.php");
+ $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php");
$tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php");
$tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php");
display_top_tabs($tab_array, true);
diff --git a/usr/local/www/services_captiveportal_filemanager.php b/usr/local/www/services_captiveportal_filemanager.php
index 947e34b..7bc61ec 100755
--- a/usr/local/www/services_captiveportal_filemanager.php
+++ b/usr/local/www/services_captiveportal_filemanager.php
@@ -139,7 +139,7 @@ include("head.inc");
$tab_array[] = array(gettext("Captive portal"), false, "services_captiveportal.php");
$tab_array[] = array(gettext("Pass-through MAC"), false, "services_captiveportal_mac.php");
$tab_array[] = array(gettext("Allowed IP addresses"), false, "services_captiveportal_ip.php");
- $tab_array[] = array(gettext("Allowed Hostnames"), true, "services_captiveportal_hostname.php");
+ $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php");
$tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php");
$tab_array[] = array(gettext("File Manager"), true, "services_captiveportal_filemanager.php");
display_top_tabs($tab_array, true);
diff --git a/usr/local/www/services_captiveportal_hostname.php b/usr/local/www/services_captiveportal_hostname.php
index dcf5dc3..c7503ca 100755
--- a/usr/local/www/services_captiveportal_hostname.php
+++ b/usr/local/www/services_captiveportal_hostname.php
@@ -97,7 +97,7 @@ include("head.inc");
$tab_array = array();
$tab_array[] = array(gettext("Captive portal"), false, "services_captiveportal.php");
$tab_array[] = array(gettext("Pass-through MAC"), false, "services_captiveportal_mac.php");
- $tab_array[] = array(gettext("Allowed IP Addresses"), true, "services_captiveportal_ip.php");
+ $tab_array[] = array(gettext("Allowed IP Addresses"), false, "services_captiveportal_ip.php");
$tab_array[] = array(gettext("Allowed Hostnames"), true, "services_captiveportal_hostname.php");
$tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php");
$tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php");
@@ -114,13 +114,13 @@ include("head.inc");
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="17" heigth="17"></td>
- <td><a href="services_captiveportal_ip_edit.php"><img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add address"); ?>" width="17" height="17" border="0"></a></td>
+ <td><a href="services_captiveportal_hostname_edit.php"><img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add address"); ?>" width="17" height="17" border="0"></a></td>
</tr>
</table>
</td>
</tr>
<?php $i = 0; foreach ($a_allowedhostnames as $ip): ?>
- <tr ondblclick="document.location='services_captiveportal_ip_edit.php?id=<?=$i;?>'">
+ <tr ondblclick="document.location='services_captiveportal_hostname_edit.php?id=<?=$i;?>'">
<td class="listlr">
<?php
if($ip['dir'] == "to") {
@@ -129,11 +129,7 @@ include("head.inc");
if($ip['dir'] == "both") {
echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_pass.gif\" width=\"11\" height=\"11\" align=\"absmiddle\"> ";
}
- echo strtolower($ip['ip']);
- if($ip['sn'] != "32" && is_numeric($ip['sn'])) {
- $sn = $ip['sn'];
- echo "/$sn";
- }
+ echo strtolower($ip['hostname']);
if($ip['dir'] == "from") {
echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_in.gif\" width=\"11\" height=\"11\" align=\"absmiddle\"> any";
}
@@ -143,7 +139,7 @@ include("head.inc");
<td class="listbg">
<?=htmlspecialchars($ip['descr']);?>&nbsp;
</td>
- <td valign="middle" nowrap class="list"> <a href="services_captiveportal_ip_edit.php?id=<?=$i;?>"><img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit address"); ?>" width="17" height="17" border="0"></a>
+ <td valign="middle" nowrap class="list"> <a href="services_captiveportal_hostname_edit.php?id=<?=$i;?>"><img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit address"); ?>" width="17" height="17" border="0"></a>
&nbsp;<a href="services_captiveportal_ip.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this address?"); ?>')"><img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete address"); ?>" width="17" height="17" border="0"></a></td>
</tr>
<?php $i++; endforeach; ?>
@@ -153,7 +149,7 @@ include("head.inc");
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="17" heigth="17"></td>
- <td><a href="services_captiveportal_ip_edit.php"><img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add address"); ?>" width="17" height="17" border="0"></a></td>
+ <td><a href="services_captiveportal_hostnam_edit.php"><img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add address"); ?>" width="17" height="17" border="0"></a></td>
</tr>
</table>
</td>
@@ -162,7 +158,7 @@ include("head.inc");
<td colspan="2" class="list"><p class="vexpl"><span class="red"><strong>
<?=gettext("Note:"); ?><br>
</strong></span>
- <?=gettext("Adding allowed Hostnamees will allow IP access to/from these addresses through the captive portal without being taken to the portal page. This can be used for a web server serving images for the portal page or a DNS server on another network, for example. By specifying <em>from</em> addresses, it may be used to always allow pass-through access from a client behind the captive portal."); ?></p>
+ <?=gettext("Adding allowed Hostnames will allow a DNS hostname access to/from access through the captive portal without being taken to the portal page. This can be used for a web server serving images for the portal page or a DNS server on another network, for example. By specifying <em>from</em> addresses, it may be used to always allow pass-through access from a client behind the captive portal."); ?></p>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="vexpl"><?=gettext("any"); ?> <img src="/themes/<?=$g['theme'];?>/images/icons/icon_in.gif" width="11" height="11" align="absmiddle"> x.x.x.x </span></td>
diff --git a/usr/local/www/services_captiveportal_hostname_edit.php b/usr/local/www/services_captiveportal_hostname_edit.php
index ca166d4..b6e580a 100755
--- a/usr/local/www/services_captiveportal_hostname_edit.php
+++ b/usr/local/www/services_captiveportal_hostname_edit.php
@@ -38,7 +38,7 @@
##|*IDENT=page-services-captiveportal-editallowedhostnames
##|*NAME=Services: Captive portal: Edit Allowed IPs page
##|*DESCR=Allow access to the 'Services: Captive portal: Edit Allowed IPs' page.
-##|*MATCH=services_captiveportal_ip_edit.php*
+##|*MATCH=services_captiveportal_hostname_edit.php*
##|-PRIV
function allowedhostnamescmp($a, $b) {
@@ -46,9 +46,8 @@ function allowedhostnamescmp($a, $b) {
}
function allowedhostnames_sort() {
- global $g, $config;
-
- usort($config['captiveportal']['allowedhostname'],"allowedhostnamescmp");
+ global $g, $config;
+ usort($config['captiveportal']['allowedhostname'],"allowedhostname");
}
$statusurl = "status_captiveportal.php";
@@ -86,18 +85,18 @@ if ($_POST) {
$pconfig = $_POST;
/* input validation */
- $reqdfields = explode(" ", "ip");
+ $reqdfields = explode(" ", "hostname");
$reqdfieldsn = array(gettext("Allowed Hostname"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
- if (($_POST['hostname'] && !is_hostname($_POST['hostname']))) {
+ if (($_POST['hostname'] && !is_hostname($_POST['hostname'])))
$input_errors[] = sprintf(gettext("A valid Hostname must be specified. [%s]"), $_POST['hostname']);
- }
+
if ($_POST['bw_up'] && !is_numeric($_POST['bw_up']))
- $input_errors[] = gettext("Upload speed needs to be an integer");
- if ($_POST['bw_down'] && !is_numeric($_POST['bw_down']))
- $input_errors[] = gettext("Download speed needs to be an integer");
+ $input_errors[] = gettext("Upload speed needs to be an integer");
+ if ($_POST['bw_down'] && !is_numeric($_POST['bw_down']))
+ $input_errors[] = gettext("Download speed needs to be an integer");
foreach ($a_allowedhostnames as $ipent) {
if (isset($id) && ($a_allowedhostnames[$id]) && ($a_allowedhostnames[$id] === $ipent))
@@ -148,7 +147,7 @@ if ($_POST) {
@unlink("{$g['tmp_path']}/allowedhostname_tmp{$id}");
}
- header("Location: services_captiveportal_ip.php");
+ header("Location: services_captiveportal_hostname.php");
exit;
}
}
@@ -159,7 +158,7 @@ include("head.inc");
<?php include("fbegin.inc"); ?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="services_captiveportal_ip_edit.php" method="post" name="iform" id="iform">
+ <form action="services_captiveportal_hostname_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Direction"); ?></td>
@@ -180,7 +179,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname"); ?></td>
<td width="78%" class="vtable">
- <?=$mandfldhtml;?><input name="ip" type="text" class="formfld unknown" id="ip" size="17" value="<?=htmlspecialchars($pconfig['hostname']);?>">
+ <?=$mandfldhtml;?><input name="hostname" type="text" class="formfld unknown" id="hostname" size="17" value="<?=htmlspecialchars($pconfig['hostname']);?>">
<br>
<span class="vexpl"><?=gettext("Hostname");?>.</span></td>
</tr>
diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php
index 552df63..d636f8a 100755
--- a/usr/local/www/services_captiveportal_ip.php
+++ b/usr/local/www/services_captiveportal_ip.php
@@ -93,7 +93,7 @@ include("head.inc");
$tab_array[] = array(gettext("Captive portal"), false, "services_captiveportal.php");
$tab_array[] = array(gettext("Pass-through MAC"), false, "services_captiveportal_mac.php");
$tab_array[] = array(gettext("Allowed IP addresses"), true, "services_captiveportal_ip.php");
- $tab_array[] = array(gettext("Allowed Hostnames"), true, "services_captiveportal_hostname.php");
+ $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php");
$tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php");
$tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php");
display_top_tabs($tab_array, true);
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php
index 6e57b69..25c250c 100755
--- a/usr/local/www/services_captiveportal_mac.php
+++ b/usr/local/www/services_captiveportal_mac.php
@@ -134,7 +134,7 @@ include("head.inc");
$tab_array[] = array(gettext("Captive portal"), false, "services_captiveportal.php");
$tab_array[] = array(gettext("Pass-through MAC"), true, "services_captiveportal_mac.php");
$tab_array[] = array(gettext("Allowed IP addresses"), false, "services_captiveportal_ip.php");
- $tab_array[] = array(gettext("Allowed Hostnames"), true, "services_captiveportal_hostname.php");
+ $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php");
$tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php");
$tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php");
display_top_tabs($tab_array, true);
diff --git a/usr/local/www/services_captiveportal_vouchers.php b/usr/local/www/services_captiveportal_vouchers.php
index 18e3545..2ad0217 100644
--- a/usr/local/www/services_captiveportal_vouchers.php
+++ b/usr/local/www/services_captiveportal_vouchers.php
@@ -377,7 +377,7 @@ function enable_change(enable_change) {
$tab_array[] = array(gettext("Captive portal"), false, "services_captiveportal.php");
$tab_array[] = array(gettext("Pass-through MAC"), false, "services_captiveportal_mac.php");
$tab_array[] = array(gettext("Allowed IP addresses"), false, "services_captiveportal_ip.php");
- $tab_array[] = array(gettext("Allowed Hostnames"), true, "services_captiveportal_hostname.php");
+ $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php");
$tab_array[] = array(gettext("Vouchers"), true, "services_captiveportal_vouchers.php");
$tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php");
display_top_tabs($tab_array, true);
OpenPOWER on IntegriCloud