diff options
author | Renato Botelho <renato.botelho@bluepex.com> | 2010-08-09 09:54:25 -0300 |
---|---|---|
committer | Renato Botelho <renato.botelho@bluepex.com> | 2010-08-09 09:54:25 -0300 |
commit | c3ff89b45889c4228002807479f9d607fcc98552 (patch) | |
tree | a614ebb692ab312def9d3fea3beaab0cfc4f402d /usr | |
parent | 3dbd3be91272c4fa095c3478ef06a7b004b272ba (diff) | |
parent | c708bdd490c2652ec055b543cc60a7ad391ef63a (diff) | |
download | pfsense-c3ff89b45889c4228002807479f9d607fcc98552.zip pfsense-c3ff89b45889c4228002807479f9d607fcc98552.tar.gz |
Merge remote branch 'mainline/master'
Conflicts:
usr/local/www/status_captiveportal.php
usr/local/www/status_rrd_graph.php
usr/local/www/status_wireless.php
Diffstat (limited to 'usr')
66 files changed, 2528 insertions, 1389 deletions
diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php index 8bcfcf6..33e765a 100755 --- a/usr/local/www/firewall_aliases.php +++ b/usr/local/www/firewall_aliases.php @@ -217,7 +217,7 @@ include("head.inc"); <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><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> </tr> </table> </td> diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php index 9646f52..e768334 100755 --- a/usr/local/www/firewall_nat.php +++ b/usr/local/www/firewall_nat.php @@ -66,13 +66,9 @@ if ($_POST) { $retval = 0; - if(stristr($retval, "error") <> true) - $savemsg = get_std_save_message($retval); - else - $savemsg = $retval; - unlink_if_exists("/tmp/config.cache"); $retval |= filter_configure(); + $savemsg = get_std_save_message($retval); if ($retval == 0) { clear_subsystem_dirty('natconf'); @@ -86,10 +82,11 @@ if ($_GET['act'] == "del") { if ($a_nat[$_GET['id']]) { if (isset($a_nat[$_GET['id']]['associated-rule-id'])) { delete_id($a_nat[$_GET['id']]['associated-rule-id'], $config['filter']['rule']); + mark_subsystem_dirty('filter'); } unset($a_nat[$_GET['id']]); write_config(); - mark_subsystem_dirty('nat'); + mark_subsystem_dirty('natconf'); header("Location: firewall_nat.php"); exit; } @@ -171,13 +168,9 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <?php include("fbegin.inc"); ?> <form action="firewall_nat.php" method="post" name="iform"> <script type="text/javascript" language="javascript" src="/javascript/row_toggle.js"></script> +<?php if ($savemsg) print_info_box($savemsg); ?> <?php if (is_subsystem_dirty('natconf')): ?><p> -<?php - if($savemsg) - print_info_box_np("{$savemsg}<br>" . gettext("The NAT configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect.") ); - else - print_info_box_np( gettext("The NAT configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect.") ); -?> +<?php print_info_box_np(gettext("The NAT configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect."));?><br> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td> @@ -212,7 +205,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <?php if (count($a_nat) == 0): ?> <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0"> <?php else: ?> - <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('Do you really want to delete the selected rules?')"> + <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected rules?");?>')"> <?php endif; ?> </td> <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td> @@ -314,7 +307,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <td><a href="firewall_nat_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit rule"); ?>"></a></td> </tr> <tr> - <td align="center" valign="middle"><a href="firewall_nat.php?act=del&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule");?> onclick="return confirm(<?=gettext('Do you really want to delete this rule?');?>)"></a></td> + <td align="center" valign="middle"><a href="firewall_nat.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this rule?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule");?>"></a></td> <td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new nat based on this one");?>" width="17" height="17" border="0"></a></td> </tr> </table> @@ -335,7 +328,7 @@ echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript <?php if (count($a_nat) == 0): ?> <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0"> <?php else: ?> - <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm(<?=gettext('Do you really want to delete the selected rules?');?>)"> + <input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected rules?");?>')"> <?php endif; ?> </td> <td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td> diff --git a/usr/local/www/firewall_nat_1to1.php b/usr/local/www/firewall_nat_1to1.php index 74e0ce8..96f0819 100755 --- a/usr/local/www/firewall_nat_1to1.php +++ b/usr/local/www/firewall_nat_1to1.php @@ -138,7 +138,7 @@ include("head.inc"); <table border="0" cellspacing="0" cellpadding="1"> <tr> <td valign="middle"><a href="firewall_nat_1to1_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit rule"); ?>"></a></td> - <td valign="middle"><a href="firewall_nat_1to1.php?act=del&id=<?=$i;?>" onclick="return confirm(<?=gettext('Do you really want to delete this mapping?');?>)"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule"); ?>"></a></td> + <td valign="middle"><a href="firewall_nat_1to1.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule"); ?>"></a></td> </tr> </table> </td> diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php index 7a7b807..605876f 100755 --- a/usr/local/www/firewall_nat_edit.php +++ b/usr/local/www/firewall_nat_edit.php @@ -775,19 +775,16 @@ include("fbegin.inc"); ?> <?php $linkedrule = ""; if (is_array($config['filter']['rule'])) { - $filter_id = 0; - foreach ($config['filter']['rule'] as $filter_rule) { + foreach ($config['filter']['rule'] as $filter_id => $filter_rule) { if (isset($filter_rule['associated-rule-id'])) { echo "<option value=\"{$filter_rule['associated-rule-id']}\""; if ($filter_rule['associated-rule-id']==$pconfig['associated-rule-id']) { echo " SELECTED"; - $linkedrule = sprintf("<br /><a href=\"firewall_rules_edit.php?id=%s\">%s</a><br/>", $filter_id, gettext("View the filter rule")); + $linkedrule = "<br /><a href=\"firewall_rules_edit.php?id={$filter_id}\">" . gettext("View the filter rule") . "</a><br/>"; } echo ">". htmlspecialchars('Rule ' . $filter_rule['descr']) . "</option>\n"; } - if ($filter_rule['interface'] == $pconfig['interface']) - $filter_id++; } } if (isset($pconfig['associated-rule-id'])) diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index 2039848..d387385 100755 --- a/usr/local/www/firewall_nat_out.php +++ b/usr/local/www/firewall_nat_out.php @@ -114,16 +114,6 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { $natent['destination']['any'] = true; $natent['staticnatport'] = true; $a_out[] = $natent; - - $natent = array(); - $natent['source']['network'] = "{$osn}/{$ossubnet}"; - $natent['dstport'] = "5060"; - $natent['descr'] = sprintf(gettext("Auto created rule for SIP - %s to %s"),$ifdesc,$ifdesc2); - $natent['target'] = ""; - $natent['interface'] = $if2; - $natent['destination']['any'] = true; - $natent['staticnatport'] = true; - $a_out[] = $natent; $natent = array(); $natent['source']['network'] = "{$osn}/{$ossubnet}"; diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index 19a6cdc..5646247 100755 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -377,15 +377,15 @@ if($_REQUEST['undodrag']) { <tr valign="top" id="frrfc1918"> <td class="list"> </td> <td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11" border="0"></td> - <td class="listlr" style="background-color: #e0e0e0"></td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0"><?=gettext("RFC 1918 networks");?></td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0"></td> + <td class="listlr" style="background-color: #E0E0E0"></td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0"><?=gettext("RFC 1918 networks");?></td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0"></td> <td class="listbg"><?=gettext("Block private networks");?></td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> @@ -405,15 +405,15 @@ if($_REQUEST['undodrag']) { <tr valign="top" id="frrfc1918"> <td class="list"> </td> <td class="listt" align="center"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" width="11" height="11" border="0"></td> - <td class="listlr" style="background-color: #e0e0e0"></td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0"><?=gettext("Reserved/not assigned by IANA");?></td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">*</td> - <td class="listr" style="background-color: #e0e0e0">*</td> + <td class="listlr" style="background-color: #E0E0E0"></td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0"><?=gettext("Reserved/not assigned by IANA");?></td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0">*</td> + <td class="listr" style="background-color: #E0E0E0">*</td> <td class="listbg"><?=gettext("Block bogon networks");?></td> <td valign="middle" nowrap class="list"> <table border="0" cellspacing="0" cellpadding="1"> diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index c91b1a8..26ce56a 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -517,6 +517,7 @@ if ($_POST) { // If we have an associated nat rule, make sure the source and destination doesn't change if( isset($a_filter[$id]['associated-rule-id']) ) { + $filterent['interface'] = $a_filter[$id]['interface']; $filterent['source'] = $a_filter[$id]['source']; $filterent['destination'] = $a_filter[$id]['destination']; $filterent['associated-rule-id'] = $a_filter[$id]['associated-rule-id']; @@ -613,10 +614,16 @@ include("head.inc"); <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td> <td width="78%" class="vtable"> -<?php if ($if == "FloatingRules" || isset($pconfig['floating'])): ?> - <select name="interface[]" multiple="true" class="formselect" size="3"> +<?php $disabled = ""; + if (isset($pconfig['associated-rule-id'])) { + $disabled = "disabled"; + if (!empty($pconfig['interface'])) + echo "<input name='interface' id='interface' type='hidden' value='{$pconfig['interface']}' >"; + } + if ($if == "FloatingRules" || isset($pconfig['floating'])): ?> + <select name="interface[]" multiple="true" class="formselect" size="3" <?=$disabled;?>> <? else: ?> - <select name="interface" class="formselect"> + <select name="interface" class="formselect" <?=$disabled;?>> <?php endif; /* add group interfaces */ diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 605705e..76678b2 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -1,1068 +1,1059 @@ -<?php -/* $Id$ */ -/* - guiconfig.inc - by Scott Ullrich, Copyright 2004, All rights reserved. - originally based on of m0n0wall (http://m0n0.ch/wall) - - Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ -/* - pfSense_MODULE: base -*/ - -/* Include authentication routines */ -/* THIS MUST BE ABOVE ALL OTHER CODE */ -require_once("authgui.inc"); - -/* make sure nothing is cached */ -if (!$omit_nocacheheaders) { - header("Expires: 0"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); -} - -/* parse the configuration and include all configuration functions */ -require_once("functions.inc"); - -/* Pull in all the gui related display classes) */ -foreach (scandir("/usr/local/www/classes/") as $file) { - if (stristr($file, ".inc") !== false) { - require_once("classes/{$file}"); - } -} -/* - * if user has selected a custom template, use it. - * otherwise default to pfsense template - */ -if($config['theme'] <> "") - $g['theme'] = $config['theme']; -else - $g['theme'] = "pfsense"; - -/* - * If this device is an apple ipod/iphone - * switch the theme to one that works with it. - */ -$apple_ua = array("iPhone","iPod", "iPad"); -foreach($apple_ua as $useragent) - if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent)) - $g['theme'] = "pfsense"; - -/* used by progress bar */ -$lastseen = "-1"; - -$navlevelsep = ": "; /* navigation level separator string */ -$mandfldhtml = ""; /* display this before mandatory input fields */ -$mandfldhtmlspc = ""; /* same as above, but with spacing */ - -/* Some ajax scripts still need access to GUI */ -if(!$ignorefirmwarelock) { - if (is_subsystem_dirty('firmwarelock')) { - if (!$d_isfwfile) { - header("Location: system_firmware.php"); - exit; - } else { - return; - } - } -} - -$firewall_rules_dscp_types = array("af11", - "af12", - "af13", - "af21", - "af22", - "af23", - "af31", - "af32", - "af33", - "af41", - "af42", - "af43", - "EF", - "1-64", - "0x10", - "0x04-0xfc"); - -$auth_server_types = array( - 'ldap' => "LDAP", - 'radius' => "Radius"); - -$ldap_urltypes = array( - 'TCP - Standard' => 389, - 'SSL - Encrypted' => 636); - -$ldap_scopes = array( - 'one' => "One Level", - 'subtree' => "Entire Subtree"); - -$ldap_protvers = array( - 2, - 3); - -$ldap_templates = array( - - 'open' => array( - 'desc' => "OpenLDAP", - 'attr_user' => "cn", - 'attr_group' => "cn", - 'attr_member' => "member"), - - 'msad' => array( - 'desc' => "Microsoft AD", - 'attr_user' => "samAccountName", - 'attr_group' => "cn", - 'attr_member' => "memberOf"), - - 'edir' => array( - 'desc' => "Novell eDirectory", - 'attr_user' => "cn", - 'attr_group' => "cn", - 'attr_member' => "uniqueMember")); - -$radius_srvcs = array( - 'both' => "Authentication and Accounting", - 'auth' => "Authentication", - 'acct' => "Accounting"); - -$netbios_nodetypes = array( - '0' => "none", - '1' => "b-node", - '2' => "p-node", - '4' => "m-node", - '5' => "h-node"); - -/* some well knows ports */ -$wkports = array( - 5999 => "CVSup", - 53 => "DNS", - 21 => "FTP", - 3000 => "HBCI", - 80 => "HTTP", - 443 => "HTTPS", - 5190 => "ICQ", - 113 => "IDENT/AUTH", - 143 => "IMAP", - 993 => "IMAP/S", - 4500 => "IPsec NAT-T", - 500 => "ISAKMP", - 1701 => "L2TP", - 389 => "LDAP", - 1755 => "MMS/TCP", - 7000 => "MMS/UDP", - 445 => "MS DS", - 3389 => "MS RDP", - 1512 => "MS WINS", - 1863 => "MSN", - 119 => "NNTP", - 123 => "NTP", - 138 => "NetBIOS-DGM", - 137 => "NetBIOS-NS", - 139 => "NetBIOS-SSN", - 1194 => "OpenVPN", - 110 => "POP3", - 995 => "POP3/S", - 1723 => "PPTP", - 1812 => "RADIUS", - 1813 => "RADIUS accounting", - 5004 => "RTP", - 5060 => "SIP", - 25 => "SMTP", - 465 => "SMTP/S", - 161 => "SNMP", - 162 => "SNMP-Trap", - 22 => "SSH", - 3478 => "STUN", - 3544 => "Teredo", - 23 => "Telnet", - 69 => "TFTP", - 5900 => "VNC"); - -/* TCP flags */ -$tcpflags = array("fin", "syn", "rst", "psh", "ack", "urg"); - -$specialnets = array("pptp" => "PPTP clients", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients"); - -$spiflist = get_configured_interface_with_descr(false, true); -foreach ($spiflist as $ifgui => $ifdesc) { - $specialnets[$ifgui] = $ifdesc . " net"; - $specialnets[$ifgui . 'ip'] = $ifdesc . " address"; -} - -$medias = array("auto" => "autoselect", "100full" => "100BASE-TX full-duplex", - "100half" => "100BASE-TX half-duplex", "10full" => "10BASE-T full-duplex", - "10half" => "10BASE-T half-duplex"); - -$wlan_modes = array("bss" => "Infrastructure (BSS)", "adhoc" => "Ad-hoc (IBSS)", - "hostap" => "Access Point"); - -/* platforms that support firmware updating */ -$fwupplatforms = array('pfSense', 'net45xx', 'net48xx', 'generic-pc', 'embedded', 'wrap', 'nanobsd'); - -function do_input_validation($postdata, $reqdfields, $reqdfieldsn, $input_errors) { - - /* check for bad control characters */ - foreach ($postdata as $pn => $pd) { - if (is_string($pd) && preg_match("/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/", $pd)) { - $input_errors[] = "The field '" . $pn . "' contains invalid characters."; - } - } - - for ($i = 0; $i < count($reqdfields); $i++) { - if ($_POST[$reqdfields[$i]] == "" && $_REQUEST[$reqdfields[$i]] == "") { - $input_errors[] = "The field '" . $reqdfieldsn[$i] . "' is required."; - } - } -} - -function print_input_errors($input_errors) { - global $g; - - print <<<EOF - <p> - <table border="0" cellspacing="0" cellpadding="4" width="100%"> - <tr> - <td class="inputerrorsleft"> - <img src="./themes/{$g['theme']}/images/icons/icon_error.gif"> - </td> - <td class="inputerrorsright"> - <span class="errmsg"><p> - The following input errors were detected: - <ul> -EOF; - foreach ($input_errors as $ierr) { - echo "<li>" . htmlspecialchars($ierr) . "</li>"; - } - - print <<<EOF2 - </ul> - </span> - </td></tr> - </table> - </p> <br> -EOF2; - -} - -function verify_gzip_file($fname) { - - $returnvar = mwexec("/usr/bin/gzip -t " . escapeshellarg($fname)); - if ($returnvar != 0) - return 0; - else - return 1; -} - -function print_info_box_np($msg, $name="apply",$value="Apply changes") { - global $g, $nifty_redbox, $nifty_blackbox, $nifty_background; - - // Set the Nifty background color if one is not set already (defaults to white) - if($nifty_background == "") - $nifty_background = "#FFF"; - - if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) { - $savebutton = "<td class='infoboxsave'>"; - $savebutton .= "<input name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\">"; - if($_POST['if']) - $savebutton .= "<input type='hidden' name='if' value='{$_POST['if']}'>"; - $savebutton.="</td>"; - } - $nifty_redbox = "#990000"; - $nifty_blackbox = "#000000"; - - $themename = $g['theme']; - - if(file_exists("/usr/local/www/themes/{$themename}/tabcontrols.php")) { - $toeval = file_get_contents("/usr/local/www/themes/{$themename}/tabcontrols.php"); - eval($toeval); - } - - if(file_exists("/usr/local/www/themes/{$themename}/infobox.php")) { - $toeval = file_get_contents("/usr/local/www/themes/{$themename}/infobox.php"); - eval($toeval); - } - - if(!$savebutton) { - $savebutton = '<td class="infoboxsave"><input value="Close" type="button" onClick="$(\'redboxtable\').hide();"></td>'; - } - - echo <<<EOFnp - <table class='infobox' id='redboxtable'> - <tr> - <td> - <div class='infoboxnp' id='redbox'> - <table class='infoboxnptable2'> - <tr> - <td class='infoboxnptd'> - <img class='infoboxnpimg' src="/themes/{$g['theme']}/images/icons/icon_exclam.gif" > - </td> - <td class='infoboxnptd2'> - <b>{$msg}</b> - </td> - {$savebutton} - </tr> - </table> - </div> - <div> - <p/> - </div> - </td> - </tr> - </table> - <script type="text/javascript"> - NiftyCheck(); - Rounded("div#redbox","all","{$nifty_background}","{$nifty_redbox}","smooth"); - Rounded("td#blackbox","all","{$nifty_background}","{$nifty_blackbox}","smooth"); - </script> -EOFnp; - -} - -function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $undo) { - global $g; - - if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) { - $savebutton = "<td class='infoboxsave'><nobr>"; - $savebutton .= " <input type=\"button\" value=\"Undo\" onClick=\"document.location='{$undo}'\">"; - $savebutton .= " <input name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\">"; - $savebutton.="</nobr></td>"; - if($_POST['if']) - $savebutton .= "<input type='hidden' name='if' value='{$_POST['if']}'>"; - } - $nifty_redbox = "#990000"; - $nifty_blackbox = "#000000"; - - $themename = $g['theme']; - - if(file_exists("/usr/local/www/themes/{$themename}/tabcontrols.php")) { - $toeval = file_get_contents("/usr/local/www/themes/{$themename}/tabcontrols.php"); - eval($toeval); - } - - if(file_exists("/usr/local/www/themes/{$themename}/infobox.php")) { - $toeval = file_get_contents("/usr/local/www/themes/{$themename}/infobox.php"); - eval($toeval); - } - - - if(!$savebutton) { - $savebutton = '<td class="infoboxsave"><input value="Close" type="button" onClick="$(\'redboxtable\').hide();"></td>'; - } - - echo <<<EOFnp - <table class='infobox' id='redboxtable'> - <tr> - <td> - <div class='infoboxnp' id='redbox'> - <table class='infoboxnptable2'> - <tr> - <td class='infoboxnptd'> - <img class='infoboxnpimg' src="/themes/{$g['theme']}/images/icons/icon_exclam.gif" > - </td> - <td class='infoboxnptd2'> - <b>{$msg}</b> - </td> - {$savebutton} - {$undobutton} - </tr> - </table> - </div> - <div> - <p/> - </div> - </td> - </tr> - </table> - <script type="text/javascript"> - NiftyCheck(); - Rounded("div#redbox","all","#FFF","{$nifty_redbox}","smooth"); - Rounded("td#blackbox","all","#FFF","{$nifty_blackbox}","smooth"); - </script> -EOFnp; - -} - -function print_info_box($msg) { - print_info_box_np($msg); -} - -function get_std_save_message($ok) { - global $d_sysrebootreqd_path; - - return "The changes have been applied successfully. You can also <a href='status_filter_reload.php'>monitor</a> the filter reload progress."; -} - -function pprint_address($adr) { - global $specialnets; - - if (isset($adr['any'])) { - $padr = "*"; - } else if ($adr['network']) { - $padr = $specialnets[$adr['network']]; - } else { - $padr = $adr['address']; - } - - if (isset($adr['not'])) - $padr = "! " . $padr; - - return $padr; -} - -function pprint_port($port) { - global $wkports; - - $pport = ""; - - if (!$port) - return "*"; - else { - $srcport = explode("-", $port); - if ((!$srcport[1]) || ($srcport[0] == $srcport[1])) { - $pport = $srcport[0]; - if ($wkports[$srcport[0]]) { - $pport .= " (" . $wkports[$srcport[0]] . ")"; - } - } else - $pport .= $srcport[0] . " - " . $srcport[1]; - } - - return $pport; -} - -/* sort by interface only, retain the original order of rules that apply to - the same interface */ -function filter_rules_sort() { - global $config; - - /* mark each rule with the sequence number (to retain the order while sorting) */ - for ($i = 0; isset($config['filter']['rule'][$i]); $i++) - $config['filter']['rule'][$i]['seq'] = $i; - - function filtercmp($a, $b) { - if ($a['interface'] == $b['interface']) - return $a['seq'] - $b['seq']; - else - return -strcmp($a['interface'], $b['interface']); - } - - usort($config['filter']['rule'], "filtercmp"); - - /* strip the sequence numbers again */ - for ($i = 0; isset($config['filter']['rule'][$i]); $i++) - unset($config['filter']['rule'][$i]['seq']); -} - -function gentitle($title) { - global $navlevelsep; - if(!is_array($title)) - return $title; - else - return join($navlevelsep, $title); -} - -function genhtmltitle($title) { - global $config; - return gentitle($title); -} - -/* update the changedesc and changecount(er) variables */ -function update_changedesc($update) { - global $changedesc; - global $changecount; - - $changedesc .= " {$update}"; - $changecount++; -} - -function clear_log_file($logfile = "/var/log/system.log") { - global $config, $g; - exec("/usr/bin/killall syslogd"); - if(isset($config['system']['disablesyslogclog'])) { - unlink($logfile); - touch($logfile); - } else { - if(isset($config['system']['usefifolog'])) - exec("/usr/sbin/fifolog_create -s 511488 {$logfile}"); - else - exec("/usr/sbin/clog -i -s 511488 {$logfile}"); - } - system_syslogd_start(); -} - -function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "") { - global $g, $config; - $sor = isset($config['syslog']['reverse']) ? "-r" : ""; - $logarr = ""; - $grepline = " "; - if(is_array($grepfor)) - foreach($grepfor as $agrep) - $grepline .= " | grep \"$agrep\""; - if(is_array($grepinvert)) - foreach($grepinvert as $agrep) - $grepline .= " | grep -v \"$agrep\""; - if(file_exists($logfile) && filesize($logfile) == 0) { - $logarr = array("Log file started."); - } else { - if($config['system']['disablesyslogclog']) { - exec("cat {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr); - } else { - if(isset($config['system']['usefifolog'])) - exec("/usr/sbin/fifolog_reader {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr); - else - exec("/usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail}", $logarr); - } - } - foreach ($logarr as $logent) { - $logent = preg_split("/\s+/", $logent, 6); - echo "<tr valign=\"top\">\n"; - if ($withorig) { - if(isset($config['system']['usefifolog'])) { - $entry_date_time = htmlspecialchars(date("F j, Y, g:i a","" . $logent[1] . "")); - $entry_text = htmlspecialchars($logent[5]); - } else { - $entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3))); - $entry_text = htmlspecialchars($logent[4] . " " . $logent[5]); - } - echo "<td class=\"listlr\" nowrap>{$entry_date_time}</td>\n"; - echo "<td class=\"listr\">{$entry_text}</td>\n"; - - } else { - echo "<td class=\"listlr\" colspan=\"2\">" . htmlspecialchars($logent[5]) . "</td>\n"; - } - echo "</tr>\n"; - } -} - -function return_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "", $grepreverse = false) { - global $g, $config; - $sor = (isset($config['syslog']['reverse']) || $grepreverse) ? "-r" : ""; - $logarr = ""; - $grepline = " "; - if(is_array($grepfor)) - foreach($grepfor as $agrep) - $grepline .= " | grep \"$agrep\""; - if(is_array($grepinvert)) - foreach($grepinvert as $agrep) - $grepline .= " | grep -v \"$agrep\""; - if($config['system']['disablesyslogclog']) { - exec("cat {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr); - } else { - if(isset($config['system']['usefifolog'])) { - exec("/usr/sbin/fifolog_reader {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr); - } else { - exec("/usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail}", $logarr); - } - } - return($logarr); -} - -/* Check if variable has changed, update and log if it has - * returns true if var changed - * varname = variable name in plain text - * orig = original value - * new = new value - */ -function update_if_changed($varname, & $orig, $new) { - if (is_array($orig) && is_array($new)) { - $a_diff = array_diff($orig, $new); - foreach ($a_diff as $diff) { - update_changedesc("removed {$varname}: \"{$diff}\""); - } - $a_diff = array_diff($new, $orig); - foreach ($a_diff as $diff) { - update_changedesc("added {$varname}: \"{$diff}\""); - } - $orig = $new; - return true; - - } else { - if ($orig != $new) { - update_changedesc("{$varname}: \"{$orig}\" -> \"{$new}\""); - $orig = $new; - return true; - } - } - return false; -} - -function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendport) { - - if (isset($adr['any'])) - $padr = "any"; - else if ($adr['network']) - $padr = $adr['network']; - else if ($adr['address']) { - list($padr, $pmask) = explode("/", $adr['address']); - if (!$pmask) - $pmask = 32; - } - - if (isset($adr['not'])) - $pnot = 1; - else - $pnot = 0; - - if ($adr['port']) { - list($pbeginport, $pendport) = explode("-", $adr['port']); - if (!$pendport) - $pendport = $pbeginport; - } else if (!is_alias($pbeginport) && !is_alias($pendport)) { - $pbeginport = "any"; - $pendport = "any"; - } -} - -function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $pendport=0) { - - $adr = array(); - - if ($padr == "any") - $adr['any'] = true; - else if (is_specialnet($padr)) - $adr['network'] = $padr; - else { - $adr['address'] = $padr; - if ($pmask != 32) - $adr['address'] .= "/" . $pmask; - } - - if ($pnot) - $adr['not'] = true; - else - unset($adr['not']); - - if (($pbeginport != 0) && ($pbeginport != "any")) { - if ($pbeginport != $pendport) - $adr['port'] = $pbeginport . "-" . $pendport; - else - $adr['port'] = $pbeginport; - } - - if(is_alias($pbeginport)) { - $adr['port'] = $pbeginport; - } -} - -function is_specialnet($net) { - global $specialsrcdst; - - if(!$net) - return false; - if (in_array($net, $specialsrcdst)) - return true; - else - return false; -} - -//function to create widget tabs when called -function display_widget_tabs(& $tab_array) { - echo "<div id='tabs'>"; - $tabscounter = 0; - foreach ($tab_array as $ta) { - $dashpos = strpos($ta[2],'-'); - $tabname = $ta[2] . "-tab"; - $tabclass = substr($ta[2],0,$dashpos); - $tabclass = $tabclass . "-class"; - if ($ta[1] == true) { - $tabActive = "table-cell"; - $tabNonActive = "none"; - } - else { - $tabActive = "none"; - $tabNonActive = "table-cell"; - } - echo "<div id='{$ta[2]}-active' class='{$tabclass}-tabactive' style='display:{$tabActive}; background-color:#EEEEEE; color:black;'>"; - echo "<B> {$ta[0]}"; - echo " </B>"; - echo "</div>"; - - echo "<div id='{$ta[2]}-deactive' class='{$tabclass}-tabdeactive' style='display:{$tabNonActive}; background-color:#777777; color:white; cursor: pointer;' onClick=\"return changeTabDIV('{$ta[2]}')\">"; - echo "<B> {$ta[0]}"; - echo " </B>"; - echo "</div>"; - } - - echo "<script type=\"text/javascript\">"; - echo "NiftyCheck();\n"; - echo "Rounded(\"div.{$tabclass}-tabactive\",\"top\",\"#CCCCCC\",\"#EEEEEE\",\"smooth\");\n"; - echo "Rounded(\"div.{$tabclass}-tabdeactive\",\"top\",\"#CCCCCC\",\"#777777\",\"smooth\");\n"; - echo "</script>"; - echo "</div>"; -} - - -// Return inline javascript file or CSS to minimizie -// request count going back to server. -function outputJavaScriptFileInline($javascript) { - if(file_exists($javascript)) { - echo "\n<script type=\"text/javascript\">\n"; - include($javascript); - echo "\n</script>\n"; - } else { - echo "\n\n<!-- Could not location file: {$javascript} -->\n\n"; - } -} - - - -function outputCSSPrintFileInline($css) { - if(file_exists($css)) { - echo "\n<style media=\"print\" type=\"text/css\">\n"; - include($css); - echo "\n</style>\n"; - } else { - echo "\n\n<!-- Could not location file: {$css} -->\n\n"; - } -} - - -function outputCSSFileInline($css) { - if(file_exists($css)) { - echo "\n<style type=\"text/css\">\n"; - include($css); - echo "\n</style>\n"; - } else { - echo "\n\n<!-- Could not location file: {$css} -->\n\n"; - } -} - -$rfc2616 = array( - 100 => "100 Continue", - 101 => "101 Switching Protocols", - 200 => "200 OK", - 201 => "201 Created", - 202 => "202 Accepted", - 203 => "203 Non-Authoritative Information", - 204 => "204 No Content", - 205 => "205 Reset Content", - 206 => "206 Partial Content", - 300 => "300 Multiple Choices", - 301 => "301 Moved Permanently", - 302 => "302 Found", - 303 => "303 See Other", - 304 => "304 Not Modified", - 305 => "305 Use Proxy", - 306 => "306 (Unused)", - 307 => "307 Temporary Redirect", - 400 => "400 Bad Request", - 401 => "401 Unauthorized", - 402 => "402 Payment Required", - 403 => "403 Forbidden", - 404 => "404 Not Found", - 405 => "405 Method Not Allowed", - 406 => "406 Not Acceptable", - 407 => "407 Proxy Authentication Required", - 408 => "408 Request Timeout", - 409 => "409 Conflict", - 410 => "410 Gone", - 411 => "411 Length Required", - 412 => "412 Precondition Failed", - 413 => "413 Request Entity Too Large", - 414 => "414 Request-URI Too Long", - 415 => "415 Unsupported Media Type", - 416 => "416 Requested Range Not Satisfiable", - 417 => "417 Expectation Failed", - 500 => "500 Internal Server Error", - 501 => "501 Not Implemented", - 502 => "502 Bad Gateway", - 503 => "503 Service Unavailable", - 504 => "504 Gateway Timeout", - 505 => "505 HTTP Version Not Supported" -); - -function is_rfc2616_code($code) { - global $rfc2616; - if (isset($rfc2616[$code])) - return true; - else - return false; -} - -function print_rfc2616_select($tag, $current){ - global $rfc2616; - - /* Default to 200 OK if not set */ - if ($current == "") - $current = 200; - - echo "<select id=\"{$tag}\" name=\"{$tag}\">\n"; - foreach($rfc2616 as $code => $message) { - if ($code == $current) { - $sel = " selected"; - } else { - $sel = ""; - } - echo "<option value=\"{$code}\"{$sel}>{$message}</option>\n"; - } -} - -// Useful debugging function, much cleaner than print_r -function echo_array($array,$return_me=false){ - if(is_array($array) == false){ - $return = "The provided variable is not an array."; - }else{ - foreach($array as $name=>$value){ - if(is_array($value)){ - $return .= ""; - $return .= "['<b>$name</b>'] {<div style='margin-left:10px;'>\n"; - $return .= echo_array($value,true); - $return .= "</div>}"; - $return .= "\n\n"; - }else{ - if(is_string($value)){ - $value = "\"$value\""; - } - $return .= "['<b>$name</b>'] = $value\n\n"; - } - } - } - if($return_me == true){ - return $return; - }else{ - echo "<pre>".$return."</pre>"; - } -} - -/****f* pfsense-utils/display_top_tabs - * NAME - * display_top_tabs - display tabs with rounded edges - * INPUTS - * $text - array of tabs - * RESULT - * null - ******/ -function display_top_tabs(& $tab_array) { - global $HTTP_SERVER_VARS; - global $config; - global $g; - - /* does the user have access to this tab? - * master user has access to everything. - * if the user does not have access, simply - * unset the tab item. - */ - - $tab_temp = array (); - foreach ($tab_array as $ta) - if(isAllowedPage($ta[2])) - $tab_temp[] = $ta; - /* - // FIXME : if the checks are not good enough - // in isAllowedPage, it needs to be - // fixed instead of kludging here - - // TODO: humm what shall we do with pkg_edit.php and pkg.php? - if ((strpos($link, "pkg.php")) !== false || (strpos($link, "pkg_edit.php")) !== false) { - $pos_equal = strpos($link, "="); - $pos_xmlsuffix = strpos($link, ".xml"); - // do we match an absolute url including ?xml= foo - if(!isAllowedPage($link, $allowed)) - $link = substr($link, $pos_equal +1, ($pos_xmlsuffix - $pos_equal +3)); - } - // next check - what if the basename contains a query string? - if ((strpos($link, "?")) !== false) { - $pos_qmark = strpos($link, "?"); - $link = substr($link, 0, $pos_qmark); - } - $authorized_text = print_r($allowed, true); - if(is_array($authorized)) - if (in_array(basename($link), $authorized)) - */ - - unset ($tab_array); - $tab_array = & $tab_temp; - - $tab_active_bg = "#EEEEEE"; - $tab_inactive_bg = "#777777"; - $nifty_tabs_corners = "#FFF"; - $font_color = "white"; - - /* if tabcontrols.php exist for a theme, allow it to be overriden */ - $themename = $config['theme']; - $filename = "/usr/local/www/themes/{$themename}/tabcontrols.php"; - if(file_exists($filename)) { - $eval_code = file_get_contents($filename); - eval($eval_code); - } - - $tabcharcount = 0; - foreach ($tab_array as $ta) - $tabcharcount = $tabcharcount + strlen($ta[0]); - - // If the character count of the tab names is > 670 - // then show a select item dropdown menubox. - if($tabcharcount > 82) { - echo "Currently viewing: "; - echo "<select name='TabSelect' onchange='tabs_will_go(this)'>\n"; - foreach ($tab_array as $ta) { - if($ta[1]=="true") - $selected = " SELECTED"; - else - $selected = ""; - // Onclick in option will not work in some browser - // echo "<option onClick=\"document.location='{$ta[2]}';\"{$selected}>{$ta['0']}</option>\n"; - echo "<option value=\"{$ta[2]}\"{$selected}>{$ta['0']}</option>\n"; - } - echo "</select>\n<p/>"; - echo "<script type=\"text/javascript\">"; - echo " function tabs_will_go(obj){ document.location = obj.value; }"; - echo "</script>"; - } else { - echo "<table cellpadding='0' cellspacing='0'>\n"; - echo " <tr>\n"; - $tabscounter = 0; - foreach ($tab_array as $ta) { - if ($ta[1] == true) { - echo " <td bgcolor='{$tab_active_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><div id='tabactive'></div></td>\n"; - } else { - echo " <td bgcolor='{$tab_inactive_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><div id='tabdeactive{$tabscounter}'></div></td>\n"; - } - $tabscounter++; - } - echo "</tr>\n<tr>\n"; - foreach ($tab_array as $ta) { - if ($ta[1] == true) { - echo " <td height=\"15\" valign=\"middle\" bgcolor='{$tab_active_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><B> {$ta[0]}"; - echo " "; - echo "<font size='-12'> </font></B></td>\n"; - } else { - echo " <td height=\"15\" valign=\"middle\" bgcolor='{$tab_inactive_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"><B> <a href='{$ta[ -2]}'>"; - echo "<font color='{$font_color}'>{$ta[0]}</font></a> "; - echo "<font size='-12'> </font></B></td>\n"; - } - } - echo "</tr>\n<tr>\n"; - foreach ($tab_array as $ta) { - if ($ta[1] == true) { - echo " <td bgcolor='{$tab_active_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"></td>\n"; - } else { - echo " <td bgcolor='{$tab_inactive_bg}' onClick=\"document.location='{$ta[2]}'\" style=\"cursor: pointer;\"></td>\n"; - } - $tabscounter++; - } - echo " </tr>\n"; - echo "</table>\n"; - echo "<script type=\"text/javascript\">"; - echo "NiftyCheck();\n"; - echo "Rounded(\"div#tabactive\",\"top\",\"{$nifty_tabs_corners}\",\"{$tab_active_bg}\",\"smooth\");\n"; - for ($x = 0; $x < $tabscounter; $x++) - echo "Rounded(\"div#tabdeactive{$x}\",\"top\",\"{$nifty_tabs_corners}\",\"{$tab_inactive_bg}\",\"smooth\");\n"; - echo "</script>"; - } -} - -function add_package_tabs($tabgroup, & $tab_array) { - global $config, $g; - - if(!is_array($config['installedpackages'])) - return; - if(!is_array($config['installedpackages']['tab'])) - return; - - foreach($config['installedpackages']['tab'] as $tab) { - if ($tab['group'] !== $group) - continue; - $tab_entry = array(); - if($tab['name']) { - $tab_entry[] = $tab['name']; - $tab_entry[] = false; - $tab_entry[] = $tab['url']; - $tab_array[] = $tab_entry; - } - } -} - -function rule_popup($src,$srcport,$dst,$dstport){ - global $config; - $aliases_array = array(); - if($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias'])) - { - $span_begin = ""; - $alias_src_span_begin = ""; - $alias_src_span_end = ""; - $alias_src_port_span_begin = ""; - $alias_src_port_span_end = ""; - $alias_dst_span_begin = ""; - $alias_dst_span_end = ""; - $alias_dst_port_span_begin = ""; - $alias_dst_port_span_end = ""; - $alias_content_text = ""; - foreach($config['aliases']['alias'] as $alias_name) - { - $alias_addresses = explode (" ", $alias_name['address']); - $alias_details = explode ("||", $alias_name['detail']); - $alias_objects_with_details = ""; - $counter = 0; - if ($alias_name['url']) { - $alias_objects_with_details .= $alias_name['url'] . "<br/>"; - } - foreach($alias_addresses as $alias_ports_address) - { - $alias_objects_with_details .= $alias_addresses[$counter]; - $alias_detail_default = strpos ($alias_details[$counter],"Entry added"); - if ($alias_details[$counter] != "" && $alias_detail_default === False){ - $alias_objects_with_details .=" - " . $alias_details[$counter]; - } - $alias_objects_with_details .= "<br>"; - $counter++; - } - //max character length for caption field - $maxlength = 60; - - $alias_descr_substr = $alias_name['descr']; - $alias_content_text = htmlspecialchars($alias_objects_with_details); - $alias_caption = htmlspecialchars($alias_descr_substr . ":"); - $strlength = strlen ($alias_caption); - if ($strlength >= $maxlength) - $alias_caption = substr($alias_caption, 0, $maxlength) . "..."; - - $alias_caption_escaped = str_replace("'", "\'", $alias_caption); - $span_begin = "<span style=\"cursor: help;\" onmouseover=\"domTT_activate(this, event, 'content', '<h1>$alias_caption_escaped</h1><p>$alias_content_text</p>', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\" onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\"><U>"; - - if ($alias_name['name'] == $src) - $alias_src_span_begin = $span_begin; - if ($alias_name['name'] == $srcport) - $alias_src_port_span_begin = $span_begin; - if ($alias_name['name'] == $dst) - $alias_dst_span_begin = $span_begin; - if ($alias_name['name'] == $dstport) - $alias_dst_port_span_begin = $span_begin; - } - $descriptions = array (); - $descriptions['src'] = $alias_src_span_begin; - $descriptions['srcport'] = $alias_src_port_span_begin; - $descriptions['dst'] = $alias_dst_span_begin; - $descriptions['dstport'] = $alias_dst_port_span_begin; - - return $descriptions; - } -} - +<?php
+/* $Id$ */
+/*
+ guiconfig.inc
+ by Scott Ullrich, Copyright 2004, All rights reserved.
+ originally based on of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/*
+ pfSense_MODULE: base
+*/
+
+/* Include authentication routines */
+/* THIS MUST BE ABOVE ALL OTHER CODE */
+require_once("authgui.inc");
+
+/* make sure nothing is cached */
+if (!$omit_nocacheheaders) {
+ header("Expires: 0");
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+ header("Cache-Control: no-store, no-cache, must-revalidate");
+ header("Cache-Control: post-check=0, pre-check=0", false);
+ header("Pragma: no-cache");
+}
+
+/* parse the configuration and include all configuration functions */
+require_once("functions.inc");
+
+/* Pull in all the gui related display classes) */
+foreach (scandir("/usr/local/www/classes/") as $file) {
+ if (stristr($file, ".inc") !== false) {
+ require_once("classes/{$file}");
+ }
+}
+/*
+ * if user has selected a custom template, use it.
+ * otherwise default to pfsense template
+ */
+if($config['theme'] <> "")
+ $g['theme'] = $config['theme'];
+else
+ $g['theme'] = "pfsense";
+
+/*
+ * If this device is an apple ipod/iphone
+ * switch the theme to one that works with it.
+ */
+$apple_ua = array("iPhone","iPod", "iPad");
+foreach($apple_ua as $useragent)
+ if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
+ $g['theme'] = "pfsense";
+
+/* used by progress bar */
+$lastseen = "-1";
+
+$navlevelsep = ": "; /* navigation level separator string */
+$mandfldhtml = ""; /* display this before mandatory input fields */
+$mandfldhtmlspc = ""; /* same as above, but with spacing */
+
+/* Some ajax scripts still need access to GUI */
+if(!$ignorefirmwarelock) {
+ if (is_subsystem_dirty('firmwarelock')) {
+ if (!$d_isfwfile) {
+ header("Location: system_firmware.php");
+ exit;
+ } else {
+ return;
+ }
+ }
+}
+
+$firewall_rules_dscp_types = array("af11",
+ "af12",
+ "af13",
+ "af21",
+ "af22",
+ "af23",
+ "af31",
+ "af32",
+ "af33",
+ "af41",
+ "af42",
+ "af43",
+ "EF",
+ "1-64",
+ "0x10",
+ "0x04-0xfc");
+
+$auth_server_types = array(
+ 'ldap' => "LDAP",
+ 'radius' => "Radius");
+
+$ldap_urltypes = array(
+ 'TCP - Standard' => 389,
+ 'SSL - Encrypted' => 636);
+
+$ldap_scopes = array(
+ 'one' => "One Level",
+ 'subtree' => "Entire Subtree");
+
+$ldap_protvers = array(
+ 2,
+ 3);
+
+$ldap_templates = array(
+
+ 'open' => array(
+ 'desc' => "OpenLDAP",
+ 'attr_user' => "cn",
+ 'attr_group' => "cn",
+ 'attr_member' => "member"),
+
+ 'msad' => array(
+ 'desc' => "Microsoft AD",
+ 'attr_user' => "samAccountName",
+ 'attr_group' => "cn",
+ 'attr_member' => "memberOf"),
+
+ 'edir' => array(
+ 'desc' => "Novell eDirectory",
+ 'attr_user' => "cn",
+ 'attr_group' => "cn",
+ 'attr_member' => "uniqueMember"));
+
+$radius_srvcs = array(
+ 'both' => "Authentication and Accounting",
+ 'auth' => "Authentication",
+ 'acct' => "Accounting");
+
+$netbios_nodetypes = array(
+ '0' => "none",
+ '1' => "b-node",
+ '2' => "p-node",
+ '4' => "m-node",
+ '5' => "h-node");
+
+/* some well knows ports */
+$wkports = array(
+ 5999 => "CVSup",
+ 53 => "DNS",
+ 21 => "FTP",
+ 3000 => "HBCI",
+ 80 => "HTTP",
+ 443 => "HTTPS",
+ 5190 => "ICQ",
+ 113 => "IDENT/AUTH",
+ 143 => "IMAP",
+ 993 => "IMAP/S",
+ 4500 => "IPsec NAT-T",
+ 500 => "ISAKMP",
+ 1701 => "L2TP",
+ 389 => "LDAP",
+ 1755 => "MMS/TCP",
+ 7000 => "MMS/UDP",
+ 445 => "MS DS",
+ 3389 => "MS RDP",
+ 1512 => "MS WINS",
+ 1863 => "MSN",
+ 119 => "NNTP",
+ 123 => "NTP",
+ 138 => "NetBIOS-DGM",
+ 137 => "NetBIOS-NS",
+ 139 => "NetBIOS-SSN",
+ 1194 => "OpenVPN",
+ 110 => "POP3",
+ 995 => "POP3/S",
+ 1723 => "PPTP",
+ 1812 => "RADIUS",
+ 1813 => "RADIUS accounting",
+ 5004 => "RTP",
+ 5060 => "SIP",
+ 25 => "SMTP",
+ 465 => "SMTP/S",
+ 161 => "SNMP",
+ 162 => "SNMP-Trap",
+ 22 => "SSH",
+ 3478 => "STUN",
+ 3544 => "Teredo",
+ 23 => "Telnet",
+ 69 => "TFTP",
+ 5900 => "VNC");
+
+/* TCP flags */
+$tcpflags = array("fin", "syn", "rst", "psh", "ack", "urg");
+
+$specialnets = array("pptp" => "PPTP clients", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients");
+
+$spiflist = get_configured_interface_with_descr(false, true);
+foreach ($spiflist as $ifgui => $ifdesc) {
+ $specialnets[$ifgui] = $ifdesc . " net";
+ $specialnets[$ifgui . 'ip'] = $ifdesc . " address";
+}
+
+$medias = array("auto" => "autoselect", "100full" => "100BASE-TX full-duplex",
+ "100half" => "100BASE-TX half-duplex", "10full" => "10BASE-T full-duplex",
+ "10half" => "10BASE-T half-duplex");
+
+$wlan_modes = array("bss" => "Infrastructure (BSS)", "adhoc" => "Ad-hoc (IBSS)",
+ "hostap" => "Access Point");
+
+/* platforms that support firmware updating */
+$fwupplatforms = array('pfSense', 'net45xx', 'net48xx', 'generic-pc', 'embedded', 'wrap', 'nanobsd');
+
+function do_input_validation($postdata, $reqdfields, $reqdfieldsn, $input_errors) {
+
+ /* check for bad control characters */
+ foreach ($postdata as $pn => $pd) {
+ if (is_string($pd) && preg_match("/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/", $pd)) {
+ $input_errors[] = "The field '" . $pn . "' contains invalid characters.";
+ }
+ }
+
+ for ($i = 0; $i < count($reqdfields); $i++) {
+ if ($_POST[$reqdfields[$i]] == "" && $_REQUEST[$reqdfields[$i]] == "") {
+ $input_errors[] = "The field '" . $reqdfieldsn[$i] . "' is required.";
+ }
+ }
+}
+
+function print_input_errors($input_errors) {
+ global $g;
+
+ print <<<EOF
+ <p>
+ <table border="0" cellspacing="0" cellpadding="4" width="100%">
+ <tr>
+ <td class="inputerrorsleft">
+ <img src="./themes/{$g['theme']}/images/icons/icon_error.gif">
+ </td>
+ <td class="inputerrorsright">
+ <span class="errmsg"><p>
+ The following input errors were detected:
+ <ul>
+EOF;
+ foreach ($input_errors as $ierr) {
+ echo "<li>" . htmlspecialchars($ierr) . "</li>";
+ }
+
+ print <<<EOF2
+ </ul>
+ </span>
+ </td></tr>
+ </table>
+ </p> <br>
+EOF2;
+
+}
+
+function verify_gzip_file($fname) {
+
+ $returnvar = mwexec("/usr/bin/gzip -t " . escapeshellarg($fname));
+ if ($returnvar != 0)
+ return 0;
+ else
+ return 1;
+}
+
+function print_info_box_np($msg, $name="apply",$value="Apply changes") {
+ global $g, $nifty_redbox, $nifty_blackbox, $nifty_background;
+
+ // Set the Nifty background color if one is not set already (defaults to white)
+ if($nifty_background == "")
+ $nifty_background = "#FFF";
+
+ if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) {
+ $savebutton = "<td class='infoboxsave'>";
+ $savebutton .= "<input name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\">";
+ if($_POST['if'])
+ $savebutton .= "<input type='hidden' name='if' value='{$_POST['if']}'>";
+ $savebutton.="</td>";
+ }
+ $nifty_redbox = "#990000";
+ $nifty_blackbox = "#000000";
+
+ $themename = $g['theme'];
+
+ if(file_exists("/usr/local/www/themes/{$themename}/tabcontrols.php")) {
+ $toeval = file_get_contents("/usr/local/www/themes/{$themename}/tabcontrols.php");
+ eval($toeval);
+ }
+
+ if(file_exists("/usr/local/www/themes/{$themename}/infobox.php")) {
+ $toeval = file_get_contents("/usr/local/www/themes/{$themename}/infobox.php");
+ eval($toeval);
+ }
+
+ if(!$savebutton) {
+ $savebutton = '<td class="infoboxsave"><input value="Close" type="button" onClick="$(\'redboxtable\').hide();"></td>';
+ }
+
+ echo <<<EOFnp
+ <table class='infobox' id='redboxtable'>
+ <tr>
+ <td>
+ <div class='infoboxnp' id='redbox'>
+ <table class='infoboxnptable2'>
+ <tr>
+ <td class='infoboxnptd'>
+ <img class='infoboxnpimg' src="/themes/{$g['theme']}/images/icons/icon_exclam.gif" >
+ </td>
+ <td class='infoboxnptd2'>
+ <b>{$msg}</b>
+ </td>
+ {$savebutton}
+ </tr>
+ </table>
+ </div>
+ <div>
+ <p/>
+ </div>
+ </td>
+ </tr>
+ </table>
+ <script type="text/javascript">
+ NiftyCheck();
+ Rounded("div#redbox","all","{$nifty_background}","{$nifty_redbox}","smooth");
+ Rounded("td#blackbox","all","{$nifty_background}","{$nifty_blackbox}","smooth");
+ </script>
+EOFnp;
+
+}
+
+function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $undo) {
+ global $g;
+
+ if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) {
+ $savebutton = "<td class='infoboxsave'><nobr>";
+ $savebutton .= " <input type=\"button\" value=\"Undo\" onClick=\"document.location='{$undo}'\">";
+ $savebutton .= " <input name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\">";
+ $savebutton.="</nobr></td>";
+ if($_POST['if'])
+ $savebutton .= "<input type='hidden' name='if' value='{$_POST['if']}'>";
+ }
+ $nifty_redbox = "#990000";
+ $nifty_blackbox = "#000000";
+
+ $themename = $g['theme'];
+
+ if(file_exists("/usr/local/www/themes/{$themename}/tabcontrols.php")) {
+ $toeval = file_get_contents("/usr/local/www/themes/{$themename}/tabcontrols.php");
+ eval($toeval);
+ }
+
+ if(file_exists("/usr/local/www/themes/{$themename}/infobox.php")) {
+ $toeval = file_get_contents("/usr/local/www/themes/{$themename}/infobox.php");
+ eval($toeval);
+ }
+
+
+ if(!$savebutton) {
+ $savebutton = '<td class="infoboxsave"><input value="Close" type="button" onClick="$(\'redboxtable\').hide();"></td>';
+ }
+
+ echo <<<EOFnp
+ <table class='infobox' id='redboxtable'>
+ <tr>
+ <td>
+ <div class='infoboxnp' id='redbox'>
+ <table class='infoboxnptable2'>
+ <tr>
+ <td class='infoboxnptd'>
+ <img class='infoboxnpimg' src="/themes/{$g['theme']}/images/icons/icon_exclam.gif" >
+ </td>
+ <td class='infoboxnptd2'>
+ <b>{$msg}</b>
+ </td>
+ {$savebutton}
+ {$undobutton}
+ </tr>
+ </table>
+ </div>
+ <div>
+ <p/>
+ </div>
+ </td>
+ </tr>
+ </table>
+ <script type="text/javascript">
+ NiftyCheck();
+ Rounded("div#redbox","all","#FFF","{$nifty_redbox}","smooth");
+ Rounded("td#blackbox","all","#FFF","{$nifty_blackbox}","smooth");
+ </script>
+EOFnp;
+
+}
+
+function print_info_box($msg) {
+ print_info_box_np($msg);
+}
+
+function get_std_save_message($ok) {
+ global $d_sysrebootreqd_path;
+
+ return "The changes have been applied successfully. You can also <a href='status_filter_reload.php'>monitor</a> the filter reload progress.";
+}
+
+function pprint_address($adr) {
+ global $specialnets;
+
+ if (isset($adr['any'])) {
+ $padr = "*";
+ } else if ($adr['network']) {
+ $padr = $specialnets[$adr['network']];
+ } else {
+ $padr = $adr['address'];
+ }
+
+ if (isset($adr['not']))
+ $padr = "! " . $padr;
+
+ return $padr;
+}
+
+function pprint_port($port) {
+ global $wkports;
+
+ $pport = "";
+
+ if (!$port)
+ return "*";
+ else {
+ $srcport = explode("-", $port);
+ if ((!$srcport[1]) || ($srcport[0] == $srcport[1])) {
+ $pport = $srcport[0];
+ if ($wkports[$srcport[0]]) {
+ $pport .= " (" . $wkports[$srcport[0]] . ")";
+ }
+ } else
+ $pport .= $srcport[0] . " - " . $srcport[1];
+ }
+
+ return $pport;
+}
+
+/* sort by interface only, retain the original order of rules that apply to
+ the same interface */
+function filter_rules_sort() {
+ global $config;
+
+ /* mark each rule with the sequence number (to retain the order while sorting) */
+ for ($i = 0; isset($config['filter']['rule'][$i]); $i++)
+ $config['filter']['rule'][$i]['seq'] = $i;
+
+ function filtercmp($a, $b) {
+ if ($a['interface'] == $b['interface'])
+ return $a['seq'] - $b['seq'];
+ else
+ return -strcmp($a['interface'], $b['interface']);
+ }
+
+ usort($config['filter']['rule'], "filtercmp");
+
+ /* strip the sequence numbers again */
+ for ($i = 0; isset($config['filter']['rule'][$i]); $i++)
+ unset($config['filter']['rule'][$i]['seq']);
+}
+
+function gentitle($title) {
+ global $navlevelsep;
+ if(!is_array($title))
+ return $title;
+ else
+ return join($navlevelsep, $title);
+}
+
+function genhtmltitle($title) {
+ global $config;
+ return gentitle($title);
+}
+
+/* update the changedesc and changecount(er) variables */
+function update_changedesc($update) {
+ global $changedesc;
+ global $changecount;
+
+ $changedesc .= " {$update}";
+ $changecount++;
+}
+
+function clear_log_file($logfile = "/var/log/system.log") {
+ global $config, $g;
+ exec("/usr/bin/killall syslogd");
+ if(isset($config['system']['disablesyslogclog'])) {
+ unlink($logfile);
+ touch($logfile);
+ } else {
+ if(isset($config['system']['usefifolog']))
+ exec("/usr/sbin/fifolog_create -s 511488 {$logfile}");
+ else
+ exec("/usr/sbin/clog -i -s 511488 {$logfile}");
+ }
+ system_syslogd_start();
+}
+
+function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "") {
+ global $g, $config;
+ $sor = isset($config['syslog']['reverse']) ? "-r" : "";
+ $logarr = "";
+ $grepline = " ";
+ if(is_array($grepfor))
+ foreach($grepfor as $agrep)
+ $grepline .= " | grep \"$agrep\"";
+ if(is_array($grepinvert))
+ foreach($grepinvert as $agrep)
+ $grepline .= " | grep -v \"$agrep\"";
+ if(file_exists($logfile) && filesize($logfile) == 0) {
+ $logarr = array("Log file started.");
+ } else {
+ if($config['system']['disablesyslogclog']) {
+ exec("cat {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
+ } else {
+ if(isset($config['system']['usefifolog']))
+ exec("/usr/sbin/fifolog_reader {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
+ else
+ exec("/usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail}", $logarr);
+ }
+ }
+ foreach ($logarr as $logent) {
+ $logent = preg_split("/\s+/", $logent, 6);
+ echo "<tr valign=\"top\">\n";
+ if ($withorig) {
+ if(isset($config['system']['usefifolog'])) {
+ $entry_date_time = htmlspecialchars(date("F j, Y, g:i a","" . $logent[1] . ""));
+ $entry_text = htmlspecialchars($logent[5]);
+ } else {
+ $entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3)));
+ $entry_text = htmlspecialchars($logent[4] . " " . $logent[5]);
+ }
+ echo "<td class=\"listlr\" nowrap>{$entry_date_time}</td>\n";
+ echo "<td class=\"listr\">{$entry_text}</td>\n";
+
+ } else {
+ echo "<td class=\"listlr\" colspan=\"2\">" . htmlspecialchars($logent[5]) . "</td>\n";
+ }
+ echo "</tr>\n";
+ }
+}
+
+function return_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert = "", $grepreverse = false) {
+ global $g, $config;
+ $sor = (isset($config['syslog']['reverse']) || $grepreverse) ? "-r" : "";
+ $logarr = "";
+ $grepline = " ";
+ if(is_array($grepfor))
+ foreach($grepfor as $agrep)
+ $grepline .= " | grep \"$agrep\"";
+ if(is_array($grepinvert))
+ foreach($grepinvert as $agrep)
+ $grepline .= " | grep -v \"$agrep\"";
+ if($config['system']['disablesyslogclog']) {
+ exec("cat {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
+ } else {
+ if(isset($config['system']['usefifolog'])) {
+ exec("/usr/sbin/fifolog_reader {$logfile}{$grepline} | /usr/bin/tail {$sor} -n {$tail}", $logarr);
+ } else {
+ exec("/usr/sbin/clog {$logfile}{$grepline}| grep -v \"CLOG\" | grep -v \"\033\" | /usr/bin/tail {$sor} -n {$tail}", $logarr);
+ }
+ }
+ return($logarr);
+}
+
+/* Check if variable has changed, update and log if it has
+ * returns true if var changed
+ * varname = variable name in plain text
+ * orig = original value
+ * new = new value
+ */
+function update_if_changed($varname, & $orig, $new) {
+ if (is_array($orig) && is_array($new)) {
+ $a_diff = array_diff($orig, $new);
+ foreach ($a_diff as $diff) {
+ update_changedesc("removed {$varname}: \"{$diff}\"");
+ }
+ $a_diff = array_diff($new, $orig);
+ foreach ($a_diff as $diff) {
+ update_changedesc("added {$varname}: \"{$diff}\"");
+ }
+ $orig = $new;
+ return true;
+
+ } else {
+ if ($orig != $new) {
+ update_changedesc("{$varname}: \"{$orig}\" -> \"{$new}\"");
+ $orig = $new;
+ return true;
+ }
+ }
+ return false;
+}
+
+function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendport) {
+
+ if (isset($adr['any']))
+ $padr = "any";
+ else if ($adr['network'])
+ $padr = $adr['network'];
+ else if ($adr['address']) {
+ list($padr, $pmask) = explode("/", $adr['address']);
+ if (!$pmask)
+ $pmask = 32;
+ }
+
+ if (isset($adr['not']))
+ $pnot = 1;
+ else
+ $pnot = 0;
+
+ if ($adr['port']) {
+ list($pbeginport, $pendport) = explode("-", $adr['port']);
+ if (!$pendport)
+ $pendport = $pbeginport;
+ } else if (!is_alias($pbeginport) && !is_alias($pendport)) {
+ $pbeginport = "any";
+ $pendport = "any";
+ }
+}
+
+function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $pendport=0) {
+
+ $adr = array();
+
+ if ($padr == "any")
+ $adr['any'] = true;
+ else if (is_specialnet($padr))
+ $adr['network'] = $padr;
+ else {
+ $adr['address'] = $padr;
+ if ($pmask != 32)
+ $adr['address'] .= "/" . $pmask;
+ }
+
+ if ($pnot)
+ $adr['not'] = true;
+ else
+ unset($adr['not']);
+
+ if (($pbeginport != 0) && ($pbeginport != "any")) {
+ if ($pbeginport != $pendport)
+ $adr['port'] = $pbeginport . "-" . $pendport;
+ else
+ $adr['port'] = $pbeginport;
+ }
+
+ if(is_alias($pbeginport)) {
+ $adr['port'] = $pbeginport;
+ }
+}
+
+function is_specialnet($net) {
+ global $specialsrcdst;
+
+ if(!$net)
+ return false;
+ if (in_array($net, $specialsrcdst))
+ return true;
+ else
+ return false;
+}
+
+//function to create widget tabs when called
+function display_widget_tabs(& $tab_array) {
+ echo "<div id='tabs'>";
+ $tabscounter = 0;
+ foreach ($tab_array as $ta) {
+ $dashpos = strpos($ta[2],'-');
+ $tabname = $ta[2] . "-tab";
+ $tabclass = substr($ta[2],0,$dashpos);
+ $tabclass = $tabclass . "-class";
+ if ($ta[1] == true) {
+ $tabActive = "table-cell";
+ $tabNonActive = "none";
+ }
+ else {
+ $tabActive = "none";
+ $tabNonActive = "table-cell";
+ }
+ echo "<div id='{$ta[2]}-active' class='{$tabclass}-tabactive' style='display:{$tabActive}; background-color:#EEEEEE; color:black;'>";
+ echo "<B> {$ta[0]}";
+ echo " </B>";
+ echo "</div>";
+
+ echo "<div id='{$ta[2]}-deactive' class='{$tabclass}-tabdeactive' style='display:{$tabNonActive}; background-color:#777777; color:white; cursor: pointer;' onClick=\"return changeTabDIV('{$ta[2]}')\">";
+ echo "<B> {$ta[0]}";
+ echo " </B>";
+ echo "</div>";
+ }
+
+ echo "<script type=\"text/javascript\">";
+ echo "NiftyCheck();\n";
+ echo "Rounded(\"div.{$tabclass}-tabactive\",\"top\",\"#CCCCCC\",\"#EEEEEE\",\"smooth\");\n";
+ echo "Rounded(\"div.{$tabclass}-tabdeactive\",\"top\",\"#CCCCCC\",\"#777777\",\"smooth\");\n";
+ echo "</script>";
+ echo "</div>";
+}
+
+
+// Return inline javascript file or CSS to minimizie
+// request count going back to server.
+function outputJavaScriptFileInline($javascript) {
+ if(file_exists($javascript)) {
+ echo "\n<script type=\"text/javascript\">\n";
+ include($javascript);
+ echo "\n</script>\n";
+ } else {
+ echo "\n\n<!-- Could not location file: {$javascript} -->\n\n";
+ }
+}
+
+
+
+function outputCSSPrintFileInline($css) {
+ if(file_exists($css)) {
+ echo "\n<style media=\"print\" type=\"text/css\">\n";
+ include($css);
+ echo "\n</style>\n";
+ } else {
+ echo "\n\n<!-- Could not location file: {$css} -->\n\n";
+ }
+}
+
+
+function outputCSSFileInline($css) {
+ if(file_exists($css)) {
+ echo "\n<style type=\"text/css\">\n";
+ include($css);
+ echo "\n</style>\n";
+ } else {
+ echo "\n\n<!-- Could not location file: {$css} -->\n\n";
+ }
+}
+
+$rfc2616 = array(
+ 100 => "100 Continue",
+ 101 => "101 Switching Protocols",
+ 200 => "200 OK",
+ 201 => "201 Created",
+ 202 => "202 Accepted",
+ 203 => "203 Non-Authoritative Information",
+ 204 => "204 No Content",
+ 205 => "205 Reset Content",
+ 206 => "206 Partial Content",
+ 300 => "300 Multiple Choices",
+ 301 => "301 Moved Permanently",
+ 302 => "302 Found",
+ 303 => "303 See Other",
+ 304 => "304 Not Modified",
+ 305 => "305 Use Proxy",
+ 306 => "306 (Unused)",
+ 307 => "307 Temporary Redirect",
+ 400 => "400 Bad Request",
+ 401 => "401 Unauthorized",
+ 402 => "402 Payment Required",
+ 403 => "403 Forbidden",
+ 404 => "404 Not Found",
+ 405 => "405 Method Not Allowed",
+ 406 => "406 Not Acceptable",
+ 407 => "407 Proxy Authentication Required",
+ 408 => "408 Request Timeout",
+ 409 => "409 Conflict",
+ 410 => "410 Gone",
+ 411 => "411 Length Required",
+ 412 => "412 Precondition Failed",
+ 413 => "413 Request Entity Too Large",
+ 414 => "414 Request-URI Too Long",
+ 415 => "415 Unsupported Media Type",
+ 416 => "416 Requested Range Not Satisfiable",
+ 417 => "417 Expectation Failed",
+ 500 => "500 Internal Server Error",
+ 501 => "501 Not Implemented",
+ 502 => "502 Bad Gateway",
+ 503 => "503 Service Unavailable",
+ 504 => "504 Gateway Timeout",
+ 505 => "505 HTTP Version Not Supported"
+);
+
+function is_rfc2616_code($code) {
+ global $rfc2616;
+ if (isset($rfc2616[$code]))
+ return true;
+ else
+ return false;
+}
+
+function print_rfc2616_select($tag, $current){
+ global $rfc2616;
+
+ /* Default to 200 OK if not set */
+ if ($current == "")
+ $current = 200;
+
+ echo "<select id=\"{$tag}\" name=\"{$tag}\">\n";
+ foreach($rfc2616 as $code => $message) {
+ if ($code == $current) {
+ $sel = " selected";
+ } else {
+ $sel = "";
+ }
+ echo "<option value=\"{$code}\"{$sel}>{$message}</option>\n";
+ }
+}
+
+// Useful debugging function, much cleaner than print_r
+function echo_array($array,$return_me=false){
+ if(is_array($array) == false){
+ $return = "The provided variable is not an array.";
+ }else{
+ foreach($array as $name=>$value){
+ if(is_array($value)){
+ $return .= "";
+ $return .= "['<b>$name</b>'] {<div style='margin-left:10px;'>\n";
+ $return .= echo_array($value,true);
+ $return .= "</div>}";
+ $return .= "\n\n";
+ }else{
+ if(is_string($value)){
+ $value = "\"$value\"";
+ }
+ $return .= "['<b>$name</b>'] = $value\n\n";
+ }
+ }
+ }
+ if($return_me == true){
+ return $return;
+ }else{
+ echo "<pre>".$return."</pre>";
+ }
+}
+
+/****f* pfsense-utils/display_top_tabs
+ * NAME
+ * display_top_tabs - display tabs with rounded edges
+ * INPUTS
+ * $text - array of tabs
+ * RESULT
+ * null
+ ******/
+function display_top_tabs(& $tab_array) {
+ global $HTTP_SERVER_VARS;
+ global $config;
+ global $g;
+ global $tab_array_indent;
+ global $tab_array_space;
+ global $tab_array_char_limit;
+
+ /* does the user have access to this tab?
+ * master user has access to everything.
+ * if the user does not have access, simply
+ * unset the tab item.
+ */
+
+ /* empty string code */
+ if ($tab_array_indent == '')
+ {
+ $tab_array_indent = 0;
+ }
+ if ($tab_array_space == '')
+ {
+ $tab_array_space = 1;
+ }
+ if ($tab_array_char_limit == '')
+ {
+ $tab_array_char_limit = 82;
+ }
+
+ $tab_temp = array ();
+ foreach ($tab_array as $ta)
+ if(isAllowedPage($ta[2]))
+ $tab_temp[] = $ta;
+ /*
+ // FIXME : if the checks are not good enough
+ // in isAllowedPage, it needs to be
+ // fixed instead of kludging here
+
+ // TODO: humm what shall we do with pkg_edit.php and pkg.php?
+ if ((strpos($link, "pkg.php")) !== false || (strpos($link, "pkg_edit.php")) !== false) {
+ $pos_equal = strpos($link, "=");
+ $pos_xmlsuffix = strpos($link, ".xml");
+ // do we match an absolute url including ?xml= foo
+ if(!isAllowedPage($link, $allowed))
+ $link = substr($link, $pos_equal +1, ($pos_xmlsuffix - $pos_equal +3));
+ }
+ // next check - what if the basename contains a query string?
+ if ((strpos($link, "?")) !== false) {
+ $pos_qmark = strpos($link, "?");
+ $link = substr($link, 0, $pos_qmark);
+ }
+ $authorized_text = print_r($allowed, true);
+ if(is_array($authorized))
+ if (in_array(basename($link), $authorized))
+ */
+
+ unset ($tab_array);
+ $tab_array = & $tab_temp;
+
+ $tab_active_bg = "#EEEEEE";
+ $tab_inactive_bg = "#777777";
+ $nifty_tabs_corners = "#FFF";
+ $font_color = "white";
+
+ /* if tabcontrols.php exist for a theme, allow it to be overriden */
+ $themename = $config['theme'];
+ $filename = "/usr/local/www/themes/{$themename}/tabcontrols.php";
+ if(file_exists($filename)) {
+ $eval_code = file_get_contents($filename);
+ eval($eval_code);
+ }
+
+ $tabcharcount = 0;
+ foreach ($tab_array as $ta)
+ $tabcharcount = $tabcharcount + strlen($ta[0]);
+
+ // If the character count of the tab names is > 670
+ // then show a select item dropdown menubox.
+ if($tabcharcount > $tab_array_char_limit) {
+ echo "Currently viewing: ";
+ echo "<select name='TabSelect' onchange='tabs_will_go(this)'>\n";
+ foreach ($tab_array as $ta) {
+ if($ta[1]=="true")
+ $selected = " SELECTED";
+ else
+ $selected = "";
+ // Onclick in option will not work in some browser
+ // echo "<option onClick=\"document.location='{$ta[2]}';\"{$selected}>{$ta['0']}</option>\n";
+ echo "<option value=\"{$ta[2]}\"{$selected}>{$ta['0']}</option>\n";
+ }
+ echo "</select>\n<p/>";
+ echo "<script type=\"text/javascript\">";
+ 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";
+ $tabscounter = 0;
+ foreach ($tab_array as $ta) {
+ if ($ta[1] == true) {
+ echo " <li class=\"newtabmenu_active\"><a href=\"{$ta[2]}\"><span>{$ta[0]}</span></a></li>\n";
+ } else {
+ echo " <li><a href=\"{$ta[2]}\"><span>{$ta[0]}</span></a></li>\n";
+ }
+ $tabscounter++;
+ }
+ echo "</ul>\n</div>\n";
+ ////////>>>>
+ }
+}
+
+function add_package_tabs($tabgroup, & $tab_array) {
+ global $config, $g;
+
+ if(!is_array($config['installedpackages']))
+ return;
+ if(!is_array($config['installedpackages']['tab']))
+ return;
+
+ foreach($config['installedpackages']['tab'] as $tab) {
+ if ($tab['group'] !== $group)
+ continue;
+ $tab_entry = array();
+ if($tab['name']) {
+ $tab_entry[] = $tab['name'];
+ $tab_entry[] = false;
+ $tab_entry[] = $tab['url'];
+ $tab_array[] = $tab_entry;
+ }
+ }
+}
+
+function rule_popup($src,$srcport,$dst,$dstport){
+ global $config;
+ $aliases_array = array();
+ if($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias']))
+ {
+ $span_begin = "";
+ $alias_src_span_begin = "";
+ $alias_src_span_end = "";
+ $alias_src_port_span_begin = "";
+ $alias_src_port_span_end = "";
+ $alias_dst_span_begin = "";
+ $alias_dst_span_end = "";
+ $alias_dst_port_span_begin = "";
+ $alias_dst_port_span_end = "";
+ $alias_content_text = "";
+ foreach($config['aliases']['alias'] as $alias_name)
+ {
+ $alias_addresses = explode (" ", $alias_name['address']);
+ $alias_details = explode ("||", $alias_name['detail']);
+ $alias_objects_with_details = "";
+ $counter = 0;
+ if ($alias_name['url']) {
+ $alias_objects_with_details .= $alias_name['url'] . "<br/>";
+ }
+ foreach($alias_addresses as $alias_ports_address)
+ {
+ $alias_objects_with_details .= $alias_addresses[$counter];
+ $alias_detail_default = strpos ($alias_details[$counter],"Entry added");
+ if ($alias_details[$counter] != "" && $alias_detail_default === False){
+ $alias_objects_with_details .=" - " . $alias_details[$counter];
+ }
+ $alias_objects_with_details .= "<br>";
+ $counter++;
+ }
+ //max character length for caption field
+ $maxlength = 60;
+
+ $alias_descr_substr = $alias_name['descr'];
+ $alias_content_text = htmlspecialchars($alias_objects_with_details);
+ $alias_caption = htmlspecialchars($alias_descr_substr . ":");
+ $strlength = strlen ($alias_caption);
+ if ($strlength >= $maxlength)
+ $alias_caption = substr($alias_caption, 0, $maxlength) . "...";
+
+ $alias_caption_escaped = str_replace("'", "\'", $alias_caption);
+ $span_begin = "<span style=\"cursor: help;\" onmouseover=\"domTT_activate(this, event, 'content', '<h1>$alias_caption_escaped</h1><p>$alias_content_text</p>', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\" onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\"><U>";
+
+ if ($alias_name['name'] == $src)
+ $alias_src_span_begin = $span_begin;
+ if ($alias_name['name'] == $srcport)
+ $alias_src_port_span_begin = $span_begin;
+ if ($alias_name['name'] == $dst)
+ $alias_dst_span_begin = $span_begin;
+ if ($alias_name['name'] == $dstport)
+ $alias_dst_port_span_begin = $span_begin;
+ }
+ $descriptions = array ();
+ $descriptions['src'] = $alias_src_span_begin;
+ $descriptions['srcport'] = $alias_src_port_span_begin;
+ $descriptions['dst'] = $alias_dst_span_begin;
+ $descriptions['dstport'] = $alias_dst_port_span_begin;
+
+ return $descriptions;
+ }
+}
+
?>
\ No newline at end of file diff --git a/usr/local/www/head.inc b/usr/local/www/head.inc index 076f274..3bc1e25 100755 --- a/usr/local/www/head.inc +++ b/usr/local/www/head.inc @@ -1,92 +1,93 @@ -<?php -/* - pfSense_MODULE: header -*/ - -/* - * if user has selected a custom template, use it. - * otherwise default to pfsense tempalte - */ -if($config['theme'] <> "") - $g['theme'] = $config['theme']; -else - $g['theme'] = "pfsense"; - -/* - * If this device is an apple ipod/iphone - * switch the theme to one that works with it. - */ -$apple_ua = array("iPhone","iPod", "iPad"); -foreach($apple_ua as $useragent) - if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent)) - $g['theme'] = "pfsense"; - -$pagetitle = gentitle( $pgtitle ); - -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html> -<head> - <title><?php echo($config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pagetitle); ?></title> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> - <link rel="apple-touch-icon" href="/themes/<?php echo $g['theme']; ?>/apple-touch-icon.png"/> - <?php if (strpos($_SERVER["SCRIPT_FILENAME"], "wizard.php") !== false && - file_exists("{$g['www_path']}/themes/{$g['theme']}/wizard.css")): ?> - <?php echo "<style type=\"text/css\" src=\"/themes/{$g['theme']}/wizard.css\"></style>"; ?> - <?php else: ?> - <link rel="stylesheet" href="/themes/<?php echo $g['theme']; ?>/all.css" media="all" /> - <?php endif; ?> - <link rel="stylesheet" type="text/css" href="/niftycssCode.css"> - <link rel="stylesheet" type="text/css" href="/niftycssprintCode.css" media="print"> - <script type="text/javascript" src="/javascript/niftyjsCode.js"></script> - <script type="text/javascript"> - var theme = "<?php echo $g['theme']; ?>"; - </script> - <?php echo "\t<script type=\"text/javascript\" src=\"/themes/{$g['theme']}/loader.js\"></script>\n"; ?> -<?php - if($_GET['enablefirebuglite']) { - echo "\t<script type=\"text/javascript\" src=\"/javascript/pi.js\"></script>\n"; - echo "\t<script type=\"text/javascript\" src=\"/javascript/firebug-lite.js\"></script>\n"; - } - echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/prototype.js\"></script>\n"; - echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/scriptaculous.js\"></script>\n"; - echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/effects.js\"></script>\n"; - echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/dragdrop.js\"></script>\n"; - if(file_exists("{$g['www_path']}/javascript/global.js")) - echo "\t<script type=\"text/javascript\" src=\"/javascript/global.js\"></script>\n"; - /* - * Find all javascript files that need to be included - * for this page ... from the arrays ... :) - * Coded by: Erik Kristensen - */ - - $dir = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php'); - $path = "{$g['www_path']}/javascript/" . $dir . "/"; - if (is_dir($path)) { - if ($dh = opendir($path)) { - while (($file = readdir($dh)) !== false) { - if (is_dir($file)) - continue; - echo "\t<script type=\"text/javascript\" src=\"/javascript/{$dir}/{$file}\"></script>\n"; - } - closedir($dh); - } - } - -if (!isset($closehead)) - echo "</head>"; - -/* If this page is being remotely managed then do not allow the loading of the contents. */ -if($config['remote_managed_pages']['item']) { - foreach($config['remote_managed_pages']['item'] as $rmp) { - if($rmp == $_SERVER['SCRIPT_NAME']) { - include("fbegin.inc"); - print_info_box_np("This page is currently being managed by a remote machine."); - include("fend.inc"); - exit; - } - } -} - +<?php
+/*
+ pfSense_MODULE: header
+*/
+
+/*
+ * if user has selected a custom template, use it.
+ * otherwise default to pfsense tempalte
+ */
+if($config['theme'] <> "")
+ $g['theme'] = $config['theme'];
+else
+ $g['theme'] = "pfsense";
+
+/*
+ * If this device is an apple ipod/iphone
+ * switch the theme to one that works with it.
+ */
+$apple_ua = array("iPhone","iPod", "iPad");
+foreach($apple_ua as $useragent)
+ if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
+ $g['theme'] = "pfsense";
+
+$pagetitle = gentitle( $pgtitle );
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <title><?php echo($config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pagetitle); ?></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="apple-touch-icon" href="/themes/<?php echo $g['theme']; ?>/apple-touch-icon.png"/>
+ <?php if (strpos($_SERVER["SCRIPT_FILENAME"], "wizard.php") !== false &&
+ file_exists("{$g['www_path']}/themes/{$g['theme']}/wizard.css")): ?>
+ <?php echo "<style type=\"text/css\" src=\"/themes/{$g['theme']}/wizard.css\"></style>"; ?>
+ <?php else: ?>
+ <link rel="stylesheet" href="/themes/<?php echo $g['theme']; ?>/all.css" media="all" />
+ <?php endif; ?>
+ <link rel="stylesheet" type="text/css" href="/niftycssCode.css">
+ <link rel="stylesheet" type="text/css" href="/niftycssprintCode.css" media="print">
+ <link rel="stylesheet" type="text/css" href="/themes/<?=$g['theme']?>/new_tab_menu.css" media="all">
+ <script type="text/javascript" src="/javascript/niftyjsCode.js"></script>
+ <script type="text/javascript">
+ var theme = "<?php echo $g['theme']; ?>";
+ </script>
+ <?php echo "\t<script type=\"text/javascript\" src=\"/themes/{$g['theme']}/loader.js\"></script>\n"; ?>
+<?php
+ if($_GET['enablefirebuglite']) {
+ echo "\t<script type=\"text/javascript\" src=\"/javascript/pi.js\"></script>\n";
+ echo "\t<script type=\"text/javascript\" src=\"/javascript/firebug-lite.js\"></script>\n";
+ }
+ echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/prototype.js\"></script>\n";
+ echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/scriptaculous.js\"></script>\n";
+ echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/effects.js\"></script>\n";
+ echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/dragdrop.js\"></script>\n";
+ if(file_exists("{$g['www_path']}/javascript/global.js"))
+ echo "\t<script type=\"text/javascript\" src=\"/javascript/global.js\"></script>\n";
+ /*
+ * Find all javascript files that need to be included
+ * for this page ... from the arrays ... :)
+ * Coded by: Erik Kristensen
+ */
+
+ $dir = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php');
+ $path = "{$g['www_path']}/javascript/" . $dir . "/";
+ if (is_dir($path)) {
+ if ($dh = opendir($path)) {
+ while (($file = readdir($dh)) !== false) {
+ if (is_dir($file))
+ continue;
+ echo "\t<script type=\"text/javascript\" src=\"/javascript/{$dir}/{$file}\"></script>\n";
+ }
+ closedir($dh);
+ }
+ }
+
+if (!isset($closehead))
+ echo "</head>";
+
+/* If this page is being remotely managed then do not allow the loading of the contents. */
+if($config['remote_managed_pages']['item']) {
+ foreach($config['remote_managed_pages']['item'] as $rmp) {
+ if($rmp == $_SERVER['SCRIPT_NAME']) {
+ include("fbegin.inc");
+ print_info_box_np("This page is currently being managed by a remote machine.");
+ include("fend.inc");
+ exit;
+ }
+ }
+}
+
?>
\ No newline at end of file diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 888aa02..19ae18a 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -212,6 +212,7 @@ $pconfig['blockpriv'] = isset($wancfg['blockpriv']); $pconfig['blockbogons'] = isset($wancfg['blockbogons']); $pconfig['spoofmac'] = $wancfg['spoofmac']; $pconfig['mtu'] = $wancfg['mtu']; +$pconfig['mss'] = $wancfg['mss']; /* Wireless interface? */ if (isset($wancfg['wireless'])) { @@ -222,8 +223,12 @@ if (isset($wancfg['wireless'])) { if (!does_interface_exist($wlanif)) interface_wireless_clone($wlanif, $wancfg); $wlanbaseif = interface_get_wireless_base($wancfg['if']); + preg_match("/^(.*?)([0-9]*)$/", $wlanbaseif, $wlanbaseif_split); $wl_modes = get_wireless_modes($if); $wl_chaninfo = get_wireless_channel_info($if); + $wl_sysctl_prefix = 'dev.' . $wlanbaseif_split[1] . '.' . $wlanbaseif_split[2]; + $wl_sysctl = get_sysctl(array("{$wl_sysctl_prefix}.diversity", "{$wl_sysctl_prefix}.txantenna", "{$wl_sysctl_prefix}.rxantenna", + "{$wl_sysctl_prefix}.slottime", "{$wl_sysctl_prefix}.acktimeout", "{$wl_sysctl_prefix}.ctstimeout")); $wl_regdomain_xml_attr = array(); $wl_regdomain_xml = parse_xml_regdomain($wl_regdomain_xml_attr); $wl_regdomains = &$wl_regdomain_xml['regulatory-domains']['rd']; @@ -237,6 +242,9 @@ if (isset($wancfg['wireless'])) { $pconfig['ssid'] = $wancfg['wireless']['ssid']; $pconfig['channel'] = $wancfg['wireless']['channel']; $pconfig['txpower'] = $wancfg['wireless']['txpower']; + $pconfig['diversity'] = $wancfg['wireless']['diversity']; + $pconfig['txantenna'] = $wancfg['wireless']['txantenna']; + $pconfig['rxantenna'] = $wancfg['wireless']['rxantenna']; $pconfig['distance'] = $wancfg['wireless']['distance']; $pconfig['regdomain'] = $wancfg['wireless']['regdomain']; $pconfig['regcountry'] = $wancfg['wireless']['regcountry']; @@ -434,6 +442,8 @@ if ($_POST) { $input_errors[] = gettext("A valid MAC address must be specified."); if ($_POST['mtu'] && ($_POST['mtu'] < 576)) $input_errors[] = gettext("The MTU must be greater than 576 bytes."); + if ($_POST['mss'] && ($_POST['mss'] < 576)) + $input_errors[] = gettext("The MSS must be greater than 576 bytes."); /* Wireless interface? */ if (isset($wancfg['wireless'])) { $reqdfields = explode(" ", "mode ssid"); @@ -651,6 +661,11 @@ if ($_POST) { } else { $wancfg['mtu'] = $_POST['mtu']; } + if (empty($_POST['mss'])) { + unset($wancfg['mss']); + } else { + $wancfg['mss'] = $_POST['mss']; + } if (isset($wancfg['wireless'])) { handle_wireless_post(); } @@ -710,6 +725,18 @@ function handle_wireless_post() { $config['wireless']['interfaces'][$wlanbaseif] = array(); } else if (isset($config['wireless']['interfaces'][$wlanbaseif])) unset($config['wireless']['interfaces'][$wlanbaseif]); + if (isset($_POST['diversity']) && $_POST['diversity'] != "") + $wancfg['wireless']['diversity'] = $_POST['diversity']; + else if (isset($wancfg['wireless']['diversity'])) + unset($wancfg['wireless']['diversity']); + if (isset($_POST['txantenna']) && $_POST['txantenna'] != "") + $wancfg['wireless']['txantenna'] = $_POST['txantenna']; + else if (isset($wancfg['wireless']['txantenna'])) + unset($wancfg['wireless']['txantenna']); + if (isset($_POST['rxantenna']) && $_POST['rxantenna'] != "") + $wancfg['wireless']['rxantenna'] = $_POST['rxantenna']; + else if (isset($wancfg['wireless']['rxantenna'])) + unset($wancfg['wireless']['rxantenna']); if ($_POST['hidessid_enable'] == "yes") $wancfg['wireless']['hidessid']['enable'] = true; else if (isset($wancfg['wireless']['hidessid']['enable'])) @@ -983,7 +1010,7 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" <form action="interfaces.php" method="post" name="iform" id="iform"> <?php if ($input_errors) print_input_errors($input_errors); ?> <?php if (is_subsystem_dirty('interfaces')): ?><p> - <?php print_info_box_np(printf(gettext("The '%s' configuration has been changed."),$wancfg['descr'])."<p>".gettext("You must apply the changes in order for them to take effect.")."<p>".gettext("Don't forget to adjust the DHCP Server range if needed after applying."));?><br /> + <?php print_info_box_np(sprintf(gettext("The '%s' configuration has been changed."),$wancfg['descr'])."<p>".gettext("You must apply the changes in order for them to take effect.")."<p>".gettext("Don't forget to adjust the DHCP Server range if needed after applying."));?><br /> <?php endif; ?> <?php if ($savemsg) print_info_box($savemsg); ?> <table width="100%" border="0" cellpadding="6" cellspacing="0"> @@ -1052,10 +1079,18 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" <td class="vtable"> <input name="mtu" type="text" class="formfld unknown" id="mtu" size="8" value="<?=htmlspecialchars($pconfig['mtu']);?>"> <br> + <?=gettext("If you leave this field blank, " . + "an MTU of 1500 bytes will be assumed"); ?>. + </td> + </tr> + <tr> + <td valign="top" class="vncell"><?=gettext("MSS"); ?></td> + <td class="vtable"> + <input name="mss" type="text" class="formfld unknown" id="mss" size="8" value="<?=htmlspecialchars($pconfig['mss']);?>"> + <br> <?=gettext("If you enter a value in this field, then MSS clamping for " . "TCP connections to the value entered above minus 40 (TCP/IP " . - "header size) will be in effect. If you leave this field blank, " . - "an MTU of 1500 bytes will be assumed"); ?>. + "header size) will be in effect."); ?>. </td> </tr> <tr> @@ -1569,6 +1604,54 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" <?=gettext("Note: Not all channels may be supported by your card. Auto may override the wireless standard selected above"); ?>. </td> </tr> + <?php if (isset($wl_sysctl["{$wl_sysctl_prefix}.diversity"]) || isset($wl_sysctl["{$wl_sysctl_prefix}.txantenna"]) || isset($wl_sysctl["{$wl_sysctl_prefix}.rxantenna"])): ?> + <tr> + <td valign="top" class="vncell"><?=gettext("Antenna settings"); ?></td> + <td class="vtable"> + <table border="0" cellpadding="0" cellspacing="0"> + <tr> + <?php if (isset($wl_sysctl["{$wl_sysctl_prefix}.diversity"])): ?> + <td> + <?=gettext("Diversity"); ?><br/> + <select name="diversity" class="formselect" id="diversity"> + <option <? if (empty($pconfig['diversity'])) echo "selected"; ?> value=""><?=gettext("Default"); ?></option> + <option <? if ($pconfig['diversity'] == '0') echo "selected"; ?> value="0"><?=gettext("Off"); ?></option> + <option <? if ($pconfig['diversity'] == '1') echo "selected"; ?> value="1"><?=gettext("On"); ?></option> + </select> + </td> + <td>  </td> + <?php endif; ?> + <?php if (isset($wl_sysctl["{$wl_sysctl_prefix}.txantenna"])): ?> + <td> + <?=gettext("Transmit antenna"); ?><br/> + <select name="txantenna" class="formselect" id="txantenna"> + <option <? if (empty($pconfig['txantenna'])) echo "selected"; ?> value=""><?=gettext("Default"); ?></option> + <option <? if ($pconfig['txantenna'] == '0') echo "selected"; ?> value="0"><?=gettext("Auto"); ?></option> + <option <? if ($pconfig['txantenna'] == '1') echo "selected"; ?> value="1"><?=gettext("#1"); ?></option> + <option <? if ($pconfig['txantenna'] == '2') echo "selected"; ?> value="2"><?=gettext("#2"); ?></option> + </select> + </td> + <td>  </td> + <?php endif; ?> + <?php if (isset($wl_sysctl["{$wl_sysctl_prefix}.rxantenna"])): ?> + <td> + <?=gettext("Receive antenna"); ?><br/> + <select name="rxantenna" class="formselect" id="rxantenna"> + <option <? if (empty($pconfig['rxantenna'])) echo "selected"; ?> value=""><?=gettext("Default"); ?></option> + <option <? if ($pconfig['rxantenna'] == '0') echo "selected"; ?> value="0"><?=gettext("Auto"); ?></option> + <option <? if ($pconfig['rxantenna'] == '1') echo "selected"; ?> value="1"><?=gettext("#1"); ?></option> + <option <? if ($pconfig['rxantenna'] == '2') echo "selected"; ?> value="2"><?=gettext("#2"); ?></option> + </select> + </td> + <?php endif; ?> + </tr> + </table> + <br/> + <?=gettext("Note: The antenna numbers do not always match up with the labels on the card."); ?> + </td> + </tr> + <?php endif; ?> + <?php if (isset($wl_sysctl["{$wl_sysctl_prefix}.slottime"]) && isset($wl_sysctl["{$wl_sysctl_prefix}.acktimeout"]) && isset($wl_sysctl["{$wl_sysctl_prefix}.ctstimeout"])): ?> <tr> <td valign="top" class="vncell"><?=gettext("Distance setting"); ?></td> <td class="vtable"> @@ -1578,6 +1661,7 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" <?=gettext("(measured in Meters and works only for Atheros based cards !)"); ?> </td> </tr> + <?php endif; ?> <tr> <td valign="top" class="vncell"><?=gettext("Regulatory settings"); ?></td> <td class="vtable"> diff --git a/usr/local/www/interfaces_gif.php b/usr/local/www/interfaces_gif.php index 3c03ad5..98748d9 100644 --- a/usr/local/www/interfaces_gif.php +++ b/usr/local/www/interfaces_gif.php @@ -120,7 +120,7 @@ include("head.inc"); <?=htmlspecialchars($gif['descr']);?> </td> <td valign="middle" nowrap class="list"> <a href="interfaces_gif_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a> - <a href="interfaces_gif.php?act=del&id=<?=$i;?>" onclick="return confirm(gettext("'Do you really want to delete this gif tunnel?'"))"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <a href="interfaces_gif.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this gif tunnel?"); ?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> <?php $i++; endforeach; ?> <tr> diff --git a/usr/local/www/interfaces_groups_edit.php b/usr/local/www/interfaces_groups_edit.php index e1a9666..b72a442 100755 --- a/usr/local/www/interfaces_groups_edit.php +++ b/usr/local/www/interfaces_groups_edit.php @@ -78,8 +78,6 @@ if ($_POST) { if ($gdescr == $_POST['ifname'] || $gif == $_POST['ifname']) $input_errors[] = "The specified group name is already used by an interface. Please choose another name."; } - $ifgroupentry = array(); - $ifgroupentry['ifname'] = $_POST['ifname']; $members = ""; $isfirst = 0; /* item is a normal ifgroupentry type */ @@ -93,10 +91,44 @@ if ($_POST) { } if (!$input_errors) { + $ifgroupentry = array(); $ifgroupentry['members'] = $members; $ifgroupentry['descr'] = mb_convert_encoding($_POST['descr'],"HTML-ENTITIES","auto"); - if (isset($id) && $a_ifgroups[$id]) { + if (isset($id) && $a_ifgroups[$id] && $_POST['ifname'] != $a_ifgroups[$id]['ifname']) { + + foreach ($config['filter']['rule'] as $ridx => $rule) { + if (isset($rule['floating'])) { + $rule_ifs = explode(",", $rule['interface']); + $rule_changed = false; + foreach ($rule_ifs as $rule_if_id => $rule_if) { + if ($rule_if == $a_ifgroups[$id]['ifname']) { + $rule_ifs[$rule_if_id] = $_POST['ifname']; + $rule_changed = true; + } + } + if ($rule_changed) + $config['filter']['rule'][$ridx]['interface'] = implode(",", $rule_ifs); + } else { + if ($rule['interface'] == $a_ifgroups[$id]['ifname']) + $config['filter']['rule'][$ridx]['interface'] = $_POST['ifname']; + } + } + foreach ($config['nat']['rule'] as $ridx => $rule) { + if ($rule['interface'] == $a_ifgroups[$id]['ifname']) + $config['nat']['rule'][$ridx]['interface'] = $_POST['ifname']; + } + $omembers = explode(" ", $a_ifgroups[$id]['members']); + if (count($omembers) > 0) { + foreach ($omembers as $ifs) { + $realif = get_real_interface($ifs); + if ($realif) + mwexec("/sbin/ifconfig {$realif} -group " . $a_ifgroups[$id]['ifname']); + } + } + $ifgroupentry['ifname'] = $_POST['ifname']; + $a_ifgroups[$id] = $ifgroupentry; + } else if (isset($id) && $a_ifgroups[$id]) { $omembers = explode(" ", $a_ifgroups[$id]['members']); $nmembers = explode(" ", $members); $delmembers = array_diff($omembers, $nmembers); @@ -107,9 +139,12 @@ if ($_POST) { mwexec("/sbin/ifconfig {$realif} -group " . $a_ifgroups[$id]['ifname']); } } + $ifgroupentry['ifname'] = $_POST['ifname']; $a_ifgroups[$id] = $ifgroupentry; - } else + } else { + $ifgroupentry['ifname'] = $_POST['ifname']; $a_ifgroups[] = $ifgroupentry; + } write_config(); diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php index 391f3f2..07e8e83 100644 --- a/usr/local/www/interfaces_ppps_edit.php +++ b/usr/local/www/interfaces_ppps_edit.php @@ -175,7 +175,7 @@ if ($_POST) { /* input validation */ switch($_POST['type']) { case "ppp": - $reqdfields = explode("interfaces phone"); + $reqdfields = explode(" ", "interfaces phone"); $reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Phone Number")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); break; @@ -420,13 +420,11 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE" <tr style="display:none" name="portlists" id="portlists"> <td id="serialports"><?php $selected_ports = explode(',',$pconfig['interfaces']); - $serial = glob("/dev/cua*"); - $modems = glob("/dev/modem*"); - $serialports = array_merge($serial, $modems); + if (!is_dir("/var/spool/lock")) + mwexec("/bin/mkdir -p /var/spool/lock"); + $serialports = pfSense_get_modem_devices(); $serport_count = 0; foreach ($serialports as $port) { - if(preg_match("/\.(lock|init)$/", $port)) - continue; $serport_count++; echo $port.",".trim($port); if (in_array($port,$selected_ports)) diff --git a/usr/local/www/javascript/filter_log.js b/usr/local/www/javascript/filter_log.js index b34d7f1..88be819 100644 --- a/usr/local/www/javascript/filter_log.js +++ b/usr/local/www/javascript/filter_log.js @@ -74,8 +74,10 @@ function update_div_rows(data) { var isIE = navigator.appName.indexOf('Microsoft') != -1; var isSafari = navigator.userAgent.indexOf('Safari') != -1; var isOpera = navigator.userAgent.indexOf('Opera') != -1; - var rulestable = document.getElementById('log'); - var rows = rulestable.getElementsByTagName('div'); + var rows = $$('.log-entry-mini'); + if (rows.length == 0) { + rows = $$('.log-entry'); + } var showanim = 1; if (isIE) { showanim = 0; @@ -86,40 +88,24 @@ function update_div_rows(data) { startat = 0; } data = data.slice(startat, data.length); - + for(var x=0; x<data.length; x++) { - var numrows = rows.length; /* if reverse logging is enabled we need to show the * records in a reverse order with new items appearing * on the top */ if(isReverse == false) { - for (var i = 2; i < numrows; i++) { - nextrecord = i + 1; - if(nextrecord < numrows) - rows[i].innerHTML = rows[nextrecord].innerHTML; + for (var i = 1; i < rows.length; i++) { + nextrecord = i - 1; + rows[nextrecord].innerHTML = rows[i].innerHTML; } } else { - for (var i = numrows; i > 0; i--) { + for (var i = rows.length - 2; i > 0; i--) { nextrecord = i + 1; - if(nextrecord < numrows) - rows[nextrecord].innerHTML = rows[i].innerHTML; + rows[nextrecord].innerHTML = rows[i].innerHTML; } } - var item = document.getElementById('firstrow'); - if(x == data.length-1) { - /* nothing */ - showanim = false; - } else { - showanim = false; - } - if (showanim) { - item.style.display = 'none'; - item.innerHTML = data[x]; - new Effect.Appear(item); - } else { - item.innerHTML = data[x]; - } + $('firstrow').update(data[x]); } } function toggle_pause() { diff --git a/usr/local/www/niftycssCode.css b/usr/local/www/niftycssCode.css index 79fbb58..ec4af80 100755 --- a/usr/local/www/niftycssCode.css +++ b/usr/local/www/niftycssCode.css @@ -1,6 +1,6 @@ .rtop,.artop{display:block} .rtop *,.artop *{display:block;height:1px;overflow:hidden;font-size:1px} -.artop *{border-style: solid;border-width:0 1px} +.artop *{border-style: solid;border-width:0 0px} .r1,.rl1,.re1,.rel1{margin-left:5px} .r1,.rr1,.re1,.rer1{margin-right:5px} .r2,.rl2,.re2,.rel2,.ra1,.ral1{margin-left:3px} diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php index 24651d4..df42a15 100755 --- a/usr/local/www/pkg.php +++ b/usr/local/www/pkg.php @@ -45,17 +45,19 @@ function gentitle_pkg($pgname) { return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname; } -$xml = htmlspecialchars($_GET['xml']); +$xml = htmlspecialchars($_REQUEST['xml']); if($xml == "") { - print_info_box_np(gettext("ERROR: No package defined.")); - die; + print_info_box_np(gettext("ERROR: No package defined.")); + exit; } else { - $pkg = parse_xml_config_pkg("/usr/local/pkg/" . $xml, "packagegui"); + if(file_exists("/usr/local/pkg/" . $xml)) + $pkg = parse_xml_config_pkg("/usr/local/pkg/" . $xml, "packagegui"); } if($pkg['donotsave'] <> "") { - header("Location: pkg_edit.php?xml=" . $xml); + Header("Location: pkg_edit.php?xml=" . $xml); + exit; } if ($pkg['include_file'] != "") { @@ -67,22 +69,29 @@ $section = $pkg['menu'][0]['section']; $config_path = $pkg['configpath']; $title = $pkg['title']; +if($_REQUEST['startdisplayingat']) + $startdisplayingat = $_REQUEST['startdisplayingat']; + +if($_REQUEST['display_maximum_rows']) + if($_REQUEST['display_maximum_rows']) + $display_maximum_rows = $_REQUEST['display_maximum_rows']; + $evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; if ($_GET['act'] == "del") { - // loop through our fieldnames and automatically setup the fieldnames - // in the environment. ie: a fieldname of username with a value of - // testuser would automatically eval $username = "testuser"; - foreach ($evaledvar as $ip) { + // loop through our fieldnames and automatically setup the fieldnames + // in the environment. ie: a fieldname of username with a value of + // testuser would automatically eval $username = "testuser"; + foreach ($evaledvar as $ip) { if($pkg['adddeleteeditpagefields']['columnitem']) foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { ${xml_safe_fieldname($column['fielddescr'])} = $ip[xml_safe_fieldname($column['fieldname'])]; } - } + } - $a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; + $a_pkg = &$config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; - if ($a_pkg[$_GET['id']]) { + if ($a_pkg[$_GET['id']]) { unset($a_pkg[$_GET['id']]); write_config(); if($pkg['custom_delete_php_command'] <> "") { @@ -95,11 +104,13 @@ if ($_GET['act'] == "del") { } } +ob_start(); + $iflist = get_configured_interface_with_descr(false, true); $evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; if($pkg['custom_php_global_functions'] <> "") - eval($pkg['custom_php_global_functions']); + eval($pkg['custom_php_global_functions']); if($pkg['custom_php_command_before_form'] <> "") eval($pkg['custom_php_command_before_form']); @@ -113,103 +124,268 @@ include("head.inc"); <?php include("fbegin.inc"); ?> -<form action="pkg.php" method="post"> +<form action="pkg.php" name="pkgform" method="get"> +<input type='hidden' name='xml' value='<?=$_REQUEST['xml']?>'> <? if($_GET['savemsg'] <> "") $savemsg = htmlspecialchars($_GET['savemsg']); ?> <?php if ($savemsg) print_info_box($savemsg); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <?php if ($pkg['tabs'] <> "") { - echo '<tr><td>'; - $tab_array = array(); - foreach($pkg['tabs']['tab'] as $tab) { - if(isset($tab['active'])) { - $active = true; - } else { - $active = false; - } - $urltmp = ""; - if($tab['url'] <> "") $urltmp = $tab['url']; - if($tab['xml'] <> "") $urltmp = "pkg_edit.php?xml=" . $tab['xml']; - - $myurl = getenv("HTTP_HOST"); - // eval url so that above $myurl item can be processed if need be. - $url = str_replace('$myurl', $myurl, $urltmp); - $tab_array[] = array( - $tab['text'], - $active, - $url - ); + echo '<tr><td>'; + $tab_array = array(); + foreach($pkg['tabs']['tab'] as $tab) { + if(isset($tab['active'])) { + $active = true; + } else { + $active = false; + } + $urltmp = ""; + if($tab['url'] <> "") + $urltmp = $tab['url']; + if($tab['xml'] <> "") + $urltmp = "pkg_edit.php?xml=" . $tab['xml']; + + $myurl = getenv("HTTP_HOST"); + // eval url so that above $myurl item can be processed if need be. + $url = str_replace('$myurl', $myurl, $urltmp); + $tab_array[] = array( + $tab['text'], + $active, + $url + ); } - display_top_tabs($tab_array); - echo '</td></tr>'; + display_top_tabs($tab_array); + echo '</td></tr>'; } ?> +<script> + function setFilter(filtertext) { + $('pkg_filter').value = filtertext; + document.pkgform.submit(); + } +</script> <tr><td><div id="mainarea"><table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td class="tabcont"> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> - <tr> - <?php - $cols = 0; - if($pkg['adddeleteeditpagefields']['columnitem'] <> "") { - foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { - echo "<td class=\"listhdrr\">" . $column['fielddescr'] . "</td>"; - $cols++; - } - } - echo "</tr>"; - $i=0; - if($evaledvar) - foreach ($evaledvar as $ip) { - echo "<tr valign=\"top\">\n"; - if($pkg['adddeleteeditpagefields']['columnitem'] <> "") - foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { - ?> - <td class="listlr" ondblclick="document.location='pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>';"> - <?php - $fieldname = $ip[xml_safe_fieldname($column['fieldname'])]; - if($column['type'] == "checkbox") { - if($fieldname == "") { - echo gettext("No"); - } else { - echo gettext("Yes"); + <tr> + <td class="tabcont"> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> +<?php + /* Handle filtering bar A-Z */ + $include_filtering_inputbox = false; + $colspan = 0; + if($pkg['adddeleteeditpagefields']['columnitem'] <> "") + foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) + $colspan++; + if($pkg['fields']['field']) { + // First find the sorting type field if it exists + foreach($pkg['fields']['field'] as $field) { + if($field['type'] == "sorting") { + if(isset($field['include_filtering_inputbox'])) + $include_filtering_inputbox = true; + if($display_maximum_rows < 1) + if($field['display_maximum_rows']) + $display_maximum_rows = $field['display_maximum_rows']; + echo "<tr><td class='listhdrr' colspan='$colspan'><center>"; + echo "Filter by: "; + $isfirst = true; + for($char = 65; $char < 91; $char++) { + if(!$isfirst) + echo " | "; + echo "<a href=\"#\" onClick=\"setFilter('" . chr($char) . "');\">" . chr($char) . "</a>"; + $isfirst = false; } - } else if ($column['type'] == "interface") { - echo $column['prefix'] . $iflist[$fieldname] . $column['suffix']; - } else { - echo $column['prefix'] . $fieldname . $column['suffix']; - } - ?> - </td> - <?php + echo "</td></tr>"; + echo "<tr><td class='listhdrr' colspan='$colspan'><center>"; + if($field['sortablefields']) { + echo "Filter field: <select name='pkg_filter_type'>"; + foreach($field['sortablefields']['item'] as $si) { + if($si['name'] == $_REQUEST['pkg_filter_type']) + $SELECTED = "SELECTED"; + else + $SELECTED = ""; + echo "<option value='{$si['name']}' {$SELECTED}>{$si['name']}</option>"; + } + echo "</select>"; + } + if($include_filtering_inputbox) + echo " Filter text: <input id='pkg_filter' name='pkg_filter' value='" . $_REQUEST['pkg_filter'] . "'> <input type='submit' value='Filter'>"; + echo "</td></tr><tr><td><font siez='-3'> </td></tr>"; + } + } + } +?> + <tr> +<?php + if($display_maximum_rows) { + $totalpages = ceil(round((count($evaledvar) / $display_maximum_rows),9)); + $page = 1; + $tmpcount = 0; + $tmppp = 0; + foreach ($evaledvar as $ipa) { + if($tmpcount == $display_maximum_rows) { + $page++; + $tmpcount = 0; + } + if($tmppp == $startdisplayingat) + break; + $tmpcount++; + $tmppp++; + } + echo "<tr><td colspan='" . count($pkg['adddeleteeditpagefields']['columnitem']) . "'>"; + echo "<table width='100%'>"; + echo "<tr>"; + echo "<td align='left'>Displaying page $page of $totalpages</b></td>"; + echo "<td align='right'>Rows per page: <select onChange='document.pkgform.submit();' name='display_maximum_rows'>"; + for($x=0; $x<250; $x++) { + if($x == $display_maximum_rows) + $SELECTED = "SELECTED"; + else + $SELECTED = ""; + echo "<option value='$x' $SELECTED>$x</option>\n"; + $x=$x+4; + } + echo "</select></td></tr>"; + echo "</table>"; + echo "</td></tr>"; } - ?> - <td valign="middle" class="list" nowrap> - <table border="0" cellspacing="0" cellpadding="1"> - <tr> - <td valign="middle"><a href="pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> - <td valign="middle"><a href="pkg.php?xml=<?=$xml?>&act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this item?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> - </tr> - </table> - </td> - <?php - echo "</tr>\n"; - $i++; - } - ?> - <tr> - <td colspan="<?=$cols?>"></td> - <td> - <table border="0" cellspacing="0" cellpadding="1"> - <tr> - <td valign="middle"><a href="pkg_edit.php?xml=<?=$xml?>&id=<?=$i?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> + $cols = 0; + if($pkg['adddeleteeditpagefields']['columnitem'] <> "") { + foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { + echo "<td class=\"listhdrr\">" . $column['fielddescr'] . "</td>"; + $cols++; + } + } + echo "</tr>"; + $i=0; + $pagination_startingrow=0; + $pagination_counter=0; + if($evaledvar) + foreach ($evaledvar as $ip) { + if($startdisplayingat) { + if($i < $startdisplayingat) { + $i++; + continue; + } + } + if($_REQUEST['pkg_filter']) { + // Handle filterered items + if($pkg['fields']['field'] && !$filter_regex) { + // First find the sorting type field if it exists + foreach($pkg['fields']['field'] as $field) { + if($field['type'] == "sorting") { + if($field['sortablefields']['item']) { + foreach($field['sortablefields']['item'] as $sf) { + if($sf['name'] == $_REQUEST['pkg_filter_type']) { + $filter_fieldname = $sf['fieldname']; + $filter_regex = str_replace("%FILTERTEXT%", $_REQUEST['pkg_filter'], trim($sf['regex'])); + } + } + } + } + } + } + // Do we have something to filter on? + unset($filter_matches); + if($pkg['adddeleteeditpagefields']['columnitem'] <> "") { + foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { + $fieldname = $ip[xml_safe_fieldname($column['fieldname'])]; + if($column['fieldname'] == $filter_fieldname) { + if($filter_regex) { + //echo "$filter_regex - $fieldname<p/>"; + preg_match($filter_regex, $fieldname, $filter_matches); + break; + } + } + } + } + if(!$filter_matches) { + $i++; + continue; + } + } + echo "<tr valign=\"top\">\n"; + if($pkg['adddeleteeditpagefields']['columnitem'] <> "") + foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { +?> + <td class="listlr" ondblclick="document.location='pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>';"> + <?php + $fieldname = $ip[xml_safe_fieldname($column['fieldname'])]; + if($column['type'] == "checkbox") { + if($fieldname == "") { + echo gettext("No"); + } else { + echo gettext("Yes"); + } + } else if ($column['type'] == "interface") { + echo $column['prefix'] . $iflist[$fieldname] . $column['suffix']; + } else { + echo $column['prefix'] . $fieldname . $column['suffix']; + } + ?> + </td> +<?php + } +?> + <td valign="middle" class="list" nowrap> + <table border="0" cellspacing="0" cellpadding="1"> + <tr> + <td valign="middle"><a href="pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td> + <td valign="middle"><a href="pkg.php?xml=<?=$xml?>&act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this item?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + </tr> + </table> + </td> +<?php + echo "</tr>\n"; + // Handle pagination and display_maximum_rows + if($display_maximum_rows) { + if($pagination_counter == ($display_maximum_rows-1) or + $i == (count($evaledvar)-1)) { + $colcount = count($pkg['adddeleteeditpagefields']['columnitem']); + $final_footer = ""; + $final_footer .= "<tr><td colspan='$colcount'>"; + $final_footer .= "<table width='100%'><tr>"; + $final_footer .= "<td align='left'>"; + $startingat = $startdisplayingat - $display_maximum_rows; + if($startingat > -1) { + $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&startdisplayingat={$startingat}&display_maximum_rows={$display_maximum_rows}'>"; + } else { + if($startingnat > 1) + $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&startdisplayingat=0&display_maximum_rows={$display_maximum_rows}'>"; + } + $final_footer .= "<font size='2'><< Previous page</a>"; + if($tmppp + $display_maximum_rows > count($evaledvar)) + $endingrecord = count($evaledvar); + else + $endingrecord = $tmppp + $display_maximum_rows; + $final_footer .= "</td><td align='center'>"; + $tmppp++; + $final_footer .= "<font size='2'>Displaying {$tmppp} - {$endingrecord} / " . count($evaledvar) . " records"; + $final_footer .= "</td><td align='right'> "; + if(($i+1) < count($evaledvar)) + $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&startdisplayingat=" . ($startdisplayingat + $display_maximum_rows) . "&display_maximum_rows={$display_maximum_rows}'>"; + $final_footer .= "<font size='2'>Next page >></a>"; + $final_footer .= "</td></tr></table></td></tr>"; + $i = count($evaledvar); + break; + } + } + $i++; + $pagination_counter++; + } +?> + <tr> + <td colspan="<?=$cols?>"></td> + <td> + <table border="0" cellspacing="0" cellpadding="1"> + <tr> + <td valign="middle"><a href="pkg_edit.php?xml=<?=$xml?>&id=<?=$i?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td> + </tr> + </table> + </td> + </tr> + <?=$final_footer?> + </table> + </td> +</tr> </table> </div></tr></td></table> @@ -221,5 +397,10 @@ NiftyCheck(); Rounded("div#mainarea","bl br","#FFF","#eeeeee","smooth"); </script> +<?php + echo "<!-- filter_fieldname: {$filter_fieldname} -->"; + echo "<!-- filter_regex: {$filter_regex} -->"; +?> + </body> </html> diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index eeadc2e..9d2ef13 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -165,6 +165,8 @@ if ($_POST) { if (!$input_errors) { $pkgarr = array(); foreach ($pkg['fields']['field'] as $fields) { + if($fields['type'] == "sorting") + continue; if($fields['type'] == "listtopic") continue; if($fields['type'] == "rowhelper") { @@ -371,6 +373,8 @@ if ($pkg['tabs'] <> "") { $savevalue = gettext("Save"); if($pkg['savetext'] <> "") $savevalue = $pkg['savetext']; foreach ($pkg['fields']['field'] as $pkga) { + if ($pkga['type'] == "sorting") + continue; if ($pkga['type'] == "listtopic") { echo "<td> </td>"; diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index 4508a02..f0d92c3 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -73,6 +73,7 @@ if (isset($id) && $a_passthrumacs[$id]) { $pconfig['bw_up'] = $a_passthrumacs[$id]['bw_up']; $pconfig['bw_down'] = $a_passthrumacs[$id]['bw_down']; $pconfig['descr'] = $a_passthrumacs[$id]['descr']; + $pconfig['username'] = $a_passthrumacs[$id]['username']; } if ($_POST) { @@ -113,6 +114,8 @@ if ($_POST) { $mac['bw_up'] = $_POST['bw_up']; if ($_POST['bw_down']) $mac['bw_down'] = $_POST['bw_down']; + if ($_POST['username']) + $mac['username'] = $_POST['username']; $mac['descr'] = $_POST['descr']; @@ -183,6 +186,9 @@ include("head.inc"); <?php if (isset($id) && $a_passthrumacs[$id]): ?> <input name="id" type="hidden" value="<?=$id;?>"> <?php endif; ?> + <?php if (isset($pconfig['username']) && $pconfig['username']): ?> + <input name="username" type="hidden" value="<?=htmlspecialchars($pconfig['username']);?>"> + <?php endif; ?> </td> </tr> </table> diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index c3889c0..dd64b82 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -817,7 +817,7 @@ include("head.inc"); </td> </tr> </table> - <table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0"> + <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="25%" class="listhdrr"><?=gettext("MAC address");?></td> <td width="15%" class="listhdrr"><?=gettext("IP address");?></td> diff --git a/usr/local/www/services_snmp.php b/usr/local/www/services_snmp.php index 25284ae..d3cda15 100755 --- a/usr/local/www/services_snmp.php +++ b/usr/local/www/services_snmp.php @@ -106,7 +106,7 @@ if ($_POST) { $reqdfields = explode(" ", "trapstring"); $reqdfieldsn = array(gettext("Trap string")); - do_input_validation($_POST, $reqdfields, $reqdfields, $reqdfieldsn, &$input_errors); + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); } diff --git a/usr/local/www/status_captiveportal.php b/usr/local/www/status_captiveportal.php index fc24ee8..4f4caa9 100755 --- a/usr/local/www/status_captiveportal.php +++ b/usr/local/www/status_captiveportal.php @@ -141,7 +141,7 @@ if ($_GET['order']) { <td class="listr"><?php if ($cpent[5]) echo htmlspecialchars(date("m/d/Y H:i:s", $cpent[5]));?></td> <?php endif; ?> <td valign="middle" class="list" nowrap> - <a href="?order=<?=$_GET['order'];?>&showact=<?=$_GET['showact'];?>&act=del&id=<?=$cpent[1];?>" onclick="return confirm(gettext('Do you really want to disconnect this client?'))"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <a href="?order=<?=$_GET['order'];?>&showact=<?=$_GET['showact'];?>&act=del&id=<?=$cpent[1];?>" onclick="return confirm(gettext('Do you really want to disconnect this client?'))"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("Disconnect");?>"></a></td> </tr> <?php endforeach; ?> </table> diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index d607021..e4ae38b 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -194,7 +194,7 @@ $ui_databases = array_merge($dbheader, $databases); $styles = array('inverse' => gettext('Inverse'), 'absolute' => gettext('Absolute')); -$graphs = array("day", "week", "month", "quarter", "year", "4year"); +$graphs = array("12hour", "day", "week", "month", "quarter", "year", "4year"); $periods = array("current" => gettext("Current Period"), "previous" => gettext("Previous Period")); $pgtitle = array(gettext("Status"),gettext("RRD Graphs")); @@ -217,6 +217,18 @@ function get_dates($curperiod, $graph) { $offset = 0; } switch($graph) { + case "12hour": + switch($offset) { + case 0; + $houroffset = 0; + break; + default: + $houroffset = ($offset * 12) - 12; + break; + } + $start = mktime((8 + $houroffset), 0, 0, $curmonth, $curday, $curyear); + $end = mktime((8 + $houroffset) + 12, 0, 0, $curmonth, $curday, $curyear); + break; case "day": $start = mktime(0, 0, 0, $curmonth, ($curday + $offset), $curyear); $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear); diff --git a/usr/local/www/status_wireless.php b/usr/local/www/status_wireless.php index 50d1811..4e2a313 100755 --- a/usr/local/www/status_wireless.php +++ b/usr/local/www/status_wireless.php @@ -77,6 +77,12 @@ foreach($ciflist as $interface => $ifdescr) { $tab_array[] = array(printf(gettext("Status (%s)"),$ifdescr), $enabled, "status_wireless.php?if={$interface}"); } } +$rwlif = get_real_interface($if); +if($_POST['rescanwifi'] <> "") { + mwexec_bg("/sbin/ifconfig {$rwlif} scan 2>&1"); + $savemsg = gettext("Rescan has been initiated in the background. Refresh this page in 10 seconds to see the results."); +} +if ($savemsg) print_info_box($savemsg); display_top_tabs($tab_array); ?> </td></tr> @@ -85,9 +91,10 @@ display_top_tabs($tab_array); <table class="tabcont" colspan="3" cellpadding="3" width="100%"> <?php - /* table header */ - printf(gettext("%s%s%sNearby access points or ad-hoc peers.%s%s%s%s"),'<tr>','<td colspan=7>','<b>','<br/>','</td>','</tr>','\n'); + print "<input type=\"hidden\" name=\"if\" id=\"if\" value=\"{$if}\">\n"; + print "<tr><td colspan=7><b><input type=\"submit\" name=\"rescanwifi\" id=\"rescanwifi\" value=\"Rescan\"><br/></td></tr>\n"; + print "<tr><td colspan=7><b>" . gettext("Nearby access points or ad-hoc peers") . ".<br/></td></tr>\n"; print "\n<tr>"; print "<tr bgcolor='#990000'>"; print "<td><b><font color='#ffffff'>SSID</td>"; @@ -99,7 +106,6 @@ display_top_tabs($tab_array); print "<td><b><font color='#ffffff'>CAPS</td>"; print "</tr>\n\n"; - $rwlif = get_real_interface($if); exec("/sbin/ifconfig {$rwlif} list scan 2>&1", $states, $ret); /* Skip Header */ array_shift($states); @@ -174,7 +180,10 @@ display_top_tabs($tab_array); ?> </table> -</div> +</div><br> + <b>Flags:</b> A = authorized, E = Extended Rate (802.11g), P = Power save mode<br> + <b>Capabilities:</b> E = ESS (infrastructure mode), I = IBSS (ad-hoc mode), P = privacy (WEP/TKIP/AES), + S = Short preamble, s = Short slot time </td></tr> </table> diff --git a/usr/local/www/system_advanced_firewall.php b/usr/local/www/system_advanced_firewall.php index 370c47c..1fe923d 100644 --- a/usr/local/www/system_advanced_firewall.php +++ b/usr/local/www/system_advanced_firewall.php @@ -64,7 +64,7 @@ else $pconfig['reflectiontimeout'] = $config['system']['reflectiontimeout']; $pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']); $pconfig['disablescrub'] = isset($config['system']['disablescrub']); -$pconfig['tftpinterface'] = $config['system']['tftpinterface']; +$pconfig['tftpinterface'] = explode(",", $config['system']['tftpinterface']); if ($_POST) { @@ -355,7 +355,7 @@ function update_description(itemnum) { $ifdescs = get_configured_interface_with_descr(); foreach ($ifdescs as $ifent => $ifdesc): ?> - <option value="<?=$ifent;?>" <?php if (stristr($pconfig['tftpinterface'], $ifent)) echo "selected"; ?>><?=gettext($ifdesc);?></option> + <option value="<?=$ifent;?>" <?php if (in_array($ifent, $pconfig['tftpinterface'])) echo "selected"; ?>><?=gettext($ifdesc);?></option> <?php endforeach; ?> </select> <strong><?=gettext("Choose the interfaces where you want TFTP proxy helper to be enabled.");?></strong> diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php index 1bdefe9..1bd5cbf 100644 --- a/usr/local/www/system_advanced_misc.php +++ b/usr/local/www/system_advanced_misc.php @@ -51,6 +51,8 @@ require_once("shaper.inc"); $pconfig['harddiskstandby'] = $config['system']['harddiskstandby']; $pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']); $pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']); +$pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']); +$pconfig['maxmss'] = $config['system']['maxmss']; $pconfig['powerd_enable'] = isset($config['system']['powerd_enable']); $pconfig['glxsb_enable'] = isset($config['system']['glxsb_enable']); $pconfig['schedule_states'] = isset($config['system']['schedule_states']); @@ -81,6 +83,14 @@ if ($_POST) { else unset($config['system']['preferoldsa']); + if($_POST['maxmss_enable'] == "yes") { + $config['system']['maxmss_enable'] = true; + $config['system']['maxmss'] = $_POST['maxmss']; + } else { + unset($config['system']['maxmss_enable']); + unset($config['system']['maxmss']); + } + if($_POST['powerd_enable'] == "yes") $config['system']['powerd_enable'] = true; else @@ -123,6 +133,14 @@ include("head.inc"); if ($savemsg) print_info_box($savemsg); ?> +<script type="text/javascript" > +function maxmss_checked(obj) { + if (obj.checked) + $('maxmss').enable(); + else + $('maxmss').disable(); +} +</script> <form action="system_advanced_misc.php" method="post" name="iform" id="iform"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> @@ -232,6 +250,18 @@ include("head.inc"); "option to always prefer old SAs over new ones."); ?> </td> </tr> + <tr> + <td width="22%" valign="top" class="vncell"><?=gettext("Maximum MSS"); ?></td> + <td width="78%" class="vtable"> + <input name="maxmss_enable" type="checkbox" id="maxmss_enable" value="yes" <?php if ($pconfig['maxmss_enable'] == true) echo "checked"; ?> onClick="maxmss_checked(this)" /> + <strong><?=gettext("Enable MSS clamping on VPN traffic"); ?></strong> + <br /> + <input name="maxmss" id="maxmss" value="<?php if ($pconfig['maxmss'] <> "") echo $pconfig['maxmss']; else "1400"; ?>" class="formfld unknown" <?php if ($pconfig['maxmss_enable'] == false) echo "disabled"; ?>> + <br /> + <?=gettext("Enable MSS clamping on TCP flows over VPN. " . + "This helps overcome problems with PMTUD on IPsec VPN links. If left blank, the default value is 1400 bytes. "); ?> + </td> + </tr> <tr> <td colspan="2" class="list" height="12"> </td> </tr> diff --git a/usr/local/www/system_advanced_network.php b/usr/local/www/system_advanced_network.php index 6c67e30..8884797 100644 --- a/usr/local/www/system_advanced_network.php +++ b/usr/local/www/system_advanced_network.php @@ -112,19 +112,19 @@ if ($_POST) { } if($_POST['disablechecksumoffloading'] == "yes") { - $config['system']['disablechecksumoffloading'] = $_POST['disablechecksumoffloading']; + $config['system']['disablechecksumoffloading'] = true; } else { unset($config['system']['disablechecksumoffloading']); } if($_POST['disablesegmentationoffloading'] == "yes") { - $config['system']['disablesegmentationoffloading'] = $_POST['disablesegmentationoffloading']; + $config['system']['disablesegmentationoffloading'] = true; } else { unset($config['system']['disablesegmentationoffloading']); } if($_POST['disablelargereceiveoffloading'] == "yes") { - $config['system']['disablelargereceiveoffloading'] = $_POST['disablelargereceiveoffloading']; + $config['system']['disablelargereceiveoffloading'] = true; } else { unset($config['system']['disablelargereceiveoffloading']); } diff --git a/usr/local/www/system_usermanager_settings.php b/usr/local/www/system_usermanager_settings.php index 0a52028..cba9d57 100755 --- a/usr/local/www/system_usermanager_settings.php +++ b/usr/local/www/system_usermanager_settings.php @@ -139,6 +139,9 @@ if(!$pconfig['backend']) $selected = ""; if ($auth_server['name'] == $pconfig['authmode']) $selected = "selected"; + if (!isset($pconfig['authmode']) && $auth_server['name'] == "Local Database") + $selected = "selected"; + ?> <option value="<?=$auth_server['name'];?>" <?=$selected;?>><?=$auth_server['name'];?></option> <?php endforeach; ?> diff --git a/usr/local/www/system_usermanager_settings_ldapacpicker.php b/usr/local/www/system_usermanager_settings_ldapacpicker.php index 5e76fce..7e656c5 100644 --- a/usr/local/www/system_usermanager_settings_ldapacpicker.php +++ b/usr/local/www/system_usermanager_settings_ldapacpicker.php @@ -93,7 +93,7 @@ function post_choices() { <body link="#000000" vlink="#000000" alink="#000000" > <form method="post" action="system_usermanager_settings_ldapacpicker.php"> <?php if (empty($ous)): ?> - <p><?=gettext("Sorry, we could not connect to the LDAP server. Please try later.");?></p> + <p><?=gettext("Could not connect to the LDAP server. Please check your LDAP configuration.");?></p> <input type='button' value='<?=gettext("Close"); ?>' onClick="window.close();"> <?php else: ?> <b><?=gettext("Please select which containers to Authenticate against");?>:</b> diff --git a/usr/local/www/themes/_corporate/all.css b/usr/local/www/themes/_corporate/all.css index 91de2e0..af14ae5 100644 --- a/usr/local/www/themes/_corporate/all.css +++ b/usr/local/www/themes/_corporate/all.css @@ -845,7 +845,7 @@ ul#tabnav li.tabact { white-space: nowrap; } .tabcont { - background-color: #EEEEEE; + background-color: #DDDDDD; padding-right: 12px; padding-left: 12px; padding-top: 12px; diff --git a/usr/local/www/themes/_corporate/bottom-loader.js b/usr/local/www/themes/_corporate/bottom-loader.js index 78e3eba..238e0b2 100644 --- a/usr/local/www/themes/_corporate/bottom-loader.js +++ b/usr/local/www/themes/_corporate/bottom-loader.js @@ -2,8 +2,8 @@ NiftyCheck(); Rounded("div#niftyMenu","top bottom","#FFFFFF","#000000","smooth"); - Rounded("div#mainarea","bl br tr","#FFF","#eeeeee","smooth"); - Rounded("div#boxarea","bl br tl tr","#FFF","#eeeeee","smooth"); + Rounded("div#mainarea","bl br tr","#FFF","#DDDDDD","smooth"); + Rounded("div#boxarea","bl br tl tr","#FFF","#DDDDDD","smooth"); Rounded("tr#fend","bl br tl tr","#FFF","#990000","smooth"); Rounded("div#topbox","all","#FFF","#990000","smooth"); diff --git a/usr/local/www/themes/_corporate/images/new_tab_menu.png b/usr/local/www/themes/_corporate/images/new_tab_menu.png Binary files differnew file mode 100644 index 0000000..f0e4cbe --- /dev/null +++ b/usr/local/www/themes/_corporate/images/new_tab_menu.png diff --git a/usr/local/www/themes/_corporate/new_tab_menu.css b/usr/local/www/themes/_corporate/new_tab_menu.css new file mode 100644 index 0000000..aae94e3 --- /dev/null +++ b/usr/local/www/themes/_corporate/new_tab_menu.css @@ -0,0 +1,101 @@ +/* + new_tab_menu.css + part of pfSense + Copyright (C) 2010-2011 Robert Zelaya + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + + Replace your old tab menu with the following code. To add a second tab menu line just cut and paste again. + The following code is dependent on new_tab_menu.css and images/new_tab_menu.png. + + <tr> + <td> + <?php + $tab_array_indent = 0; // move to the line in px + $tab_array_space = 1; // space betwen lines in px + $tab_array_char_limit = 82; // number or chr before the drop down box + $tab_array = array(); + $tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php"); + $tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php"); + $tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php"); + $tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php"); + $tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php"); + $tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php"); + display_top_tabs($tab_array); + ?> + </td> + </tr> + +*/ + +.newtabmenu ul, li{border:0; margin:0; padding:0; list-style:none;} + +.newtabmenu li{float:left; margin-right:2px; text-align: center;} +.newtabmenu a:link, .newtabmenu a:visited{ + background:url(imagesimages/new_tab_menu.png) right 45px; + color:#ffffff; /* noactive font */ + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + font-weight:bold; + font-size:.9em; + height:20px; + line-height:20px; + text-decoration:none; +} +.newtabmenu a span{ + background:url(images/new_tab_menu.png) left 45px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + height:20px; + margin-right:7px; + padding-left:7px; +} +.newtabmenu a:hover{ + background:url(images/new_tab_menu.png) right 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + color:#ffffff; /* hover over font */ +} +.newtabmenu a:hover span{ + background:url(images/new_tab_menu.png) left 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ +} + +/* -------------------------------- */ +/* ACTIVE ELEMENTS */ +.newtabmenu_active a:link, .newtabmenu_active a:visited, .newtabmenu_active a:visited, .newtabmenu_active a:hover{ + color:#000000; /* active font */ + background:url(images/new_tab_menu.png) right 0 no-repeat; +} +.newtabmenu_active a span, .newtabmenu_active a:hover span{ + background:url(images/new_tab_menu.png) left 0 no-repeat; +}
\ No newline at end of file diff --git a/usr/local/www/themes/_corporate/new_tab_menu.png b/usr/local/www/themes/_corporate/new_tab_menu.png Binary files differnew file mode 100644 index 0000000..f0e4cbe --- /dev/null +++ b/usr/local/www/themes/_corporate/new_tab_menu.png diff --git a/usr/local/www/themes/code-red/all.css b/usr/local/www/themes/code-red/all.css index c7fc25b..92d4425 100755 --- a/usr/local/www/themes/code-red/all.css +++ b/usr/local/www/themes/code-red/all.css @@ -928,7 +928,7 @@ ul#tabnav li.tabact { white-space: nowrap;
}
.tabcont {
- background-color: #EEEEEE;
+ background-color: #DDDDDD;
padding-right: 12px;
padding-left: 12px;
padding-top: 12px;
diff --git a/usr/local/www/themes/code-red/bottom-loader.js b/usr/local/www/themes/code-red/bottom-loader.js index 78e3eba..238e0b2 100755 --- a/usr/local/www/themes/code-red/bottom-loader.js +++ b/usr/local/www/themes/code-red/bottom-loader.js @@ -2,8 +2,8 @@ NiftyCheck(); Rounded("div#niftyMenu","top bottom","#FFFFFF","#000000","smooth"); - Rounded("div#mainarea","bl br tr","#FFF","#eeeeee","smooth"); - Rounded("div#boxarea","bl br tl tr","#FFF","#eeeeee","smooth"); + Rounded("div#mainarea","bl br tr","#FFF","#DDDDDD","smooth"); + Rounded("div#boxarea","bl br tl tr","#FFF","#DDDDDD","smooth"); Rounded("tr#fend","bl br tl tr","#FFF","#990000","smooth"); Rounded("div#topbox","all","#FFF","#990000","smooth"); diff --git a/usr/local/www/themes/code-red/images/new_tab_menu.png b/usr/local/www/themes/code-red/images/new_tab_menu.png Binary files differnew file mode 100644 index 0000000..f0e4cbe --- /dev/null +++ b/usr/local/www/themes/code-red/images/new_tab_menu.png diff --git a/usr/local/www/themes/code-red/new_tab_menu.css b/usr/local/www/themes/code-red/new_tab_menu.css new file mode 100644 index 0000000..04c4cf2 --- /dev/null +++ b/usr/local/www/themes/code-red/new_tab_menu.css @@ -0,0 +1,101 @@ +/* + new_tab_menu.css + part of pfSense + Copyright (C) 2010-2011 Robert Zelaya + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + + Replace your old tab menu with the following code. To add a second tab menu line just cut and paste again. + The following code is dependent on new_tab_menu.css and images/new_tab_menu.png. + + <tr> + <td> + <?php + $tab_array_indent = 0; // move to the line in px + $tab_array_space = 1; // space betwen lines in px + $tab_array_char_limit = 82; // number or chr before the drop down box + $tab_array = array(); + $tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php"); + $tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php"); + $tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php"); + $tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php"); + $tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php"); + $tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php"); + display_top_tabs($tab_array); + ?> + </td> + </tr> + +*/ + +.newtabmenu ul, li{border:0; margin:0; padding:0; list-style:none;} + +.newtabmenu li{float:left; margin-right:2px; text-align: center;} +.newtabmenu a:link, .newtabmenu a:visited{ + background:url(images/new_tab_menu.png) right 45px; + color:#ffffff; /* noactive font */ + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + font-weight:bold; + font-size:.9em; + height:20px; + line-height:20px; + text-decoration:none; +} +.newtabmenu a span{ + background:url(images/new_tab_menu.png) left 45px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + height:20px; + margin-right:7px; + padding-left:7px; +} +.newtabmenu a:hover{ + background:url(images/new_tab_menu.png) right 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + color:#ffffff; /* hover over font */ +} +.newtabmenu a:hover span{ + background:url(images/new_tab_menu.png) left 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ +} + +/* -------------------------------- */ +/* ACTIVE ELEMENTS */ +.newtabmenu_active a:link, .newtabmenu_active a:visited, .newtabmenu_active a:visited, .newtabmenu_active a:hover{ + color:#000000; /* active font */ + background:url(images/new_tab_menu.png) right 0 no-repeat; +} +.newtabmenu_active a span, .newtabmenu_active a:hover span{ + background:url(images/new_tab_menu.png) left 0 no-repeat; +}
\ No newline at end of file diff --git a/usr/local/www/themes/metallic/all.css b/usr/local/www/themes/metallic/all.css index 63132b3..597b8d5 100644 --- a/usr/local/www/themes/metallic/all.css +++ b/usr/local/www/themes/metallic/all.css @@ -896,7 +896,7 @@ ul#tabnav li.tabact { white-space: nowrap; } .tabcont { - background-color: #EEEEEE; + background-color: #DDDDDD; padding-right: 12px; padding-left: 12px; padding-top: 12px; diff --git a/usr/local/www/themes/metallic/bottom-loader.js b/usr/local/www/themes/metallic/bottom-loader.js index 78e3eba..238e0b2 100644 --- a/usr/local/www/themes/metallic/bottom-loader.js +++ b/usr/local/www/themes/metallic/bottom-loader.js @@ -2,8 +2,8 @@ NiftyCheck(); Rounded("div#niftyMenu","top bottom","#FFFFFF","#000000","smooth"); - Rounded("div#mainarea","bl br tr","#FFF","#eeeeee","smooth"); - Rounded("div#boxarea","bl br tl tr","#FFF","#eeeeee","smooth"); + Rounded("div#mainarea","bl br tr","#FFF","#DDDDDD","smooth"); + Rounded("div#boxarea","bl br tl tr","#FFF","#DDDDDD","smooth"); Rounded("tr#fend","bl br tl tr","#FFF","#990000","smooth"); Rounded("div#topbox","all","#FFF","#990000","smooth"); diff --git a/usr/local/www/themes/metallic/images/new_tab_menu.png b/usr/local/www/themes/metallic/images/new_tab_menu.png Binary files differnew file mode 100644 index 0000000..f0e4cbe --- /dev/null +++ b/usr/local/www/themes/metallic/images/new_tab_menu.png diff --git a/usr/local/www/themes/metallic/new_tab_menu.css b/usr/local/www/themes/metallic/new_tab_menu.css new file mode 100644 index 0000000..04c4cf2 --- /dev/null +++ b/usr/local/www/themes/metallic/new_tab_menu.css @@ -0,0 +1,101 @@ +/* + new_tab_menu.css + part of pfSense + Copyright (C) 2010-2011 Robert Zelaya + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + + Replace your old tab menu with the following code. To add a second tab menu line just cut and paste again. + The following code is dependent on new_tab_menu.css and images/new_tab_menu.png. + + <tr> + <td> + <?php + $tab_array_indent = 0; // move to the line in px + $tab_array_space = 1; // space betwen lines in px + $tab_array_char_limit = 82; // number or chr before the drop down box + $tab_array = array(); + $tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php"); + $tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php"); + $tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php"); + $tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php"); + $tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php"); + $tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php"); + display_top_tabs($tab_array); + ?> + </td> + </tr> + +*/ + +.newtabmenu ul, li{border:0; margin:0; padding:0; list-style:none;} + +.newtabmenu li{float:left; margin-right:2px; text-align: center;} +.newtabmenu a:link, .newtabmenu a:visited{ + background:url(images/new_tab_menu.png) right 45px; + color:#ffffff; /* noactive font */ + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + font-weight:bold; + font-size:.9em; + height:20px; + line-height:20px; + text-decoration:none; +} +.newtabmenu a span{ + background:url(images/new_tab_menu.png) left 45px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + height:20px; + margin-right:7px; + padding-left:7px; +} +.newtabmenu a:hover{ + background:url(images/new_tab_menu.png) right 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + color:#ffffff; /* hover over font */ +} +.newtabmenu a:hover span{ + background:url(images/new_tab_menu.png) left 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ +} + +/* -------------------------------- */ +/* ACTIVE ELEMENTS */ +.newtabmenu_active a:link, .newtabmenu_active a:visited, .newtabmenu_active a:visited, .newtabmenu_active a:hover{ + color:#000000; /* active font */ + background:url(images/new_tab_menu.png) right 0 no-repeat; +} +.newtabmenu_active a span, .newtabmenu_active a:hover span{ + background:url(images/new_tab_menu.png) left 0 no-repeat; +}
\ No newline at end of file diff --git a/usr/local/www/themes/nervecenter/all.css b/usr/local/www/themes/nervecenter/all.css index dc92296..2b1bd9b 100644 --- a/usr/local/www/themes/nervecenter/all.css +++ b/usr/local/www/themes/nervecenter/all.css @@ -922,7 +922,7 @@ ul#tabnav li.tabact { white-space: nowrap; } .tabcont { - background-color: #EEEEEE; + background-color: #DDDDDD; padding-right: 12px; padding-left: 12px; padding-top: 12px; diff --git a/usr/local/www/themes/nervecenter/bottom-loader.js b/usr/local/www/themes/nervecenter/bottom-loader.js index 78e3eba..238e0b2 100644 --- a/usr/local/www/themes/nervecenter/bottom-loader.js +++ b/usr/local/www/themes/nervecenter/bottom-loader.js @@ -2,8 +2,8 @@ NiftyCheck(); Rounded("div#niftyMenu","top bottom","#FFFFFF","#000000","smooth"); - Rounded("div#mainarea","bl br tr","#FFF","#eeeeee","smooth"); - Rounded("div#boxarea","bl br tl tr","#FFF","#eeeeee","smooth"); + Rounded("div#mainarea","bl br tr","#FFF","#DDDDDD","smooth"); + Rounded("div#boxarea","bl br tl tr","#FFF","#DDDDDD","smooth"); Rounded("tr#fend","bl br tl tr","#FFF","#990000","smooth"); Rounded("div#topbox","all","#FFF","#990000","smooth"); diff --git a/usr/local/www/themes/nervecenter/images/new_tab_menu.png b/usr/local/www/themes/nervecenter/images/new_tab_menu.png Binary files differnew file mode 100644 index 0000000..f0e4cbe --- /dev/null +++ b/usr/local/www/themes/nervecenter/images/new_tab_menu.png diff --git a/usr/local/www/themes/nervecenter/new_tab_menu.css b/usr/local/www/themes/nervecenter/new_tab_menu.css new file mode 100644 index 0000000..04c4cf2 --- /dev/null +++ b/usr/local/www/themes/nervecenter/new_tab_menu.css @@ -0,0 +1,101 @@ +/* + new_tab_menu.css + part of pfSense + Copyright (C) 2010-2011 Robert Zelaya + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + + Replace your old tab menu with the following code. To add a second tab menu line just cut and paste again. + The following code is dependent on new_tab_menu.css and images/new_tab_menu.png. + + <tr> + <td> + <?php + $tab_array_indent = 0; // move to the line in px + $tab_array_space = 1; // space betwen lines in px + $tab_array_char_limit = 82; // number or chr before the drop down box + $tab_array = array(); + $tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php"); + $tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php"); + $tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php"); + $tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php"); + $tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php"); + $tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php"); + display_top_tabs($tab_array); + ?> + </td> + </tr> + +*/ + +.newtabmenu ul, li{border:0; margin:0; padding:0; list-style:none;} + +.newtabmenu li{float:left; margin-right:2px; text-align: center;} +.newtabmenu a:link, .newtabmenu a:visited{ + background:url(images/new_tab_menu.png) right 45px; + color:#ffffff; /* noactive font */ + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + font-weight:bold; + font-size:.9em; + height:20px; + line-height:20px; + text-decoration:none; +} +.newtabmenu a span{ + background:url(images/new_tab_menu.png) left 45px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + height:20px; + margin-right:7px; + padding-left:7px; +} +.newtabmenu a:hover{ + background:url(images/new_tab_menu.png) right 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + color:#ffffff; /* hover over font */ +} +.newtabmenu a:hover span{ + background:url(images/new_tab_menu.png) left 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ +} + +/* -------------------------------- */ +/* ACTIVE ELEMENTS */ +.newtabmenu_active a:link, .newtabmenu_active a:visited, .newtabmenu_active a:visited, .newtabmenu_active a:hover{ + color:#000000; /* active font */ + background:url(images/new_tab_menu.png) right 0 no-repeat; +} +.newtabmenu_active a span, .newtabmenu_active a:hover span{ + background:url(images/new_tab_menu.png) left 0 no-repeat; +}
\ No newline at end of file diff --git a/usr/local/www/themes/pfsense-dropdown/all.css b/usr/local/www/themes/pfsense-dropdown/all.css index e3286eb..13ebf38 100644 --- a/usr/local/www/themes/pfsense-dropdown/all.css +++ b/usr/local/www/themes/pfsense-dropdown/all.css @@ -717,7 +717,7 @@ ul#tabnav li.tabact { white-space: nowrap; } .tabcont { - background-color: #EEEEEE; + background-color: #DDDDDD; padding-right: 12px; padding-left: 12px; padding-top: 12px; diff --git a/usr/local/www/themes/pfsense-dropdown/bottom-loader.js b/usr/local/www/themes/pfsense-dropdown/bottom-loader.js index 72a3b09..66f021d 100644 --- a/usr/local/www/themes/pfsense-dropdown/bottom-loader.js +++ b/usr/local/www/themes/pfsense-dropdown/bottom-loader.js @@ -2,8 +2,8 @@ NiftyCheck(); Rounded("div#niftyMenu","top bottom","#FFFFFF","#000000","smooth"); -Rounded("div#mainarea","bl br tr","#FFF","#eeeeee","smooth"); -Rounded("div#boxarea","bl br tl tr","#FFF","#eeeeee","smooth"); +Rounded("div#mainarea","bl br tr","#FFF","#DDDDDD","smooth"); +Rounded("div#boxarea","bl br tl tr","#FFF","#DDDDDD","smooth"); Rounded("tr#fend","bl br tl tr","#FFF","#990000","smooth"); Rounded("div#topbox","all","#FFF","#990000","smooth"); Rounded("div#footer","bl br tl tr","#FFF","#990000","smooth"); diff --git a/usr/local/www/themes/pfsense-dropdown/images/new_tab_menu.png b/usr/local/www/themes/pfsense-dropdown/images/new_tab_menu.png Binary files differnew file mode 100644 index 0000000..f0e4cbe --- /dev/null +++ b/usr/local/www/themes/pfsense-dropdown/images/new_tab_menu.png diff --git a/usr/local/www/themes/pfsense-dropdown/new_tab_menu.css b/usr/local/www/themes/pfsense-dropdown/new_tab_menu.css new file mode 100644 index 0000000..04c4cf2 --- /dev/null +++ b/usr/local/www/themes/pfsense-dropdown/new_tab_menu.css @@ -0,0 +1,101 @@ +/* + new_tab_menu.css + part of pfSense + Copyright (C) 2010-2011 Robert Zelaya + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + + Replace your old tab menu with the following code. To add a second tab menu line just cut and paste again. + The following code is dependent on new_tab_menu.css and images/new_tab_menu.png. + + <tr> + <td> + <?php + $tab_array_indent = 0; // move to the line in px + $tab_array_space = 1; // space betwen lines in px + $tab_array_char_limit = 82; // number or chr before the drop down box + $tab_array = array(); + $tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php"); + $tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php"); + $tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php"); + $tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php"); + $tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php"); + $tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php"); + display_top_tabs($tab_array); + ?> + </td> + </tr> + +*/ + +.newtabmenu ul, li{border:0; margin:0; padding:0; list-style:none;} + +.newtabmenu li{float:left; margin-right:2px; text-align: center;} +.newtabmenu a:link, .newtabmenu a:visited{ + background:url(images/new_tab_menu.png) right 45px; + color:#ffffff; /* noactive font */ + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + font-weight:bold; + font-size:.9em; + height:20px; + line-height:20px; + text-decoration:none; +} +.newtabmenu a span{ + background:url(images/new_tab_menu.png) left 45px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + height:20px; + margin-right:7px; + padding-left:7px; +} +.newtabmenu a:hover{ + background:url(images/new_tab_menu.png) right 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + color:#ffffff; /* hover over font */ +} +.newtabmenu a:hover span{ + background:url(images/new_tab_menu.png) left 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ +} + +/* -------------------------------- */ +/* ACTIVE ELEMENTS */ +.newtabmenu_active a:link, .newtabmenu_active a:visited, .newtabmenu_active a:visited, .newtabmenu_active a:hover{ + color:#000000; /* active font */ + background:url(images/new_tab_menu.png) right 0 no-repeat; +} +.newtabmenu_active a span, .newtabmenu_active a:hover span{ + background:url(images/new_tab_menu.png) left 0 no-repeat; +}
\ No newline at end of file diff --git a/usr/local/www/themes/pfsense/all.css b/usr/local/www/themes/pfsense/all.css index e1b2200..535f82c 100644 --- a/usr/local/www/themes/pfsense/all.css +++ b/usr/local/www/themes/pfsense/all.css @@ -685,7 +685,7 @@ ul#tabnav li.tabact { white-space: nowrap; } .tabcont { - background-color: #EEEEEE; + background-color: #DDDDDD; padding-right: 12px; padding-left: 12px; padding-top: 12px; diff --git a/usr/local/www/themes/pfsense/bottom-loader.js b/usr/local/www/themes/pfsense/bottom-loader.js index db74034..836e8b0 100644 --- a/usr/local/www/themes/pfsense/bottom-loader.js +++ b/usr/local/www/themes/pfsense/bottom-loader.js @@ -2,8 +2,8 @@ NiftyCheck(); Rounded("div#niftyMenu","top bottom","#FFFFFF","#000000","smooth"); -Rounded("div#mainarea","bl br tr","#FFF","#eeeeee","smooth"); -Rounded("div#boxarea","bl br tl tr","#FFF","#eeeeee","smooth"); +Rounded("div#mainarea","bl br tr","#FFF","#DDDDDD","smooth"); +Rounded("div#boxarea","bl br tl tr","#FFF","#DDDDDD","smooth"); Rounded("tr#fend","bl br tl tr","#FFF","#990000","smooth"); Rounded("div#topbox","all","#FFF","#990000","smooth"); Rounded("div#navigation","top bottom","#FFFFFF","#000000","smooth"); diff --git a/usr/local/www/themes/pfsense/images/new_tab_menu.png b/usr/local/www/themes/pfsense/images/new_tab_menu.png Binary files differnew file mode 100644 index 0000000..f0e4cbe --- /dev/null +++ b/usr/local/www/themes/pfsense/images/new_tab_menu.png diff --git a/usr/local/www/themes/pfsense/new_tab_menu.css b/usr/local/www/themes/pfsense/new_tab_menu.css new file mode 100644 index 0000000..04c4cf2 --- /dev/null +++ b/usr/local/www/themes/pfsense/new_tab_menu.css @@ -0,0 +1,101 @@ +/* + new_tab_menu.css + part of pfSense + Copyright (C) 2010-2011 Robert Zelaya + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + + Replace your old tab menu with the following code. To add a second tab menu line just cut and paste again. + The following code is dependent on new_tab_menu.css and images/new_tab_menu.png. + + <tr> + <td> + <?php + $tab_array_indent = 0; // move to the line in px + $tab_array_space = 1; // space betwen lines in px + $tab_array_char_limit = 82; // number or chr before the drop down box + $tab_array = array(); + $tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php"); + $tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php"); + $tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php"); + $tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php"); + $tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php"); + $tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php"); + display_top_tabs($tab_array); + ?> + </td> + </tr> + +*/ + +.newtabmenu ul, li{border:0; margin:0; padding:0; list-style:none;} + +.newtabmenu li{float:left; margin-right:2px; text-align: center;} +.newtabmenu a:link, .newtabmenu a:visited{ + background:url(images/new_tab_menu.png) right 45px; + color:#ffffff; /* noactive font */ + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + font-weight:bold; + font-size:.9em; + height:20px; + line-height:20px; + text-decoration:none; +} +.newtabmenu a span{ + background:url(images/new_tab_menu.png) left 45px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + height:20px; + margin-right:7px; + padding-left:7px; +} +.newtabmenu a:hover{ + background:url(images/new_tab_menu.png) right 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + color:#ffffff; /* hover over font */ +} +.newtabmenu a:hover span{ + background:url(images/new_tab_menu.png) left 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ +} + +/* -------------------------------- */ +/* ACTIVE ELEMENTS */ +.newtabmenu_active a:link, .newtabmenu_active a:visited, .newtabmenu_active a:visited, .newtabmenu_active a:hover{ + color:#000000; /* active font */ + background:url(images/new_tab_menu.png) right 0 no-repeat; +} +.newtabmenu_active a span, .newtabmenu_active a:hover span{ + background:url(images/new_tab_menu.png) left 0 no-repeat; +}
\ No newline at end of file diff --git a/usr/local/www/themes/pfsense_ng/all.css b/usr/local/www/themes/pfsense_ng/all.css index 514df00..d3cffdd 100644 --- a/usr/local/www/themes/pfsense_ng/all.css +++ b/usr/local/www/themes/pfsense_ng/all.css @@ -1019,7 +1019,7 @@ ul#tabnav li.tabact { white-space: nowrap; } .tabcont { - background-color: #EEEEEE; + background-color: #DDDDDD; padding-right: 12px; padding-left: 12px; padding-top: 12px; diff --git a/usr/local/www/themes/pfsense_ng/bottom-loader.js b/usr/local/www/themes/pfsense_ng/bottom-loader.js index 78e3eba..238e0b2 100644 --- a/usr/local/www/themes/pfsense_ng/bottom-loader.js +++ b/usr/local/www/themes/pfsense_ng/bottom-loader.js @@ -2,8 +2,8 @@ NiftyCheck(); Rounded("div#niftyMenu","top bottom","#FFFFFF","#000000","smooth"); - Rounded("div#mainarea","bl br tr","#FFF","#eeeeee","smooth"); - Rounded("div#boxarea","bl br tl tr","#FFF","#eeeeee","smooth"); + Rounded("div#mainarea","bl br tr","#FFF","#DDDDDD","smooth"); + Rounded("div#boxarea","bl br tl tr","#FFF","#DDDDDD","smooth"); Rounded("tr#fend","bl br tl tr","#FFF","#990000","smooth"); Rounded("div#topbox","all","#FFF","#990000","smooth"); diff --git a/usr/local/www/themes/pfsense_ng/images/new_tab_menu.png b/usr/local/www/themes/pfsense_ng/images/new_tab_menu.png Binary files differnew file mode 100644 index 0000000..f0e4cbe --- /dev/null +++ b/usr/local/www/themes/pfsense_ng/images/new_tab_menu.png diff --git a/usr/local/www/themes/pfsense_ng/new_tab_menu.css b/usr/local/www/themes/pfsense_ng/new_tab_menu.css new file mode 100644 index 0000000..04c4cf2 --- /dev/null +++ b/usr/local/www/themes/pfsense_ng/new_tab_menu.css @@ -0,0 +1,101 @@ +/* + new_tab_menu.css + part of pfSense + Copyright (C) 2010-2011 Robert Zelaya + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + + Replace your old tab menu with the following code. To add a second tab menu line just cut and paste again. + The following code is dependent on new_tab_menu.css and images/new_tab_menu.png. + + <tr> + <td> + <?php + $tab_array_indent = 0; // move to the line in px + $tab_array_space = 1; // space betwen lines in px + $tab_array_char_limit = 82; // number or chr before the drop down box + $tab_array = array(); + $tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php"); + $tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php"); + $tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php"); + $tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php"); + $tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php"); + $tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php"); + display_top_tabs($tab_array); + ?> + </td> + </tr> + +*/ + +.newtabmenu ul, li{border:0; margin:0; padding:0; list-style:none;} + +.newtabmenu li{float:left; margin-right:2px; text-align: center;} +.newtabmenu a:link, .newtabmenu a:visited{ + background:url(images/new_tab_menu.png) right 45px; + color:#ffffff; /* noactive font */ + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + font-weight:bold; + font-size:.9em; + height:20px; + line-height:20px; + text-decoration:none; +} +.newtabmenu a span{ + background:url(images/new_tab_menu.png) left 45px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + height:20px; + margin-right:7px; + padding-left:7px; +} +.newtabmenu a:hover{ + background:url(images/new_tab_menu.png) right 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + color:#ffffff; /* hover over font */ +} +.newtabmenu a:hover span{ + background:url(images/new_tab_menu.png) left 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ +} + +/* -------------------------------- */ +/* ACTIVE ELEMENTS */ +.newtabmenu_active a:link, .newtabmenu_active a:visited, .newtabmenu_active a:visited, .newtabmenu_active a:hover{ + color:#000000; /* active font */ + background:url(images/new_tab_menu.png) right 0 no-repeat; +} +.newtabmenu_active a span, .newtabmenu_active a:hover span{ + background:url(images/new_tab_menu.png) left 0 no-repeat; +}
\ No newline at end of file diff --git a/usr/local/www/themes/the_wall/all.css b/usr/local/www/themes/the_wall/all.css index 124cf57..6955e84 100644 --- a/usr/local/www/themes/the_wall/all.css +++ b/usr/local/www/themes/the_wall/all.css @@ -932,7 +932,7 @@ ul#tabnav li.tabact { white-space: nowrap; } .tabcont { - background-color: #EEEEEE; + background-color: #DDDDDD; padding-right: 12px; padding-left: 12px; padding-top: 12px; diff --git a/usr/local/www/themes/the_wall/bottom-loader.js b/usr/local/www/themes/the_wall/bottom-loader.js index 78e3eba..238e0b2 100644 --- a/usr/local/www/themes/the_wall/bottom-loader.js +++ b/usr/local/www/themes/the_wall/bottom-loader.js @@ -2,8 +2,8 @@ NiftyCheck(); Rounded("div#niftyMenu","top bottom","#FFFFFF","#000000","smooth"); - Rounded("div#mainarea","bl br tr","#FFF","#eeeeee","smooth"); - Rounded("div#boxarea","bl br tl tr","#FFF","#eeeeee","smooth"); + Rounded("div#mainarea","bl br tr","#FFF","#DDDDDD","smooth"); + Rounded("div#boxarea","bl br tl tr","#FFF","#DDDDDD","smooth"); Rounded("tr#fend","bl br tl tr","#FFF","#990000","smooth"); Rounded("div#topbox","all","#FFF","#990000","smooth"); diff --git a/usr/local/www/themes/the_wall/images/new_tab_menu.png b/usr/local/www/themes/the_wall/images/new_tab_menu.png Binary files differnew file mode 100644 index 0000000..f0e4cbe --- /dev/null +++ b/usr/local/www/themes/the_wall/images/new_tab_menu.png diff --git a/usr/local/www/themes/the_wall/new_tab_menu.css b/usr/local/www/themes/the_wall/new_tab_menu.css new file mode 100644 index 0000000..04c4cf2 --- /dev/null +++ b/usr/local/www/themes/the_wall/new_tab_menu.css @@ -0,0 +1,101 @@ +/* + new_tab_menu.css + part of pfSense + Copyright (C) 2010-2011 Robert Zelaya + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + + Replace your old tab menu with the following code. To add a second tab menu line just cut and paste again. + The following code is dependent on new_tab_menu.css and images/new_tab_menu.png. + + <tr> + <td> + <?php + $tab_array_indent = 0; // move to the line in px + $tab_array_space = 1; // space betwen lines in px + $tab_array_char_limit = 82; // number or chr before the drop down box + $tab_array = array(); + $tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php"); + $tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php"); + $tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php"); + $tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php"); + $tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php"); + $tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php"); + display_top_tabs($tab_array); + ?> + </td> + </tr> + +*/ + +.newtabmenu ul, li{border:0; margin:0; padding:0; list-style:none;} + +.newtabmenu li{float:left; margin-right:2px; text-align: center;} +.newtabmenu a:link, .newtabmenu a:visited{ + background:url(images/new_tab_menu.png) right 45px; + color:#ffffff; /* noactive font */ + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + font-weight:bold; + font-size:.9em; + height:20px; + line-height:20px; + text-decoration:none; +} +.newtabmenu a span{ + background:url(images/new_tab_menu.png) left 45px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + height:20px; + margin-right:7px; + padding-left:7px; +} +.newtabmenu a:hover{ + background:url(images/new_tab_menu.png) right 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ + color:#ffffff; /* hover over font */ +} +.newtabmenu a:hover span{ + background:url(images/new_tab_menu.png) left 23px; + display:block; + /* fix for IE6 */ + display: inline-block; + /* END */ +} + +/* -------------------------------- */ +/* ACTIVE ELEMENTS */ +.newtabmenu_active a:link, .newtabmenu_active a:visited, .newtabmenu_active a:visited, .newtabmenu_active a:hover{ + color:#000000; /* active font */ + background:url(images/new_tab_menu.png) right 0 no-repeat; +} +.newtabmenu_active a span, .newtabmenu_active a:hover span{ + background:url(images/new_tab_menu.png) left 0 no-repeat; +}
\ No newline at end of file diff --git a/usr/local/www/vpn_l2tp.php b/usr/local/www/vpn_l2tp.php index 2e941c0..5d20383 100644 --- a/usr/local/www/vpn_l2tp.php +++ b/usr/local/www/vpn_l2tp.php @@ -350,7 +350,7 @@ function enable_change(enable_over) { </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Encyrption type");?></td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Encryption type");?></td> <td width="78%" class="vtable"> <?=$mandfldhtml;?><select name="paporchap" id="paporchap"> <option value='chap'<?php if($pconfig['paporchap'] == "chap") echo " SELECTED"; ?>><?=gettext("CHAP"); ?></option> diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc index 9bbb689..aa5d023 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard.inc @@ -682,6 +682,7 @@ $gamesplist['lineage2'] = array(); $gamesplist['battlenet'] = array(); /* Blizzard Publishing games */ $gamesplist['battlenet'][] = array('Battle.NET', 'tcp', '6112', '6119', 'both'); + $gamesplist['battlenet'][] = array('Battle.NET-2', 'tcp', '1119', '1119', 'both'); $gamesplist['worldofwarcraft'] = array(); $gamesplist[] = array('WoW', 'tcp', '3724', '3724', 'both'); diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc index 0cfb97c..f9b2d14 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc @@ -695,6 +695,7 @@ $gamesplist['lineage2'] = array(); $gamesplist['battlenet'] = array(); /* Blizzard Publishing games */ $gamesplist['battlenet'][] = array('Battle.NET', 'tcp', '6112', '6119', 'both'); + $gamesplist['battlenet'][] = array('Battle.NET-2', 'tcp', '1119', '1119', 'both'); $gamesplist['worldofwarcraft'] = array(); $gamesplist[] = array('WoW', 'tcp', '3724', '3724', 'both'); diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc index 76cd710..61c836e 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc @@ -737,6 +737,7 @@ $gamesplist['lineage2'] = array(); $gamesplist['battlenet'] = array(); /* Blizzard Publishing games */ $gamesplist['battlenet'][] = array('Battle.NET', 'tcp', '6112', '6119', 'both'); + $gamesplist['battlenet'][] = array('Battle.NET-2', 'tcp', '1119', '1119', 'both'); $gamesplist['worldofwarcraft'] = array(); $gamesplist[] = array('WoW', 'tcp', '3724', '3724', 'both'); diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc index f14e24a..5306c8c 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc @@ -518,6 +518,7 @@ function apply_all_choosen_items() { $gamesplist['battlenet'] = array(); /* Blizzard Publishing games */ $gamesplist['battlenet'][] = array('Battle.NET', 'tcp', '6112', '6119', 'both'); + $gamesplist['battlenet'][] = array('Battle.NET-2', 'tcp', '1119', '1119', 'both'); $gamesplist['worldofwarcraft'] = array(); $gamesplist[] = array('WoW', 'tcp', '3724', '3724', 'both'); |