summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/diag_logs.php1
-rwxr-xr-xusr/local/www/diag_logs_auth.php1
-rwxr-xr-xusr/local/www/diag_logs_dhcp.php1
-rwxr-xr-xusr/local/www/diag_logs_filter.php1
-rwxr-xr-xusr/local/www/diag_logs_filter_dynamic.php1
-rw-r--r--usr/local/www/diag_logs_filter_summary.php1
-rwxr-xr-xusr/local/www/diag_logs_ipsec.php1
-rw-r--r--usr/local/www/diag_logs_ntpd.php1
-rw-r--r--usr/local/www/diag_logs_openvpn.php1
-rwxr-xr-xusr/local/www/diag_logs_ppp.php124
-rwxr-xr-xusr/local/www/diag_logs_relayd.php1
-rwxr-xr-xusr/local/www/diag_logs_settings.php1
-rwxr-xr-xusr/local/www/diag_logs_vpn.php1
-rw-r--r--usr/local/www/help.php1
-rwxr-xr-xusr/local/www/interfaces.php1987
-rwxr-xr-xusr/local/www/interfaces_assign.php145
-rw-r--r--usr/local/www/interfaces_bridge.php10
-rw-r--r--usr/local/www/interfaces_gif.php12
-rw-r--r--usr/local/www/interfaces_gre.php10
-rwxr-xr-xusr/local/www/interfaces_groups.php20
-rw-r--r--usr/local/www/interfaces_lagg.php10
-rw-r--r--usr/local/www/interfaces_ppp.php9
-rw-r--r--usr/local/www/interfaces_ppps.php133
-rw-r--r--usr/local/www/interfaces_ppps_edit.php891
-rwxr-xr-xusr/local/www/interfaces_qinq.php10
-rwxr-xr-xusr/local/www/interfaces_vlan.php10
-rw-r--r--usr/local/www/interfaces_wireless.php10
-rw-r--r--usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js112
28 files changed, 2443 insertions, 1063 deletions
diff --git a/usr/local/www/diag_logs.php b/usr/local/www/diag_logs.php
index 58470f9..85b61df 100755
--- a/usr/local/www/diag_logs.php
+++ b/usr/local/www/diag_logs.php
@@ -79,6 +79,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_auth.php b/usr/local/www/diag_logs_auth.php
index 25e92d6..700b6dc 100755
--- a/usr/local/www/diag_logs_auth.php
+++ b/usr/local/www/diag_logs_auth.php
@@ -67,6 +67,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", true, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_dhcp.php b/usr/local/www/diag_logs_dhcp.php
index 0b94962..b95b969 100755
--- a/usr/local/www/diag_logs_dhcp.php
+++ b/usr/local/www/diag_logs_dhcp.php
@@ -69,6 +69,7 @@ include("head.inc");
$tab_array[] = array("DHCP", true, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php
index 819a4ce..9d8d9cd 100755
--- a/usr/local/www/diag_logs_filter.php
+++ b/usr/local/www/diag_logs_filter.php
@@ -103,6 +103,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_filter_dynamic.php b/usr/local/www/diag_logs_filter_dynamic.php
index a8ac4b5..a07b52b 100755
--- a/usr/local/www/diag_logs_filter_dynamic.php
+++ b/usr/local/www/diag_logs_filter_dynamic.php
@@ -102,6 +102,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_filter_summary.php b/usr/local/www/diag_logs_filter_summary.php
index 485e26b..4904127 100644
--- a/usr/local/www/diag_logs_filter_summary.php
+++ b/usr/local/www/diag_logs_filter_summary.php
@@ -186,6 +186,7 @@ include("head.inc"); ?>
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php
index 33052b5..039193b 100755
--- a/usr/local/www/diag_logs_ipsec.php
+++ b/usr/local/www/diag_logs_ipsec.php
@@ -89,6 +89,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", true, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_ntpd.php b/usr/local/www/diag_logs_ntpd.php
index 033b6fc..d168f70 100644
--- a/usr/local/www/diag_logs_ntpd.php
+++ b/usr/local/www/diag_logs_ntpd.php
@@ -67,6 +67,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_openvpn.php b/usr/local/www/diag_logs_openvpn.php
index 73e6ed5..aa50856 100644
--- a/usr/local/www/diag_logs_openvpn.php
+++ b/usr/local/www/diag_logs_openvpn.php
@@ -71,6 +71,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", true, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_ppp.php b/usr/local/www/diag_logs_ppp.php
new file mode 100755
index 0000000..470d33d
--- /dev/null
+++ b/usr/local/www/diag_logs_ppp.php
@@ -0,0 +1,124 @@
+<?php
+/* $Id$ */
+/*
+ diag_logs.php
+ Copyright (C) 2004-2009 Scott Ullrich
+ All rights reserved.
+
+ originally part 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_BUILDER_BINARIES: /sbin/ifconfig /usr/bin/awk
+ pfSense_MODULE:
+*/
+
+##|+PRIV
+##|*IDENT=page-status-systemlogs-ppp
+##|*NAME=Status: System logs: IPsec VPN page
+##|*DESCR=Allow access to the 'Status: System logs: IPsec VPN' page.
+##|*MATCH=diag_logs_ppp.php*
+##|-PRIV
+
+require("guiconfig.inc");
+
+$ppp_logfile = "{$g['varlog_path']}/ppp.log";
+
+$nentries = $config['syslog']['nentries'];
+if (!$nentries)
+ $nentries = 50;
+
+if ($_POST['clear'])
+ clear_log_file($ppp_logfile);
+
+$ppp_logarr = return_clog($ppp_logfile, $nentries);
+
+$pgtitle = array("Status","System logs","PPP");
+include("head.inc");
+
+?>
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>
+<?php
+ $tab_array = array();
+ $tab_array[] = array("System", false, "diag_logs.php");
+ $tab_array[] = array("Firewall", false, "diag_logs_filter.php");
+ $tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
+ $tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
+ $tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", true, "diag_logs_ppp.php");
+ $tab_array[] = array("VPN", false, "diag_logs_vpn.php");
+ $tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
+ $tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
+ $tab_array[] = array("OpenNTPD", false, "diag_logs_ntpd.php");
+ $tab_array[] = array("Settings", false, "diag_logs_settings.php");
+ display_top_tabs($tab_array);
+?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="2" class="listtopic">Last <?=$nentries;?> PPP log entries</td>
+ </tr>
+ <?php
+ foreach($ppp_logarr as $logent){
+ if(isset($match)) {
+ $logent = preg_replace($search, $replace, $logent);
+ } else {
+ $searchs = "/(racoon: )([A-Z:].*?)([0-9].+\.[0-9].+.[0-9].+.[0-9].+\[[0-9].+\])(.*)/i";
+ $replaces = "$1<strong><font color=red>[Unknown Gateway/Dynamic]</font></strong>: $2$3$4";
+ $logent = preg_replace($searchs, $replaces, $logent);
+ }
+ $logent = preg_split("/\s+/", $logent, 6);
+ echo "<tr valign=\"top\">\n";
+ $entry_date_time = htmlspecialchars(join(" ", array_slice($logent, 0, 3)));
+ echo "<td class=\"listlr\" nowrap>" . $entry_date_time . "</td>\n";
+ echo "<td class=\"listr\">" . $logent[4] . " " . $logent[5] . "</td>\n";
+ echo "</tr>\n";
+ }
+ ?>
+ <tr>
+ <td>
+ <br>
+ <form action="diag_logs_ppp.php" method="post">
+ <input name="clear" type="submit" class="formbtn" value="Clear log">
+ </form>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
+</table>
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php
index a7a52a0..f267c74 100755
--- a/usr/local/www/diag_logs_relayd.php
+++ b/usr/local/www/diag_logs_relayd.php
@@ -67,6 +67,7 @@ include("head.inc");
$tab_array[] = array("Firewall", false, "diag_logs_filter.php");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", true, "diag_logs_relayd.php");
diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php
index 93e1169..f2b7861 100755
--- a/usr/local/www/diag_logs_settings.php
+++ b/usr/local/www/diag_logs_settings.php
@@ -171,6 +171,7 @@ function enable_change(enable_over) {
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", false, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/diag_logs_vpn.php b/usr/local/www/diag_logs_vpn.php
index e0faf23..83d0ecd 100755
--- a/usr/local/www/diag_logs_vpn.php
+++ b/usr/local/www/diag_logs_vpn.php
@@ -103,6 +103,7 @@ include("head.inc");
$tab_array[] = array("DHCP", false, "diag_logs_dhcp.php");
$tab_array[] = array("Portal Auth", false, "diag_logs_auth.php");
$tab_array[] = array("IPsec", false, "diag_logs_ipsec.php");
+ $tab_array[] = array("PPP", false, "diag_logs_ppp.php");
$tab_array[] = array("VPN", true, "diag_logs_vpn.php");
$tab_array[] = array("Load Balancer", false, "diag_logs_relayd.php");
$tab_array[] = array("OpenVPN", false, "diag_logs_openvpn.php");
diff --git a/usr/local/www/help.php b/usr/local/www/help.php
index 8a7514d..e5ac529 100644
--- a/usr/local/www/help.php
+++ b/usr/local/www/help.php
@@ -58,6 +58,7 @@ $helppages = array(
'diag_logs_filter_dynamic.php' => 'http://doc.pfsense.org/index.php/Firewall_Logs',
'diag_logs_filter_summary.php' => 'http://doc.pfsense.org/index.php/Firewall_Logs',
'diag_logs_ntpd.php' => 'http://doc.pfsense.org/index.php/NTP_Logs',
+ 'diag_logs_ppp.php' => 'http://doc.pfsense.org/index.php/PPP_Logs',
'diag_logs_relayd.php' => 'http://doc.pfsense.org/index.php/Load_Balancer_Logs',
'diag_logs_settings.php' => 'http://doc.pfsense.org/index.php/Log_Settings',
'diag_logs_vpn.php' => 'http://doc.pfsense.org/index.php/PPTP_VPN_Logs',
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index 4667801..22055f8 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -59,18 +59,18 @@ if ($_REQUEST['if']) {
$if = "wan";
}
-define("CRON_PPPOE_CMD_FILE", "/conf/pppoe{$if}restart");
+define("CRON_PPPOE_CMD_FILE", "{$g['varetc_path']}/pppoe_restart_");
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
define("CRON_DAILY_PATTERN", "0 0 * * *");
define("CRON_HOURLY_PATTERN", "0 * * * *");
-function getMPDCRONSettings() {
+function getMPDCRONSettings($ptpid_) {
global $config;
if (is_array($config['cron']['item'])) {
for ($i = 0; $i < count($config['cron']['item']); $i++) {
$item = $config['cron']['item'][$i];
- if (strpos($item['command'], CRON_PPPOE_CMD_FILE) !== false) {
+ if (strpos($item['command'], CRON_PPPOE_CMD_FILE.$ptpid_) !== false) {
return array("ID" => $i, "ITEM" => $item);
}
}
@@ -78,15 +78,10 @@ function getMPDCRONSettings() {
return NULL;
}
-function getMPDResetTimeFromConfig() {
- $itemhash = getMPDCRONSettings();
- $cronitem = $itemhash['ITEM'];
- if (isset($cronitem)) {
- return "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}";
- } else {
- return NULL;
- }
-}
+if (!is_array($config['ppps']['ppp']))
+ $config['ppps']['ppp'] = array();
+
+$a_ppps = &$config['ppps']['ppp'];
function remove_bad_chars($string) {
return preg_replace('/[^a-z|_|0-9]/i','',$string);
@@ -99,56 +94,80 @@ $a_gateways = &$config['gateways']['gateway_item'];
$wancfg = &$config['interfaces'][$if];
-$pconfig['pppoe_username'] = $wancfg['pppoe_username'];
-$pconfig['pppoe_password'] = $wancfg['pppoe_password'];
-$pconfig['provider'] = $wancfg['provider'];
-$pconfig['pppoe_dialondemand'] = isset($wancfg['ondemand']);
-$pconfig['pppoe_idletimeout'] = $wancfg['timeout'];
-
-/* ================================================ */
-/* = force a connection reset at a specific time? = */
-/* ================================================ */
-
-if (isset($wancfg['pppoe']['pppoe-reset-type'])) {
- $resetTime = getMPDResetTimeFromConfig();
- $pconfig['pppoe_preset'] = true;
- if ($wancfg['pppoe']['pppoe-reset-type'] == "custom") {
- $resetTime_a = split(" ", $resetTime);
- $pconfig['pppoe_pr_custom'] = true;
- $pconfig['pppoe_resetminute'] = $resetTime_a[0];
- $pconfig['pppoe_resethour'] = $resetTime_a[1];
- /* just initialize $pconfig['pppoe_resetdate'] if the
- * coresponding item contains appropriate numeric values.
- */
- if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*")
- $pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y");
- } else if ($wancfg['pppoe']['pppoe-reset-type'] == "preset") {
- $pconfig['pppoe_pr_preset'] = true;
- switch ($resetTime) {
- case CRON_MONTHLY_PATTERN:
- $pconfig['pppoe_monthly'] = true;
- break;
- case CRON_WEEKLY_PATTERN:
- $pconfig['pppoe_weekly'] = true;
- break;
- case CRON_DAILY_PATTERN:
- $pconfig['pppoe_daily'] = true;
- break;
- case CRON_HOURLY_PATTERN:
- $pconfig['pppoe_hourly'] = true;
- break;
- }
+if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
+ foreach ($a_ppps as $pppid => $ppp) {
+ if ($wancfg['ptpid'] == $ppp['ptpid'])
+ break;
}
}
-$pconfig['pptp_username'] = $wancfg['pptp_username'];
-$pconfig['pptp_password'] = $wancfg['pptp_password'];
-$pconfig['pptp_local'] = $wancfg['local'];
-$pconfig['pptp_subnet'] = $wancfg['subnet'];
-$pconfig['pptp_remote'] = $wancfg['remote'];
-$pconfig['pptp_dialondemand'] = isset($wancfg['ondemand']);
-$pconfig['pptp_idletimeout'] = $wancfg['timeout'];
+if ($wancfg['ptpid'] == $a_ppps[$pppid]['ptpid']) {
+ $pconfig['pppid'] = $pppid;
+ if (isset($a_ppps[$pppid]['defaultgw']))
+ $pconfig['defaultgw'] = true;
+ else
+ $pconfig['defaultgw'] = false;
+
+ if ($a_ppps[$pppid]['type'] == "pppoe"){
+ $pconfig['pppoe_username'] = $a_ppps[$pppid]['username'];
+ $pconfig['pppoe_password'] = base64_decode($a_ppps[$pppid]['password']);
+ $pconfig['provider'] = $a_ppps[$pppid]['provider'];
+ $pconfig['pppoe_dialondemand'] = isset($a_ppps[$pppid]['ondemand']);
+ $pconfig['pppoe_idletimeout'] = $a_ppps[$pppid]['idletimeout'];
+ /* ================================================ */
+ /* = force a connection reset at a specific time? = */
+ /* ================================================ */
+
+ if (isset($a_ppps[$pppid]['pppoe-reset-type'])) {
+ $pconfig['pppoe-reset-type'] = $a_ppps[$pppid]['pppoe-reset-type'];
+ $itemhash = getMPDCRONSettings($a_ppps[$pppid]['ptpid']);
+ $cronitem = $itemhash['ITEM'];
+ if (isset($cronitem)) {
+ $resetTime = "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}";
+ } else {
+ $resetTime = NULL;
+ }
+ log_error("ResetTime:".$resetTime);
+ if ($a_ppps[$pppid]['pppoe-reset-type'] == "custom") {
+ $resetTime_a = split(" ", $resetTime);
+ $pconfig['pppoe_pr_custom'] = true;
+ $pconfig['pppoe_resetminute'] = $resetTime_a[0];
+ $pconfig['pppoe_resethour'] = $resetTime_a[1];
+ /* just initialize $pconfig['pppoe_resetdate'] if the
+ * coresponding item contains appropriate numeric values.
+ */
+ if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*")
+ $pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y");
+ } else if ($a_ppps[$pppid]['pppoe-reset-type'] == "preset") {
+ $pconfig['pppoe_pr_preset'] = true;
+ switch ($resetTime) {
+ case CRON_MONTHLY_PATTERN:
+ $pconfig['pppoe_monthly'] = true;
+ break;
+ case CRON_WEEKLY_PATTERN:
+ $pconfig['pppoe_weekly'] = true;
+ break;
+ case CRON_DAILY_PATTERN:
+ $pconfig['pppoe_daily'] = true;
+ break;
+ case CRON_HOURLY_PATTERN:
+ $pconfig['pppoe_hourly'] = true;
+ break;
+ }
+ }
+ }// End force pppoe reset at specific time
+ }// End if type == pppoe
+ if ($a_ppps[$pppid]['type'] == "pptp"){
+ $pconfig['pptp_username'] = $a_ppps[$pppid]['username'];
+ $pconfig['pptp_password'] = base64_decode($a_ppps[$pppid]['password']);
+ $pconfig['pptp_local'] = $a_ppps[$pppid]['localip'];
+ $pconfig['pptp_subnet'] = $a_ppps[$pppid]['subnet'];
+ $pconfig['pptp_remote'] = $a_ppps[$pppid]['gateway'];
+ $pconfig['pptp_dialondemand'] = isset($a_ppps[$pppid]['ondemand']);
+ $pconfig['pptp_idletimeout'] = $a_ppps[$pppid]['timeout'];
+ }
+}
$pconfig['dhcphostname'] = $wancfg['dhcphostname'];
$pconfig['alias-address'] = $wancfg['alias-address'];
$pconfig['alias-subnet'] = $wancfg['alias-subnet'];
@@ -180,13 +199,9 @@ switch($wancfg['ipaddr']) {
$pconfig['ipaddr'] = "";
break;
case "pppoe":
- $pconfig['type'] = "pppoe";
- break;
case "pptp":
- $pconfig['type'] = "pptp";
- break;
case "ppp":
- $pconfig['type'] = "ppp";
+ $pconfig['type'] = $wancfg['ipaddr'];
break;
default:
if(is_ipaddr($wancfg['ipaddr'])) {
@@ -327,7 +342,7 @@ if ($_POST) {
* data validation procedure below, may trigger a false error
* message.
*/
- if (empty($_POST['pppoe_preset'])) {
+ if (empty($_POST['pppoe-reset-type'])) {
unset($_POST['pppoe_pr_type']);
unset($_POST['pppoe_resethour']);
unset($_POST['pppoe_resetminute']);
@@ -467,6 +482,7 @@ if ($_POST) {
}
}
if (!$input_errors) {
+ $ppp = array();
if ($wancfg['ipaddr'] != "ppp")
unset($wancfg['ipaddr']);
unset($wancfg['subnet']);
@@ -509,7 +525,13 @@ if ($_POST) {
unset($gateway_item);
}
}
-
+
+ // Here the else condition code assumes only that strings of form "opt#" will be passed.
+ if ($if == "wan")
+ $if_num = "0";
+ else
+ $if_num = substr($if, 3);
+
switch($_POST['type']) {
case "static":
$wancfg['ipaddr'] = $_POST['ipaddr'];
@@ -537,25 +559,58 @@ if ($_POST) {
}
break;
case "pppoe":
- $wancfg['ipaddr'] = "pppoe";
- $wancfg['pppoe_username'] = $_POST['pppoe_username'];
- $wancfg['pppoe_password'] = $_POST['pppoe_password'];
- $wancfg['provider'] = $_POST['provider'];
- $wancfg['ondemand'] = $_POST['pppoe_dialondemand'] ? true : false;
- $wancfg['timeout'] = $_POST['pppoe_idletimeout'];
+ $ppp['ptpid'] = $_POST['ptpid'];
+ $ppp['type'] = $_POST['type'];
+ if (isset($_POST['ppp_port']))
+ $ppp['ports'] = $_POST['ppp_port'];
+ else
+ $ppp['ports'] = $wancfg['if'];
+ $ppp['username'] = $_POST['pppoe_username'];
+ $ppp['password'] = base64_encode($_POST['pppoe_password']);
+ if (!empty($_POST['provider']))
+ $ppp['provider'] = $_POST['provider'];
+ else
+ unset($ppp['provider']);
+ $ppp['ondemand'] = $_POST['pppoe_dialondemand'] ? true : false;
+ if (!empty($_POST['idletimeout']))
+ $ppp['idletimeout'] = $_POST['pppoe_idletimeout'];
+ else
+ unset($ppp['idletimeout']);
+
+ if (!empty($_POST['pppoe-reset-type']))
+ $ppp['pppoe-reset-type'] = $_POST['pppoe-reset-type'];
+ else
+ unset($ppp['pppoe-reset-type']);
+ $wancfg['if'] = $_POST['type'] . $if_num;
+ $wancfg['ptpid'] = $_POST['ptpid'];
+ $wancfg['ipaddr'] = $_POST['type'];
+ $ppp['defaultgw'] = $_POST['defaultgw'];
if($gateway_item) {
$a_gateways[] = $gateway_item;
}
+
break;
case "pptp":
- $wancfg['ipaddr'] = "pptp";
- $wancfg['pptp_username'] = $_POST['pptp_username'];
- $wancfg['pptp_password'] = $_POST['pptp_password'];
- $wancfg['local'] = $_POST['pptp_local'];
- $wancfg['subnet'] = $_POST['pptp_subnet'];
- $wancfg['remote'] = $_POST['pptp_remote'];
- $wancfg['ondemand'] = $_POST['pptp_dialondemand'] ? true : false;
- $wancfg['timeout'] = $_POST['pptp_idletimeout'];
+ $ppp['ptpid'] = $_POST['ptpid'];
+ $ppp['type'] = $_POST['type'];
+ if (isset($_POST['ppp_port']))
+ $ppp['ports'] = $_POST['ppp_port'];
+ else
+ $ppp['ports'] = $wancfg['if'];
+ $ppp['username'] = $_POST['pptp_username'];
+ $ppp['password'] = base64_encode($_POST['pptp_password']);
+ $ppp['localip'] = $_POST['pptp_local'];
+ $ppp['subnet'] = $_POST['pptp_subnet'];
+ $ppp['gateway'] = $_POST['pptp_remote'];
+ $ppp['ondemand'] = $_POST['pptp_dialondemand'] ? true : false;
+ if (!empty($_POST['idletimeout']))
+ $ppp['idletimeout'] = $_POST['pptp_idletimeout'];
+ else
+ unset($ppp['idletimeout']);
+
+ $wancfg['if'] = $_POST['type'] . $if_num;
+ $wancfg['ptpid'] = $_POST['ptpid'];
+ $wancfg['ipaddr'] = $_POST['type'];
if($gateway_item) {
$a_gateways[] = $gateway_item;
}
@@ -563,9 +618,9 @@ if ($_POST) {
}
handle_pppoe_reset();
/* reset cron items if necessary */
- if (empty($_POST['pppoe_preset'])) {
+ if (empty($_POST['pppoe-reset-type'])) {
/* test whether a cron item exists and unset() it if necessary */
- $itemhash = getMPDCRONSettings();
+ $itemhash = getMPDCRONSettings($_POST['ptpid']);
$item = $itemhash['ITEM'];
if (isset($item))
unset($config['cron']['item'][$itemhash['ID']]);
@@ -589,6 +644,12 @@ if ($_POST) {
if (isset($wancfg['wireless'])) {
handle_wireless_post();
}
+
+ if (isset($_POST['pppid']) && $a_ppps[$pppid])
+ $a_ppps[$pppid] = $ppp;
+ else
+ $a_ppps[] = $ppp;
+
write_config();
mark_subsystem_dirty('interfaces');
/* regenerate cron settings/crontab file */
@@ -597,24 +658,25 @@ if ($_POST) {
header("Location: interfaces.php?if={$if}");
exit;
}
+
+
+
} // end if($_POST)
function handle_pppoe_reset() {
global $_POST, $config, $g, $wancfg, $if;
/* perform a periodic reset? */
- if(!isset($_POST['pppoe_preset'])) {
- setup_pppoe_reset_file($if, false);
+ if(!isset($_POST['pppoe-reset-type'])) {
+ setup_pppoe_reset_file($_POST['ptpid']);
return;
}
if (!is_array($config['cron']['item']))
$config['cron']['item'] = array();
- $itemhash = getMPDCRONSettings();
+ $itemhash = getMPDCRONSettings($_POST['ptpid'], $_POST['if']);
$item = $itemhash['ITEM'];
if (empty($item))
$item = array();
- if (isset($_POST['pppoe_pr_type']) && $_POST['pppoe_pr_type'] == "custom") {
- $wancfg['pppoe']['pppoe-reset-type'] = "custom";
- $pconfig['pppoe_pr_custom'] = true;
+ if (isset($_POST['pppoe-reset-type']) && $_POST['pppoe-reset-type'] == "custom") {
$item['minute'] = $_POST['pppoe_resetminute'];
$item['hour'] = $_POST['pppoe_resethour'];
if (isset($_POST['pppoe_resetdate']) && $_POST['pppoe_resetdate'] <> "" && strlen($_POST['pppoe_resetdate']) == 10) {
@@ -627,10 +689,8 @@ function handle_pppoe_reset() {
}
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
- } else if (isset($_POST['pppoe_pr_type']) && $_POST['pppoe_pr_type'] = "preset") {
- $wancfg['pppoe']['pppoe-reset-type'] = "preset";
- $pconfig['pppoe_pr_preset'] = true;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
+ } else if (isset($_POST['pppoe-reset-type']) && $_POST['pppoe-reset-type'] == "preset") {
switch ($_POST['pppoe_pr_preset_val']) {
case "monthly":
$item['minute'] = "0";
@@ -639,16 +699,16 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
- case "weekly":
+ case "weekly":
$item['minute'] = "0";
$item['hour'] = "0";
$item['mday'] = "*";
$item['month'] = "*";
$item['wday'] = "0";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
case "daily":
$item['minute'] = "0";
@@ -657,7 +717,7 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
case "hourly":
$item['minute'] = "0";
@@ -666,25 +726,15 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
- break;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
+ break;
} // end switch
} // end if
if (isset($itemhash['ID']))
$config['cron']['item'][$itemhash['ID']] = $item;
else
$config['cron']['item'][] = $item;
- /* finally install the pppoerestart file */
- if (isset($_POST['pppoe_preset'])) {
- setup_pppoe_reset_file($if, true);
- $wancfg['pppoe_reset'] = true;
- $wancfg['pppoe_preset'] = true;
- sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP");
- } else {
- unset($wancfg['pppoe_reset']);
- unset($wancfg['pppoe_preset']);
- setup_pppoe_reset_file($if, false);
- }
+
}
function handle_wireless_post() {
@@ -840,21 +890,28 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
<link href="/javascript/datepicker/css/datepicker.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
- function updateType(t){
+ function updateType(t) {
switch(t) {
- <?php
- /* OK, so this is sick using php to generate javascript, but it needed to be done */
- foreach ($types as $key => $val) {
- echo "case \"{$key}\": {\n";
- $t = $types;
- foreach ($t as $k => $v) {
- if ($k != $key) {
- echo "$('{$k}').hide();\n";
- }
+ case "none": {
+ $('static','dhcp','pppoe','pptp').invoke('hide');
+ break;
+ }
+ case "static": {
+ $('none','dhcp','pppoe','pptp').invoke('hide');
+ break;
+ }
+ case "dhcp": {
+ $('none','static','pppoe','pptp').invoke('hide');
+ break;
+ }
+ case "pppoe": {
+ $('none','static','dhcp','pptp').invoke('hide');
+ break;
+ }
+ case "pptp": {
+ $('none','static','dhcp','pppoe').invoke('hide');
+ break;
}
- echo "}\n";
- }
- ?>
}
$(t).show();
}
@@ -865,14 +922,20 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
else
$('allcfg').hide();
}
-
- function show_periodic_reset(obj) {
- if (obj.checked)
- $('presetwrap').show();
- else
- $('presetwrap').hide();
- }
+ function show_reset_settings(reset_type) {
+ if (reset_type == 'preset') {
+ Effect.Appear('pppoepresetwrap', { duration: 0.0 });
+ Effect.Fade('pppoecustomwrap', { duration: 0.0 });
+ }
+ else if (reset_type == 'custom') {
+ Effect.Appear('pppoecustomwrap', { duration: 0.0 });
+ Effect.Fade('pppoepresetwrap', { duration: 0.0 });
+ } else {
+ Effect.Fade('pppoecustomwrap', { duration: 0.0 });
+ Effect.Fade('pppoepresetwrap', { duration: 0.0 });
+ }
+ }
function show_mon_config() {
document.getElementById("showmonbox").innerHTML='';
aodiv = document.getElementById('showmon');
@@ -897,886 +960,908 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
<?php endif; ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td id="mainarea">
- <div class="tabcont">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="listtopic">General configuration</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Enable</td>
- <td width="78%" class="vtable">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable'] == true) echo "checked"; ?> onClick="show_allcfg(this);">
- <strong>Enable Interface</strong>
- </td>
- </tr>
- </table>
- <div style="display:none;" name="allcfg" id="allcfg">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="22%" valign="top" class="vncell">Description</td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="30" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br><span class="vexpl">Enter a description (name) for the interface here.</span>
- </td>
- </tr>
- <?
- if(!$wancfg['serialport']):
- ?>
- <tr>
- <td valign="middle" class="vncell"><strong>Type</strong></td>
- <td class="vtable">
- <select name="type" onChange="updateType(this.value);" class="formselect" id="type">
- <?php
- foreach ($types as $key => $opt) {
- echo "<option onClick=\"updateType('{$key}');\"";
- if ($key == $pconfig['type'])
- echo " selected";
- echo " value=\"{$key}\" >" . htmlspecialchars($opt);
- echo "</option>";
- }
- ?>
- </select>
- </td>
- </tr>
- <?php endif; ?>
- <tr>
- <td valign="top" class="vncell">MAC address</td>
- <td class="vtable">
- <input name="spoofmac" type="text" class="formfld unknown" id="spoofmac" size="30" value="<?=htmlspecialchars($pconfig['spoofmac']);?>">
- <?php
- $ip = getenv('REMOTE_ADDR');
- $mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
- $mac = str_replace("\n","",$mac);
- if($mac):
- ?>
- <a OnClick="document.forms[0].spoofmac.value='<?=$mac?>';" href="#">Insert my local MAC address</a>
- <?php endif; ?>
- <br>
- This field can be used to modify (&quot;spoof&quot;) the MAC
- address of the WAN interface<br>
- (may be required with some cable connections)<br>
- Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx
- or leave blank
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">MTU</td>
- <td class="vtable">
- <input name="mtu" type="text" class="formfld unknown" id="mtu" size="8" value="<?=htmlspecialchars($pconfig['mtu']);?>">
- <br>
- 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.
- </td>
- </tr>
<tr>
- <td colspan="2" valign="top" height="16"></td>
- </tr>
- <tr style="display:none;" name="none" id="none">
- </tr>
- <tr style="display:none;" name="static" id="static">
- <td colspan="2" style="padding:0px;">
+ <td id="mainarea">
+ <div class="tabcont">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td colspan="2" valign="top" class="listtopic">Static IP configuration</td>
+ <td colspan="2" valign="top" class="listtopic">General configuration</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncellreq">IP address</td>
- <td width="78%" class="vtable">
- <input name="ipaddr" type="text" class="formfld unknown" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
- /
- <select name="subnet" class="formselect" id="subnet">
- <?php
- for ($i = 32; $i > 0; $i--) {
- if($i <> 31) {
- echo "<option value=\"{$i}\" ";
- if ($i == $pconfig['subnet']) echo "selected";
- echo ">" . $i . "</option>";
- }
- }
- ?>
- </select>
+ <td width="22%" valign="top" class="vncell">Enable</td>
+ <td width="78%" class="vtable">
+ <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable'] == true) echo "checked"; ?> onClick="show_allcfg(this);">
+ <strong>Enable Interface</strong>
</td>
</tr>
+ </table>
+ <div style="display:none;" name="allcfg" id="allcfg">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td width="22%" valign="top" class="vncellreq">Gateway</td>
+ <td width="22%" valign="top" class="vncell">Description</td>
<td width="78%" class="vtable">
- <select name="gateway" class="formselect" id="gateway">
- <option value="none" selected>None</option>
- <?php
- if(count($a_gateways) > 0) {
- foreach ($a_gateways as $gateway) {
- if($gateway['interface'] == $if) {
- ?>
- <option value="<?=$gateway['name'];?>" <?php if ($gateway['name'] == $pconfig['gateway']) echo "selected"; ?>>
- <?=htmlspecialchars($gateway['name']) . " - " . htmlspecialchars($gateway['gateway']);?>
- </option>
- <?php
- }
- }
- }
- ?>
+ <input name="descr" type="text" class="formfld unknown" id="descr" size="30" value="<?=htmlspecialchars($pconfig['descr']);?>">
+ <br><span class="vexpl">Enter a description (name) for the interface here.</span>
+ </td>
+ </tr>
+ <? if(!$wancfg['serialport']): ?>
+ <tr>
+ <td valign="middle" class="vncell"><strong>Type</strong></td>
+ <td class="vtable">
+ <select name="type" onChange="updateType(this.value);" class="formselect" id="type">
+ <?php
+ foreach ($types as $key => $opt) {
+ //echo "<option onClick=\"updateType('{$key}');\"";
+ echo "<option";
+ $select = "";
+ if ($key == $pconfig['type'])
+ $select = "selected";
+ echo " value=\"{$key}\" {$select}>" . htmlspecialchars($opt) . "</option>";
+ }
+ ?>
</select>
- <br/>
- <div id='addgwbox'>
- If this interface is an Internet connection, select an existing Gateway from the list or <a OnClick="show_add_gateway();" href="#">add a new one</a>.
- </div>
- <div id='notebox'>
- </div>
- <div id="status">
- </div>
- <div style="display:none" id="addgateway" name="addgateway">
- <p>
- <table border="1" style="background:#990000; border-style: none none none none; width:225px;"><tr><td>
- <table bgcolor="#990000" cellpadding="1" cellspacing="1">
- <tr><td>&nbsp;</td>
- <tr>
- <td colspan="2"><center><b><font color="white">Add new gateway:</b></center></td>
- </tr>
- <tr><td>&nbsp;</td>
- <?php
- if($if == "wan" || $if == "WAN")
- $checked = " CHECKED";
- ?>
- <tr>
- <td width="45%" align="right"><font color="white">Default gateway:</td><td><input type="checkbox" id="defaultgw" name="defaultgw"<?=$checked?>></td>
- </tr>
- <tr>
- <td align="right"><font color="white">Gateway Name:</td><td><input id="name" name="name" value="<?=$wancfg['descr'] . "GW"?>"></td>
- </tr>
- <tr>
- <td align="right"><font color="white">Gateway IP:</td><td><input id="gatewayip" name="gatewayip"></td>
- </tr>
- <tr>
- <td align="right"><font color="white">Description:</td><td><input id="gatewaydescr" name="gatewaydescr"></td>
- </tr>
- <tr><td>&nbsp;</td>
- <tr>
- <td colspan="2">
- <center>
- <div id='savebuttondiv'>
- <input type="hidden" name="addrtype" id="addrtype" value="IPv4" />
- <input id="gwsave" type="Button" value="Save Gateway" onClick='hide_add_gatewaysave();'>
- <input id="gwcancel" type="Button" value="Cancel" onClick='hide_add_gateway();'>
- </div>
- </center>
- </td>
- </tr>
- <tr><td>&nbsp;</td>
- </table>
- </td></tr></table>
- <p/>
- </div>
</td>
</tr>
- </table>
- </td>
- </tr>
- <tr style="display:none;" name="dhcp" id="dhcp">
- <td colspan="2" style="padding: 0px;">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="listtopic">DHCP client configuration</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Hostname</td>
- <td width="78%" class="vtable">
- <input name="dhcphostname" type="text" class="formfld unknown" id="dhcphostname" size="40" value="<?=htmlspecialchars($pconfig['dhcphostname']);?>">
- <br>
- The value in this field is sent as the DHCP client identifier
- and hostname when requesting a DHCP lease. Some ISPs may require
- this (for client identification).
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Alias IP address</td>
- <td width="78%" class="vtable">
- <input name="alias-address" type="text" class="formfld unknown" id="alias-address" size="20" value="<?=htmlspecialchars($pconfig['alias-address']);?>">
- <select name="alias-subnet" class="formselect" id="alias-subnet">
- <?php
- for ($i = 32; $i > 0; $i--) {
- if($i <> 31) {
- echo "<option value=\"{$i}\" ";
- if ($i == $pconfig['alias-subnet']) echo "selected";
- echo ">" . $i . "</option>";
- }
- }
- ?>
- </select>
- The value in this field is used as a fixed alias IP address by the
- DHCP client.
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr style="display:none;" name="pppoe" id="pppoe">
- <td colspan="2" style="padding:0px;">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="listtopic">PPPoE configuration</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Username</td>
- <td width="78%" class="vtable">
- <input name="pppoe_username" type="text" class="formfld user" id="pppoe_username" size="20" value="<?=htmlspecialchars($pconfig['pppoe_username']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Password</td>
- <td width="78%" class="vtable">
- <input name="pppoe_password" type="password" class="formfld pwd" id="pppoe_password" size="20" value="<?=htmlspecialchars($pconfig['pppoe_password']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Service name</td>
- <td width="78%" class="vtable"><input name="provider" type="text" class="formfld unknown" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>">
- <br> <span class="vexpl">Hint: this field can usually be left empty</span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Dial on demand</td>
- <td width="78%" class="vtable">
- <input name="pppoe_dialondemand" type="checkbox" id="pppoe_dialondemand" value="enable" <?php if ($pconfig['pppoe_dialondemand']) echo "checked"; ?>>
- <strong>Enable Dial-On-Demand mode</strong><br>
- This option causes the interface to operate in dial-on-demand mode, allowing you to have a <i>virtual full time</i> connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Idle timeout</td>
- <td width="78%" class="vtable">
- <input name="pppoe_idletimeout" type="text" class="formfld unknown" id="pppoe_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pppoe_idletimeout']);?>"> seconds<br>If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td>
- <td width="78%" class="vtable">
- <input name="pppoe_preset" type="checkbox" id="pppoe_preset" value="yes" <?php if ($pconfig['pppoe_preset']) echo "checked=\"checked\""; ?> onclick="show_periodic_reset(this);" />
- <?= gettext("enable periodic PPPoE resets"); ?>
- <br />
- <?php if ($pconfig['pppoe_preset']): ?>
- <table id="presetwrap" cellspacing="0" cellpadding="0" width="100%">
- <?php else: ?>
- <table id="presetwrap" cellspacing="0" cellpadding="0" width="100%" style="display: none;">
- <?php endif; ?>
- <tr>
- <td align="left" valign="top">
- <p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;">
- <input name="pppoe_pr_type" type="radio" id="pppoe_pr_custom" value="custom" <?php if ($pconfig['pppoe_pr_custom']) echo "checked=\"checked\""; ?> onclick="if (this.checked) { Effect.Appear('pppoecustomwrap', { duration: 0.0 }); Effect.Fade('pppoepresetwrap', { duration: 0.0 }); }" />
- <?= gettext("provide a custom reset time"); ?>
- <br />
- <input name="pppoe_pr_type" type="radio" id="pppoe_pr_preset" value="preset" <?php if ($pconfig['pppoe_pr_preset']) echo "checked=\"checked\""; ?> onclick="if (this.checked) { Effect.Appear('pppoepresetwrap', { duration: 0.0 }); Effect.Fade('pppoecustomwrap', { duration: 0.0 }); }" />
- <?= gettext("select reset time from a preset"); ?>
- </p>
- <?php if ($pconfig['pppoe_pr_custom']): ?>
- <p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap">
- <?php else: ?>
- <p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap">
- <?php endif; ?>
- <input type="text" name="pppoe_resethour" class="fd_incremental_inp_range_0_23 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resethour" value="<?= $pconfig['pppoe_resethour']; ?>" size="3" />
- <?= gettext("hour (0-23)"); ?><br />
- <input type="text" name="pppoe_resetminute" class="fd_incremental_inp_range_0_59 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resetminute" value="<?= $pconfig['pppoe_resetminute']; ?>" size="3" />
- <?= gettext("minute (0-59)"); ?><br />
- <input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" />
- <?= gettext("reset at a specific date (mm/dd/yyyy)"); ?>
- <br />&nbsp;<br />
- <span class="red"><strong>Note: </strong></span>
- If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field.
- </p>
- <?php if ($pconfig['pppoe_pr_preset']): ?>
- <p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap">
- <?php else: ?>
- <p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap">
- <?php endif; ?>
- <input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> />
- <?= gettext("reset at each month ('0 0 1 * *')"); ?>
- <br />
- <input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> />
- <?= gettext("reset at each week ('0 0 * * 0')"); ?>
- <br />
- <input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> />
- <?= gettext("reset at each day ('0 0 * * *')"); ?>
- <br />
- <input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> />
- <?= gettext("reset at each hour ('0 * * * *')"); ?>
- </p>
+ <?php endif; ?>
+ <tr>
+ <td valign="top" class="vncell">MAC address</td>
+ <td class="vtable">
+ <input name="spoofmac" type="text" class="formfld unknown" id="spoofmac" size="30" value="<?=htmlspecialchars($pconfig['spoofmac']);?>">
+ <?php
+ $ip = getenv('REMOTE_ADDR');
+ $mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
+ $mac = str_replace("\n","",$mac);
+ if($mac):
+ ?>
+ <a OnClick="document.forms[0].spoofmac.value='<?=$mac?>';" href="#">Insert my local MAC address</a>
+ <?php endif; ?>
+ <br>
+ This field can be used to modify (&quot;spoof&quot;) the MAC
+ address of the WAN interface<br>
+ (may be required with some cable connections)<br>
+ Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx
+ or leave blank
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">MTU</td>
+ <td class="vtable">
+ <input name="mtu" type="text" class="formfld unknown" id="mtu" size="8" value="<?=htmlspecialchars($pconfig['mtu']);?>">
+ <br>
+ 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.
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" height="16"></td>
+ </tr>
+ <tr style="display:none;" name="none" id="none">
+ </tr>
+ <tr style="display:none;" name="static" id="static">
+ <td colspan="2" style="padding:0px;">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Static IP configuration</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">IP address</td>
+ <td width="78%" class="vtable">
+ <input name="ipaddr" type="text" class="formfld unknown" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
+ /
+ <select name="subnet" class="formselect" id="subnet">
+ <?php
+ for ($i = 32; $i > 0; $i--) {
+ if($i <> 31) {
+ echo "<option value=\"{$i}\" ";
+ if ($i == $pconfig['subnet']) echo "selected";
+ echo ">" . $i . "</option>";
+ }
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Gateway</td>
+ <td width="78%" class="vtable">
+ <select name="gateway" class="formselect" id="gateway">
+ <option value="none" selected>None</option>
+ <?php
+ if(count($a_gateways) > 0) {
+ foreach ($a_gateways as $gateway) {
+ if($gateway['interface'] == $if) {
+ ?>
+ <option value="<?=$gateway['name'];?>" <?php if ($gateway['name'] == $pconfig['gateway']) echo "selected"; ?>>
+ <?=htmlspecialchars($gateway['name']) . " - " . htmlspecialchars($gateway['gateway']);?>
+ </option>
+ <?php
+ }
+ }
+ }
+ ?>
+ </select>
+ <br/>
+ <div id='addgwbox'>
+ If this interface is an Internet connection, select an existing Gateway from the list or <a OnClick="show_add_gateway();" href="#">add a new one</a>.
+ </div>
+ <div id='notebox'>
+ </div>
+ <div id="status">
+ </div>
+ <div style="display:none" id="addgateway" name="addgateway">
+ <p>
+ <table border="1" style="background:#990000; border-style: none none none none; width:225px;">
+ <tr>
+ <td>
+ <table bgcolor="#990000" cellpadding="1" cellspacing="1">
+ <tr><td>&nbsp;</td>
+ <tr>
+ <td colspan="2"><center><b><font color="white">Add new gateway:</font></b></center></td>
+ </tr>
+ <tr><td>&nbsp;</td>
+ <?php
+ if($if == "wan" || $if == "WAN")
+ $checked = " CHECKED";
+ ?>
+ <tr>
+ <td width="45%" align="right"><font color="white">Default gateway:</td><td><input type="checkbox" id="defaultgw" name="defaultgw"<?=$checked?>></td>
+ </tr>
+ <tr>
+ <td align="right"><font color="white">Gateway Name:</td><td><input id="name" name="name" value="<?=$wancfg['descr'] . "GW"?>"></td>
+ </tr>
+ <tr>
+ <td align="right"><font color="white">Gateway IP:</td><td><input id="gatewayip" name="gatewayip"></td>
+ </tr>
+ <tr>
+ <td align="right"><font color="white">Description:</td><td><input id="gatewaydescr" name="gatewaydescr"></td>
+ </tr>
+ <tr><td>&nbsp;</td>
+ <tr>
+ <td colspan="2">
+ <center>
+ <div id='savebuttondiv'>
+ <input type="hidden" name="addrtype" id="addrtype" value="IPv4" />
+ <input id="gwsave" type="Button" value="Save Gateway" onClick='hide_add_gatewaysave();'>
+ <input id="gwcancel" type="Button" value="Cancel" onClick='hide_add_gateway();'>
+ </div>
+ </center>
</td>
</tr>
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
</table>
</td>
</tr>
</table>
- </td>
- </tr>
- <tr style="display:none;" name="pptp" id="pptp">
- <td colspan="2" style="padding:0px;">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="2" valign="top" class="listtopic">PPTP configuration</td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Username</td>
- <td width="78%" class="vtable">
- <input name="pptp_username" type="text" class="formfld user" id="pptp_username" size="20" value="<?=htmlspecialchars($pconfig['pptp_username']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Password</td>
- <td width="78%" class="vtable">
- <input name="pptp_password" type="text" class="formfld pwd" id="pptp_password" size="20" value="<?=htmlspecialchars($pconfig['pptp_password']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" width="100" valign="top" class="vncellreq">Local IP address</td>
- <td width="78%" class="vtable">
- <input name="pptp_local" type="text" class="formfld unknown" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local']);?>">
- /
- <select name="pptp_subnet" class="formselect" id="pptp_subnet">
- <?php for ($i = 31; $i > 0; $i--): ?>
- <option value="<?=$i;?>" <?php if ($i == $pconfig['pptp_subnet']) echo "selected"; ?>>
- <?=$i;?>
- </option>
- <?php endfor; ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" width="100" valign="top" class="vncellreq">Remote IP address</td>
- <td width="78%" class="vtable">
- <input name="pptp_remote" type="text" class="formfld unknown" id="pptp_remote" size="20" value="<?=htmlspecialchars($pconfig['pptp_remote']);?>">
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Dial on demand</td>
- <td width="78%" class="vtable">
- <input name="pptp_dialondemand" type="checkbox" id="pptp_dialondemand" value="enable" <?php if ($pconfig['pptp_dialondemand']) echo "checked"; ?>>
- <strong>Enable Dial-On-Demand mode</strong><br>
- This option causes the interface to operate in dial-on-demand mode, allowing you to have a <i>virtual full time</i> connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">Idle timeout</td>
- <td width="78%" class="vtable">
- <input name="pptp_idletimeout" type="text" class="formfld unknown" id="pptp_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pptp_idletimeout']);?>"> seconds<br>If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <?php
- /* Wireless interface? */
- if (isset($wancfg['wireless'])):
- ?>
- <tr>
- <td colspan="2" valign="top" height="16"></td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic">Common wireless configuration - Settings apply to all wireless networks on <?=$wlanbaseif;?>.</td>
- </tr>
- <tr>
- <td valign="top" class="vncellreq">Standard</td>
- <td class="vtable">
- <select name="standard" class="formselect" id="standard">
+ <p/>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr style="display:none;" name="dhcp" id="dhcp">
+ <td colspan="2" style="padding: 0px;">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">DHCP client configuration</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Hostname</td>
+ <td width="78%" class="vtable">
+ <input name="dhcphostname" type="text" class="formfld unknown" id="dhcphostname" size="40" value="<?=htmlspecialchars($pconfig['dhcphostname']);?>">
+ <br>
+ The value in this field is sent as the DHCP client identifier
+ and hostname when requesting a DHCP lease. Some ISPs may require
+ this (for client identification).
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Alias IP address</td>
+ <td width="78%" class="vtable">
+ <input name="alias-address" type="text" class="formfld unknown" id="alias-address" size="20" value="<?=htmlspecialchars($pconfig['alias-address']);?>">
+ <select name="alias-subnet" class="formselect" id="alias-subnet">
<?php
- foreach($wl_modes as $wl_standard => $wl_channels) {
- echo "<option ";
- if ($pconfig['standard'] == "$wl_standard")
- echo "selected ";
- echo "value=\"$wl_standard\">802.$wl_standard</option>\n";
+ for ($i = 32; $i > 0; $i--) {
+ if($i <> 31) {
+ echo "<option value=\"{$i}\" ";
+ if ($i == $pconfig['alias-subnet']) echo "selected";
+ echo ">" . $i . "</option>";
+ }
}
?>
</select>
+ The value in this field is used as a fixed alias IP address by the
+ DHCP client.
</td>
</tr>
- <?php if (isset($wl_modes['11g'])): ?>
+ </table>
+ </td>
+ </tr>
+ <tr style="display:none;" name="pppoe" id="pppoe">
+ <td colspan="2" style="padding:0px;">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td valign="top" class="vncellreq">802.11g OFDM Protection Mode</td>
- <td class="vtable">
- <select name="protmode" class="formselect" id="protmode">
- <option <? if ($pconfig['protmode'] == 'off') echo "selected";?> value="off">Protection mode off</option>
- <option <? if ($pconfig['protmode'] == 'cts') echo "selected";?> value="cts">Protection mode CTS to self</option>
- <option <? if ($pconfig['protmode'] == 'rtscts') echo "selected";?> value="rtscts">Protection mode RTS and CTS</option>
- </select>
- <br/>
- For IEEE 802.11g, use the specified technique for protecting OFDM frames in a mixed 11b/11g network.
- <br/>
+ <td colspan="2" valign="top" class="listtopic">PPPoE configuration</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Username</td>
+ <td width="78%" class="vtable">
+ <input name="pppoe_username" type="text" class="formfld user" id="pppoe_username" size="20" value="<?=htmlspecialchars($pconfig['pppoe_username']);?>">
</td>
</tr>
- <?php else: ?>
- <input name="protmode" type="hidden" id="protmode" value="off">
- <?php endif; ?>
- <tr>
- <td valign="top" class="vncellreq">Transmit power</td>
- <td class="vtable">
- <select name="txpower" class="formselect" id="txpower">
- <?
- for($x = 99; $x > 0; $x--) {
- if($pconfig["txpower"] == $x)
- $SELECTED = " SELECTED";
- else
- $SELECTED = "";
- echo "<option {$SELECTED}>{$x}</option>\n";
- }
- ?>
- </select><br/>
- Note: Typically only a few discreet power settings are available and the driver will use the setting closest to the specified value. Not all adaptors support changing the transmit power setting.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncellreq">Channel</td>
- <td class="vtable">
- <select name="channel" class="formselect" id="channel">
- <option <? if ($pconfig['channel'] == 0) echo "selected"; ?> value="0">Auto</option>
- <?php
- foreach($wl_modes as $wl_standard => $wl_channels) {
- if($wl_standard == "11g") { $wl_standard = "11b/g"; }
- else if($wl_standard == "11ng") { $wl_standard = "11b/g/n"; }
- else if($wl_standard == "11na") { $wl_standard = "11a/n"; }
- foreach($wl_channels as $wl_channel) {
- echo "<option ";
- if ($pconfig['channel'] == "$wl_channel") {
- echo "selected ";
- }
- echo "value=\"$wl_channel\">$wl_standard - $wl_channel";
- if(isset($wl_chaninfo[$wl_channel]))
- echo " ({$wl_chaninfo[$wl_channel][1]} @ {$wl_chaninfo[$wl_channel][2]} / {$wl_chaninfo[$wl_channel][3]})";
- echo "</option>\n";
- }
- }
- ?>
- </select>
- <br/>
- Legend: wireless standards - channel # (frequency @ max TX power / TX power allowed in reg. domain)
- <br/>
- Note: Not all channels may be supported by your card. Auto may override the wireless standard selected above.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Distance setting</td>
- <td class="vtable">
- <input name="distance" type="text" class="formfld unknown" id="distance" size="5" value="<?=htmlspecialchars($pconfig['distance']);?>">
- <br/>
- Note: This field can be used to tune ACK/CTS timers to fit the distance between AP and Client<br/>
- (measured in Meters and works only for Atheros based cards !)
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Password</td>
+ <td width="78%" class="vtable">
+ <input name="pppoe_password" type="password" class="formfld pwd" id="pppoe_password" size="20" value="<?=htmlspecialchars($pconfig['pppoe_password']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Service name</td>
+ <td width="78%" class="vtable"><input name="provider" type="text" class="formfld unknown" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>">
+ <br> <span class="vexpl">Hint: this field can usually be left empty</span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Dial on demand</td>
+ <td width="78%" class="vtable">
+ <input name="pppoe_dialondemand" type="checkbox" id="pppoe_dialondemand" value="enable" <?php if ($pconfig['pppoe_dialondemand']) echo "checked"; ?>>
+ <strong>Enable Dial-On-Demand mode</strong><br>
+ This option causes the interface to operate in dial-on-demand mode, allowing you to have a <i>virtual full time</i> connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Idle timeout</td>
+ <td width="78%" class="vtable">
+ <input name="pppoe_idletimeout" type="text" class="formfld unknown" id="pppoe_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pppoe_idletimeout']);?>"> seconds<br>If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td>
+ <td width="78%" class="vtable">
+ <table id="presetwrap" cellspacing="0" cellpadding="0" width="100%">
+ <tr>
+ <td align="left" valign="top">
+ <p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;">
+ <select valign="top" id="reset_type" name="pppoe-reset-type" class="formselect" onChange="show_reset_settings(this.value);">
+ <option value = ""><?= gettext("Disabled"); ?></option>
+ <option value="custom" <?php if ($pconfig['pppoe-reset-type'] == "custom") echo "selected"; ?>><?= gettext("Custom"); ?></option>
+ <option value="preset" <?php if ($pconfig['pppoe-reset-type'] == "preset") echo "selected"; ?>><?= gettext("Pre-Set"); ?></option>
+ </select> <?= gettext("Select a reset timing type"); ?>
+ </p>
+ <?php if ($pconfig['pppoe_pr_custom']): ?>
+ <p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap">
+ <?php else: ?>
+ <p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap">
+ <?php endif; ?>
+ <input type="text" name="pppoe_resethour" class="fd_incremental_inp_range_0_23 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resethour" value="<?= $pconfig['pppoe_resethour']; ?>" size="3" />
+ <?= gettext("hour (0-23)"); ?><br />
+ <input type="text" name="pppoe_resetminute" class="fd_incremental_inp_range_0_59 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resetminute" value="<?= $pconfig['pppoe_resetminute']; ?>" size="3" />
+ <?= gettext("minute (0-59)"); ?><br />
+ <input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" />
+ <?= gettext("reset at a specific date (mm/dd/yyyy)"); ?>
+ <br />&nbsp;<br />
+ <span class="red"><strong>Note: </strong></span>
+ <?= gettext("If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field."); ?>
+ </p>
+ <?php if ($pconfig['pppoe_pr_preset']): ?>
+ <p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap">
+ <?php else: ?>
+ <p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap">
+ <?php endif; ?>
+ <input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> />
+ <?= gettext("reset at each month ('0 0 1 * *')"); ?>
+ <br />
+ <input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> />
+ <?= gettext("reset at each week ('0 0 * * 0')"); ?>
+ <br />
+ <input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> />
+ <?= gettext("reset at each day ('0 0 * * *')"); ?>
+ <br />
+ <input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> />
+ <?= gettext("reset at each hour ('0 * * * *')"); ?>
+ </p>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell">More</td>
+ <?php if (isset($pconfig['pppid'])): ?>
+ <td width="78%" class="vtable">For additional PPPoE configuration options
+ <a href="/interfaces_ppps_edit.php?id=<?=htmlspecialchars($pconfig['pppid']);?>" class="navlnk">click here</a>
</td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Regulatory settings</td>
- <td class="vtable">
- Regulatory domain<br/>
- <select name="regdomain" class="formselect" id="regdomain">
- <option <? if (empty($pconfig['regdomain'])) echo "selected"; ?> value="">Default</option>
- <?php
- foreach($wl_regdomains as $wl_regdomain_key => $wl_regdomain) {
- echo "<option ";
- if ($pconfig['regdomain'] == $wl_regdomains_attr[$wl_regdomain_key]['ID']) {
- echo "selected ";
- }
- echo "value=\"{$wl_regdomains_attr[$wl_regdomain_key]['ID']}\">{$wl_regdomain['name']}</option>\n";
- }
- ?>
- </select>
- <br/>
- Note: Some cards have a default that is not recognized and require changing the regulatory domain to one in this list for the changes to other regulatory settings to work.
- <br/><br/>
- Country (listed with country code and regulatory domain)<br/>
- <select name="regcountry" class="formselect" id="regcountry">
- <option <? if (empty($pconfig['regcountry'])) echo "selected"; ?> value="">Default</option>
- <?php
- foreach($wl_countries as $wl_country_key => $wl_country) {
- echo "<option ";
- if ($pconfig['regcountry'] == $wl_countries_attr[$wl_country_key]['ID']) {
- echo "selected ";
- }
- echo "value=\"{$wl_countries_attr[$wl_country_key]['ID']}\">{$wl_country['name']} -- ({$wl_countries_attr[$wl_country_key]['ID']}, " . strtoupper($wl_countries_attr[$wl_country_key]['rd'][0]['REF']) . ")</option>\n";
- }
- ?>
- </select>
- <br/>
- Note: Any country setting other than "Default" will override the regulatory domain setting.
- <br/><br/>
- Location<br/>
- <select name="reglocation" class="formselect" id="reglocation">
- <option <? if ($pconfig['reglocation'] == 'indoor') echo "selected"; ?> value="indoor">Indoor</option>
- <option <? if ($pconfig['reglocation'] == 'outdoor') echo "selected"; ?> value="outdoor">Outdoor</option>
- <option <? if ($pconfig['reglocation'] == 'anywhere') echo "selected"; ?> value="anywhere">Anywhere</option>
- </select>
- <br/><br/>
- These settings may affect which channels are available and the maximum transmit power allowed on those channels. Using the correct settings to comply with local regulatory requirements is recommended.
- <br/>
- Note: All wireless networks on this interface will be temporarily brought down when changing regulatory settings. Some of the regulatory domains or country codes may not be allowed by some cards. These settings may not be able to add additional channels that are not already supported.
+ <? else: ?>
+ <td width="78%" class="vtable">For advanced PPPoE configuration options or MLPPP configuration
+ <a href="/interfaces_ppps_edit.php" class="navlnk">click here</a>
</td>
- </tr>
- <tr>
- <td colspan="2" valign="top" height="16"></td>
- </tr>
- <tr>
- <td colspan="2" valign="top" class="listtopic">Wireless configuration</td>
- </tr>
+ <? endif; ?>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+ <tr style="display:none;" name="pptp" id="pptp">
+ <td colspan="2" style="padding:0px;">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td valign="top" class="vncellreq">Mode</td>
- <td class="vtable">
- <select name="mode" class="formselect" id="mode">
- <option <? if ($pconfig['mode'] == 'bss') echo "selected";?> value="bss">Infrastructure (BSS)</option>
- <option <? if ($pconfig['mode'] == 'adhoc') echo "selected";?> value="adhoc">Ad-hoc (IBSS)</option>
- <option <? if ($pconfig['mode'] == 'hostap') echo "selected";?> value="hostap">Access Point</option>
- </select>
+ <td colspan="2" valign="top" class="listtopic">PPTP configuration</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Username</td>
+ <td width="78%" class="vtable">
+ <input name="pptp_username" type="text" class="formfld user" id="pptp_username" size="20" value="<?=htmlspecialchars($pconfig['pptp_username']);?>">
</td>
</tr>
<tr>
- <td valign="top" class="vncellreq">SSID</td>
- <td class="vtable">
- <input name="ssid" type="text" class="formfld unknown" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']); ?>">
+ <td width="22%" valign="top" class="vncellreq">Password</td>
+ <td width="78%" class="vtable">
+ <input name="pptp_password" type="text" class="formfld pwd" id="pptp_password" size="20" value="<?=htmlspecialchars($pconfig['pptp_password']);?>">
</td>
- </tr>
- <?php if (isset($wl_modes['11ng']) || isset($wl_modes['11na'])): ?>
+ </tr>
<tr>
- <td valign="top" class="vncell">Minimum wireless standard</td>
- <td class="vtable">
- <select name="puremode" class="formselect" id="puremode">
- <option <? if ($pconfig['puremode'] == 'any') echo "selected";?> value="any">Any</option>
- <?php if (isset($wl_modes['11g'])): ?>
- <option <? if ($pconfig['puremode'] == '11g') echo "selected";?> value="11g">802.11g</option>
- <?php endif; ?>
- <option <? if ($pconfig['puremode'] == '11n') echo "selected";?> value="11n">802.11n</option>
+ <td width="22%" width="100" valign="top" class="vncellreq">Local IP address</td>
+ <td width="78%" class="vtable">
+ <input name="pptp_local" type="text" class="formfld unknown" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local']);?>">
+ /
+ <select name="pptp_subnet" class="formselect" id="pptp_subnet">
+ <?php for ($i = 31; $i > 0; $i--): ?>
+ <option value="<?=$i;?>" <?php if ($i == $pconfig['pptp_subnet']) echo "selected"; ?>>
+ <?=$i;?></option>
+ <?php endfor; ?>
</select>
- <br/>
- When operating as an access point, allow only stations capable of the selected wireless standard to associate (stations not capable are not permitted to associate).
</td>
</tr>
- <?php elseif (isset($wl_modes['11g'])): ?>
<tr>
- <td valign="top" class="vncell">802.11g only</td>
- <td class="vtable">
- <input name="puremode" type="checkbox" value="11g" class="formfld" id="puremode" <? if ($pconfig['puremode'] == '11g') echo "checked";?>>
- <br/>When operating as an access point in 802.11g mode, allow only 11g-capable stations to associate (11b-only stations are not permitted to associate).
+ <td width="22%" width="100" valign="top" class="vncellreq">Remote IP address</td>
+ <td width="78%" class="vtable">
+ <input name="pptp_remote" type="text" class="formfld unknown" id="pptp_remote" size="20" value="<?=htmlspecialchars($pconfig['pptp_remote']);?>">
</td>
</tr>
- <?php endif; ?>
<tr>
- <td valign="top" class="vncell">Allow intra-BSS communication</td>
- <td class="vtable">
- <input name="apbridge_enable" type="checkbox" value="yes" class="formfld" id="apbridge_enable" <? if ($pconfig['apbridge_enable']) echo "checked";?>>
- <br/>
- When operating as an access point, enable this if you want to pass packets between wireless clients directly.
- <br/>
- Disabling the internal bridging is useful when traffic is to be processed with packet filtering.
+ <td width="22%" valign="top" class="vncell">Dial on demand</td>
+ <td width="78%" class="vtable">
+ <input name="pptp_dialondemand" type="checkbox" id="pptp_dialondemand" value="enable" <?php if ($pconfig['pptp_dialondemand']) echo "checked"; ?>>
+ <strong>Enable Dial-On-Demand mode</strong><br>
+ This option causes the interface to operate in dial-on-demand mode, allowing you to have a <i>virtual full time</i> connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.
</td>
</tr>
<tr>
- <td valign="top" class="vncell">Enable WME</td>
- <td class="vtable">
- <input name="wme_enable" type="checkbox" class="formfld" id="wme_enable" value="yes" <? if ($pconfig['wme_enable']) echo "checked";?>>
- <br/>Setting this option will force the card to use WME (wireless QoS).
+ <td width="22%" valign="top" class="vncell">Idle timeout</td>
+ <td width="78%" class="vtable">
+ <input name="pptp_idletimeout" type="text" class="formfld unknown" id="pptp_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pptp_idletimeout']);?>"> seconds<br>If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.
</td>
</tr>
+ </table>
+ </td>
+ </tr>
+ <?php
+ /* Wireless interface? */
+ if (isset($wancfg['wireless'])):
+ ?>
+ <tr>
+ <td colspan="2" valign="top" height="16"></td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Common wireless configuration - Settings apply to all wireless networks on <?=$wlanbaseif;?>.</td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncellreq">Standard</td>
+ <td class="vtable">
+ <select name="standard" class="formselect" id="standard">
+ <?php
+ foreach($wl_modes as $wl_standard => $wl_channels) {
+ echo "<option ";
+ if ($pconfig['standard'] == "$wl_standard")
+ echo "selected ";
+ echo "value=\"$wl_standard\">802.$wl_standard</option>\n";
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <?php if (isset($wl_modes['11g'])): ?>
+ <tr>
+ <td valign="top" class="vncellreq">802.11g OFDM Protection Mode</td>
+ <td class="vtable">
+ <select name="protmode" class="formselect" id="protmode">
+ <option <? if ($pconfig['protmode'] == 'off') echo "selected";?> value="off">Protection mode off</option>
+ <option <? if ($pconfig['protmode'] == 'cts') echo "selected";?> value="cts">Protection mode CTS to self</option>
+ <option <? if ($pconfig['protmode'] == 'rtscts') echo "selected";?> value="rtscts">Protection mode RTS and CTS</option>
+ </select>
+ <br/>
+ For IEEE 802.11g, use the specified technique for protecting OFDM frames in a mixed 11b/11g network.
+ <br/>
+ </td>
+ </tr>
+ <?php else: ?>
+ <input name="protmode" type="hidden" id="protmode" value="off">
+ <?php endif; ?>
+ <tr>
+ <td valign="top" class="vncellreq">Transmit power</td>
+ <td class="vtable">
+ <select name="txpower" class="formselect" id="txpower">
+ <?
+ for($x = 99; $x > 0; $x--) {
+ if($pconfig["txpower"] == $x)
+ $SELECTED = " SELECTED";
+ else
+ $SELECTED = "";
+ echo "<option {$SELECTED}>{$x}</option>\n";
+ }
+ ?>
+ </select><br/>
+ Note: Typically only a few discreet power settings are available and the driver will use the setting closest to the specified value. Not all adaptors support changing the transmit power setting.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncellreq">Channel</td>
+ <td class="vtable">
+ <select name="channel" class="formselect" id="channel">
+ <option <? if ($pconfig['channel'] == 0) echo "selected"; ?> value="0">Auto</option>
+ <?php
+ foreach($wl_modes as $wl_standard => $wl_channels) {
+ if($wl_standard == "11g") { $wl_standard = "11b/g"; }
+ else if($wl_standard == "11ng") { $wl_standard = "11b/g/n"; }
+ else if($wl_standard == "11na") { $wl_standard = "11a/n"; }
+ foreach($wl_channels as $wl_channel) {
+ echo "<option ";
+ if ($pconfig['channel'] == "$wl_channel") {
+ echo "selected ";
+ }
+ echo "value=\"$wl_channel\">$wl_standard - $wl_channel";
+ if(isset($wl_chaninfo[$wl_channel]))
+ echo " ({$wl_chaninfo[$wl_channel][1]} @ {$wl_chaninfo[$wl_channel][2]} / {$wl_chaninfo[$wl_channel][3]})";
+ echo "</option>\n";
+ }
+ }
+ ?>
+ </select>
+ <br/>
+ Legend: wireless standards - channel # (frequency @ max TX power / TX power allowed in reg. domain)
+ <br/>
+ Note: Not all channels may be supported by your card. Auto may override the wireless standard selected above.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Distance setting</td>
+ <td class="vtable">
+ <input name="distance" type="text" class="formfld unknown" id="distance" size="5" value="<?=htmlspecialchars($pconfig['distance']);?>">
+ <br/>
+ Note: This field can be used to tune ACK/CTS timers to fit the distance between AP and Client<br/>
+ (measured in Meters and works only for Atheros based cards !)
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Regulatory settings</td>
+ <td class="vtable">
+ Regulatory domain<br/>
+ <select name="regdomain" class="formselect" id="regdomain">
+ <option <? if (empty($pconfig['regdomain'])) echo "selected"; ?> value="">Default</option>
+ <?php
+ foreach($wl_regdomains as $wl_regdomain_key => $wl_regdomain) {
+ echo "<option ";
+ if ($pconfig['regdomain'] == $wl_regdomains_attr[$wl_regdomain_key]['ID']) {
+ echo "selected ";
+ }
+ echo "value=\"{$wl_regdomains_attr[$wl_regdomain_key]['ID']}\">{$wl_regdomain['name']}</option>\n";
+ }
+ ?>
+ </select>
+ <br/>
+ Note: Some cards have a default that is not recognized and require changing the regulatory domain to one in this list for the changes to other regulatory settings to work.
+ <br/><br/>
+ Country (listed with country code and regulatory domain)<br/>
+ <select name="regcountry" class="formselect" id="regcountry">
+ <option <? if (empty($pconfig['regcountry'])) echo "selected"; ?> value="">Default</option>
+ <?php
+ foreach($wl_countries as $wl_country_key => $wl_country) {
+ echo "<option ";
+ if ($pconfig['regcountry'] == $wl_countries_attr[$wl_country_key]['ID']) {
+ echo "selected ";
+ }
+ echo "value=\"{$wl_countries_attr[$wl_country_key]['ID']}\">{$wl_country['name']} -- ({$wl_countries_attr[$wl_country_key]['ID']}, " . strtoupper($wl_countries_attr[$wl_country_key]['rd'][0]['REF']) . ")</option>\n";
+ }
+ ?>
+ </select>
+ <br/>
+ Note: Any country setting other than "Default" will override the regulatory domain setting.
+ <br/><br/>
+ Location<br/>
+ <select name="reglocation" class="formselect" id="reglocation">
+ <option <? if ($pconfig['reglocation'] == 'indoor') echo "selected"; ?> value="indoor">Indoor</option>
+ <option <? if ($pconfig['reglocation'] == 'outdoor') echo "selected"; ?> value="outdoor">Outdoor</option>
+ <option <? if ($pconfig['reglocation'] == 'anywhere') echo "selected"; ?> value="anywhere">Anywhere</option>
+ </select>
+ <br/><br/>
+ These settings may affect which channels are available and the maximum transmit power allowed on those channels. Using the correct settings to comply with local regulatory requirements is recommended.
+ <br/>
+ Note: All wireless networks on this interface will be temporarily brought down when changing regulatory settings. Some of the regulatory domains or country codes may not be allowed by some cards. These settings may not be able to add additional channels that are not already supported.
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" height="16"></td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Wireless configuration</td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncellreq">Mode</td>
+ <td class="vtable">
+ <select name="mode" class="formselect" id="mode">
+ <option <? if ($pconfig['mode'] == 'bss') echo "selected";?> value="bss">Infrastructure (BSS)</option>
+ <option <? if ($pconfig['mode'] == 'adhoc') echo "selected";?> value="adhoc">Ad-hoc (IBSS)</option>
+ <option <? if ($pconfig['mode'] == 'hostap') echo "selected";?> value="hostap">Access Point</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncellreq">SSID</td>
+ <td class="vtable">
+ <input name="ssid" type="text" class="formfld unknown" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']); ?>">
+ </td>
+ </tr>
+ <?php if (isset($wl_modes['11ng']) || isset($wl_modes['11na'])): ?>
+ <tr>
+ <td valign="top" class="vncell">Minimum wireless standard</td>
+ <td class="vtable">
+ <select name="puremode" class="formselect" id="puremode">
+ <option <? if ($pconfig['puremode'] == 'any') echo "selected";?> value="any">Any</option>
+ <?php if (isset($wl_modes['11g'])): ?>
+ <option <? if ($pconfig['puremode'] == '11g') echo "selected";?> value="11g">802.11g</option>
+ <?php endif; ?>
+ <option <? if ($pconfig['puremode'] == '11n') echo "selected";?> value="11n">802.11n</option>
+ </select>
+ <br/>
+ When operating as an access point, allow only stations capable of the selected wireless standard to associate (stations not capable are not permitted to associate).
+ </td>
+ </tr>
+ <?php elseif (isset($wl_modes['11g'])): ?>
+ <tr>
+ <td valign="top" class="vncell">802.11g only</td>
+ <td class="vtable">
+ <input name="puremode" type="checkbox" value="11g" class="formfld" id="puremode" <? if ($pconfig['puremode'] == '11g') echo "checked";?>>
+ <br/>When operating as an access point in 802.11g mode, allow only 11g-capable stations to associate (11b-only stations are not permitted to associate).
+ </td>
+ </tr>
+ <?php endif; ?>
+ <tr>
+ <td valign="top" class="vncell">Allow intra-BSS communication</td>
+ <td class="vtable">
+ <input name="apbridge_enable" type="checkbox" value="yes" class="formfld" id="apbridge_enable" <? if ($pconfig['apbridge_enable']) echo "checked";?>>
+ <br/>
+ When operating as an access point, enable this if you want to pass packets between wireless clients directly.
+ <br/>
+ Disabling the internal bridging is useful when traffic is to be processed with packet filtering.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Enable WME</td>
+ <td class="vtable">
+ <input name="wme_enable" type="checkbox" class="formfld" id="wme_enable" value="yes" <? if ($pconfig['wme_enable']) echo "checked";?>>
+ <br/>Setting this option will force the card to use WME (wireless QoS).
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Enable Hide SSID</td>
+ <td class="vtable">
+ <input name="hidessid_enable" type="checkbox" class="formfld" id="hidessid_enable" value="yes" <? if ($pconfig['hidessid_enable']) echo "checked";?>>
+ <br/>
+ Setting this option will force the card to NOT broadcast its SSID
+ <br/>
+ (this might create problems for some clients).
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">WEP</td>
+ <td class="vtable">
+ <input name="wep_enable" type="checkbox" id="wep_enable" value="yes" <? if ($pconfig['wep_enable']) echo "checked"; ?>>
+ <strong>Enable WEP</strong>
+ <table border="0" cellspacing="0" cellpadding="0">
<tr>
- <td valign="top" class="vncell">Enable Hide SSID</td>
- <td class="vtable">
- <input name="hidessid_enable" type="checkbox" class="formfld" id="hidessid_enable" value="yes" <? if ($pconfig['hidessid_enable']) echo "checked";?>>
- <br/>
- Setting this option will force the card to NOT broadcast its SSID
- <br/>
- (this might create problems for some clients). </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">WEP</td>
- <td class="vtable">
- <input name="wep_enable" type="checkbox" id="wep_enable" value="yes" <? if ($pconfig['wep_enable']) echo "checked"; ?>>
- <strong>Enable WEP</strong>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>&nbsp;TX key&nbsp;</td>
- </tr>
- <tr>
- <td>Key 1:&nbsp;&nbsp;</td>
- <td>
- <input name="key1" type="text" class="formfld unknown" id="key1" size="30" value="<?=htmlspecialchars($pconfig['key1']);?>">
- </td>
- <td align="center">
- <input name="txkey" type="radio" value="1" <? if ($pconfig['txkey'] == 1) echo "checked";?>>
- </td>
- </tr>
- <tr>
- <td>Key 2:&nbsp;&nbsp;</td>
- <td>
- <input name="key2" type="text" class="formfld unknown" id="key2" size="30" value="<?=htmlspecialchars($pconfig['key2']);?>">
- </td>
- <td align="center">
- <input name="txkey" type="radio" value="2" <? if ($pconfig['txkey'] == 2) echo "checked";?>>
- </td>
- </tr>
- <tr>
- <td>Key 3:&nbsp;&nbsp;</td>
- <td>
- <input name="key3" type="text" class="formfld unknown" id="key3" size="30" value="<?=htmlspecialchars($pconfig['key3']);?>">
- </td>
- <td align="center">
- <input name="txkey" type="radio" value="3" <? if ($pconfig['txkey'] == 3) echo "checked";?>>
- </td>
- </tr>
- <tr>
- <td>Key 4:&nbsp;&nbsp;</td>
- <td>
- <input name="key4" type="text" class="formfld unknown" id="key4" size="30" value="<?=htmlspecialchars($pconfig['key4']);?>">
- </td>
- <td align="center">
- <input name="txkey" type="radio" value="4" <? if ($pconfig['txkey'] == 4) echo "checked";?>>
- </td>
- </tr>
- </table>
- <br/>
- 40 (64) bit keys may be entered as 5 ASCII characters or 10 hex digits preceded by '0x'.<br/>
- 104 (128) bit keys may be entered as 13 ASCII characters or 26 hex digits preceded by '0x'.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">WPA</td>
- <td class="vtable">
- <input name="wpa_enable" type="checkbox" class="formfld" id="wpa_enable" value="yes" <? if ($pconfig['wpa_enable']) echo "checked"; ?>>
- <strong>Enable WPA</strong>
- <br/><br/>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>&nbsp;</td>
- <td>&nbsp;WPA Pre Shared Key&nbsp;</td>
- </tr>
- <tr>
- <td>PSK:&nbsp;&nbsp;</td>
- <td>
- <input name="passphrase" type="text" class="formfld unknown" id="passphrase" size="66" value="<?=htmlspecialchars($pconfig['passphrase']);?>">
- </td>
- </tr>
- </table>
- <br/>Passphrase must be from 8 to 63 characters.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">WPA Mode</td>
- <td class="vtable">
- <select name="wpa_mode" class="formselect" id="wpa_mode">
- <option <? if ($pconfig['wpa_mode'] == '1') echo "selected";?> value="1">WPA</option>
- <option <? if ($pconfig['wpa_mode'] == '2') echo "selected";?> value="2">WPA2</option>
- <option <? if ($pconfig['wpa_mode'] == '3') echo "selected";?> value="3">Both</option>
- </select>
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">WPA Key Management Mode</td>
- <td class="vtable">
- <select name="wpa_key_mgmt" class="formselect" id="wpa_key_mgmt">
- <option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK') echo "selected";?> value="WPA-PSK">Pre Shared Key</option>
- <option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-EAP') echo "selected";?> value="WPA-EAP">Extensible Authentication Protocol</option>
- <option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK WPA-EAP') echo "selected";?> value="WPA-PSK WPA-EAP">Both</option>
- </select>
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Authentication</td>
- <td class="vtable">
- <select name="auth_algs" class="formselect" id="auth_algs">
- <option <? if ($pconfig['auth_algs'] == '1') echo "selected";?> value="1">Open System Authentication</option>
- <option <? if ($pconfig['auth_algs'] == '2') echo "selected";?> value="2">Shared Key Authentication</option>
- <option <? if ($pconfig['auth_algs'] == '3') echo "selected";?> value="3">Both</option>
- </select>
- <br/>Note: Shared Key Authentication requires WEP.</br>
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">WPA Pairwise</td>
- <td class="vtable">
- <select name="wpa_pairwise" class="formselect" id="wpa_pairwise">
- <option <? if ($pconfig['wpa_pairwise'] == 'CCMP TKIP') echo "selected";?> value="CCMP TKIP">Both</option>
- <option <? if ($pconfig['wpa_pairwise'] == 'CCMP') echo "selected";?> value="CCMP">AES (recommended)</option>
- <option <? if ($pconfig['wpa_pairwise'] == 'TKIP') echo "selected";?> value="TKIP">TKIP</option>
- </select>
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Key Rotation</td>
- <td class="vtable">
- <input name="wpa_group_rekey" type="text" class="formfld unknown" id="wpa_group_rekey" size="30" value="<? echo $pconfig['wpa_group_rekey'] ? $pconfig['wpa_group_rekey'] : "60";?>">
- <br/>Allowed values are 1-9999 but should not be longer than Master Key Regeneration time.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Master Key Regeneration</td>
- <td class="vtable">
- <input name="wpa_gmk_rekey" type="text" class="formfld" id="wpa_gmk_rekey" size="30" value="<? echo $pconfig['wpa_gmk_rekey'] ? $pconfig['wpa_gmk_rekey'] : "3600";?>">
- <br/>Allowed values are 1-9999 but should not be shorter than Key Rotation time.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Strict Key Regeneration</td>
- <td class="vtable">
- <input name="wpa_strict_rekey" type="checkbox" value="yes" class="formfld" id="wpa_strict_rekey" <? if ($pconfig['wpa_strict_rekey']) echo "checked"; ?>>
- <br/>Setting this option will force the AP to rekey whenever a client disassociates.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Enable IEEE802.1X Authentication</td>
- <td class="vtable">
- <input name="ieee8021x" type="checkbox" value="yes" class="formfld" id="ieee8021x" <? if ($pconfig['ieee8021x']) echo "checked";?>>
- <br/>Setting this option will enable 802.1x authentication.
- <br/><span class="red"><strong>NOTE:</strong</span> this option requires checking the "Enable WPA box".
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">802.1X Authentication Server IP Address</td>
- <td class="vtable">
- <input name="auth_server_addr" id="auth_server_addr" type="text" class="formfld unknown" size="66" value="<?=htmlspecialchars($pconfig['auth_server_addr']);?>">
- <br/>Enter the IP address of the 802.1X Authentication Server. This is commonly a Radius server (FreeRadius, Internet Authentication Services, etc.)
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">802.1X Authentication Server Port</td>
- <td class="vtable">
- <input name="auth_server_port" id="auth_server_port" type="text" class="formfld unknown" size="66" value="<?=htmlspecialchars($pconfig['auth_server_port']);?>">
- <br/>Leave blank for the default 1812 port.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">802.1X Authentication Server Shared Secret</td>
- <td class="vtable">
- <input name="auth_server_shared_secret" id="auth_server_shared_secret" type="text" class="formfld unknown" size="66" value="<?=htmlspecialchars($pconfig['auth_server_shared_secret']);?>">
- <br/>
- </td>
- </tr>
- <? endif; ?>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;TX key&nbsp;</td>
+ </tr>
<tr>
- <td colspan="2" valign="top" height="16"></td>
+ <td>Key 1:&nbsp;&nbsp;</td>
+ <td>
+ <input name="key1" type="text" class="formfld unknown" id="key1" size="30" value="<?=htmlspecialchars($pconfig['key1']);?>">
+ </td>
+ <td align="center">
+ <input name="txkey" type="radio" value="1" <? if ($pconfig['txkey'] == 1) echo "checked";?>>
+ </td>
</tr>
<tr>
- <td colspan="2" valign="top" class="listtopic">Private networks</td>
+ <td>Key 2:&nbsp;&nbsp;</td>
+ <td>
+ <input name="key2" type="text" class="formfld unknown" id="key2" size="30" value="<?=htmlspecialchars($pconfig['key2']);?>">
+ </td>
+ <td align="center">
+ <input name="txkey" type="radio" value="2" <? if ($pconfig['txkey'] == 2) echo "checked";?>>
+ </td>
</tr>
<tr>
- <td valign="middle" class="vncell">&nbsp;</td>
- <td class="vtable">
- <a name="rfc1918"></a>
- <input name="blockpriv" type="checkbox" id="blockpriv" value="yes" <?php if ($pconfig['blockpriv']) echo "checked"; ?>>
- <strong>Block private networks</strong><br>
- When set, this option blocks traffic from IP addresses that are reserved
- for private networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as
- well as loopback addresses (127/8).&nbsp;&nbsp; You should generally
- leave this option turned on, unless your WAN network lies in such
- a private address space, too.
+ <td>Key 3:&nbsp;&nbsp;</td>
+ <td>
+ <input name="key3" type="text" class="formfld unknown" id="key3" size="30" value="<?=htmlspecialchars($pconfig['key3']);?>">
+ </td>
+ <td align="center">
+ <input name="txkey" type="radio" value="3" <? if ($pconfig['txkey'] == 3) echo "checked";?>>
</td>
</tr>
<tr>
- <td valign="middle" class="vncell">&nbsp;</td>
- <td class="vtable">
- <input name="blockbogons" type="checkbox" id="blockbogons" value="yes" <?php if ($pconfig['blockbogons']) echo "checked"; ?>>
- <strong>Block bogon networks</strong><br>
- When set, this option blocks traffic from IP addresses that are reserved
- (but not RFC 1918) or not yet assigned by IANA.&nbsp;&nbsp;
- Bogons are prefixes that should never appear in the Internet routing table,
- and obviously should not appear as the source address in any packets you receive.
+ <td>Key 4:&nbsp;&nbsp;</td>
+ <td>
+ <input name="key4" type="text" class="formfld unknown" id="key4" size="30" value="<?=htmlspecialchars($pconfig['key4']);?>">
+ </td>
+ <td align="center">
+ <input name="txkey" type="radio" value="4" <? if ($pconfig['txkey'] == 4) echo "checked";?>>
</td>
</tr>
- </tr>
- </table>
- </div>
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td width="100" valign="top">
- &nbsp;
- </td>
- <td>
- <br/>
- <input id="save" name="Submit" type="submit" class="formbtn" value="Save">
- <input id="cancel" type="button" class="formbtn" value="Cancel" onclick="history.back()">
- <input name="if" type="hidden" id="if" value="<?=$if;?>">
- </td>
- </tr>
- </table>
- </td>
- </table>
- </div>
- </td></tr>
+ </table>
+ <br/>
+ 40 (64) bit keys may be entered as 5 ASCII characters or 10 hex digits preceded by '0x'.<br/>
+ 104 (128) bit keys may be entered as 13 ASCII characters or 26 hex digits preceded by '0x'.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">WPA</td>
+ <td class="vtable">
+ <input name="wpa_enable" type="checkbox" class="formfld" id="wpa_enable" value="yes" <? if ($pconfig['wpa_enable']) echo "checked"; ?>>
+ <strong>Enable WPA</strong>
+ <br/><br/>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;WPA Pre Shared Key&nbsp;</td>
+ </tr>
+ <tr>
+ <td>PSK:&nbsp;&nbsp;</td>
+ <td>
+ <input name="passphrase" type="text" class="formfld unknown" id="passphrase" size="66" value="<?=htmlspecialchars($pconfig['passphrase']);?>">
+ </td>
+ </tr>
+ </table>
+ <br/>Passphrase must be from 8 to 63 characters.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">WPA Mode</td>
+ <td class="vtable">
+ <select name="wpa_mode" class="formselect" id="wpa_mode">
+ <option <? if ($pconfig['wpa_mode'] == '1') echo "selected";?> value="1">WPA</option>
+ <option <? if ($pconfig['wpa_mode'] == '2') echo "selected";?> value="2">WPA2</option>
+ <option <? if ($pconfig['wpa_mode'] == '3') echo "selected";?> value="3">Both</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">WPA Key Management Mode</td>
+ <td class="vtable">
+ <select name="wpa_key_mgmt" class="formselect" id="wpa_key_mgmt">
+ <option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK') echo "selected";?> value="WPA-PSK">Pre Shared Key</option>
+ <option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-EAP') echo "selected";?> value="WPA-EAP">Extensible Authentication Protocol</option>
+ <option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK WPA-EAP') echo "selected";?> value="WPA-PSK WPA-EAP">Both</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Authentication</td>
+ <td class="vtable">
+ <select name="auth_algs" class="formselect" id="auth_algs">
+ <option <? if ($pconfig['auth_algs'] == '1') echo "selected";?> value="1">Open System Authentication</option>
+ <option <? if ($pconfig['auth_algs'] == '2') echo "selected";?> value="2">Shared Key Authentication</option>
+ <option <? if ($pconfig['auth_algs'] == '3') echo "selected";?> value="3">Both</option>
+ </select>
+ <br/>Note: Shared Key Authentication requires WEP.</br>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">WPA Pairwise</td>
+ <td class="vtable">
+ <select name="wpa_pairwise" class="formselect" id="wpa_pairwise">
+ <option <? if ($pconfig['wpa_pairwise'] == 'CCMP TKIP') echo "selected";?> value="CCMP TKIP">Both</option>
+ <option <? if ($pconfig['wpa_pairwise'] == 'CCMP') echo "selected";?> value="CCMP">AES (recommended)</option>
+ <option <? if ($pconfig['wpa_pairwise'] == 'TKIP') echo "selected";?> value="TKIP">TKIP</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Key Rotation</td>
+ <td class="vtable">
+ <input name="wpa_group_rekey" type="text" class="formfld unknown" id="wpa_group_rekey" size="30" value="<? echo $pconfig['wpa_group_rekey'] ? $pconfig['wpa_group_rekey'] : "60";?>">
+ <br/>Allowed values are 1-9999 but should not be longer than Master Key Regeneration time.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Master Key Regeneration</td>
+ <td class="vtable">
+ <input name="wpa_gmk_rekey" type="text" class="formfld" id="wpa_gmk_rekey" size="30" value="<? echo $pconfig['wpa_gmk_rekey'] ? $pconfig['wpa_gmk_rekey'] : "3600";?>">
+ <br/>Allowed values are 1-9999 but should not be shorter than Key Rotation time.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Strict Key Regeneration</td>
+ <td class="vtable">
+ <input name="wpa_strict_rekey" type="checkbox" value="yes" class="formfld" id="wpa_strict_rekey" <? if ($pconfig['wpa_strict_rekey']) echo "checked"; ?>>
+ <br/>Setting this option will force the AP to rekey whenever a client disassociates.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Enable IEEE802.1X Authentication</td>
+ <td class="vtable">
+ <input name="ieee8021x" type="checkbox" value="yes" class="formfld" id="ieee8021x" <? if ($pconfig['ieee8021x']) echo "checked";?>>
+ <br/>Setting this option will enable 802.1x authentication.
+ <br/><span class="red"><strong>NOTE:</strong</span> this option requires checking the "Enable WPA box".
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">802.1X Authentication Server IP Address</td>
+ <td class="vtable">
+ <input name="auth_server_addr" id="auth_server_addr" type="text" class="formfld unknown" size="66" value="<?=htmlspecialchars($pconfig['auth_server_addr']);?>">
+ <br/>Enter the IP address of the 802.1X Authentication Server. This is commonly a Radius server (FreeRadius, Internet Authentication Services, etc.)
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">802.1X Authentication Server Port</td>
+ <td class="vtable">
+ <input name="auth_server_port" id="auth_server_port" type="text" class="formfld unknown" size="66" value="<?=htmlspecialchars($pconfig['auth_server_port']);?>">
+ <br/>Leave blank for the default 1812 port.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">802.1X Authentication Server Shared Secret</td>
+ <td class="vtable">
+ <input name="auth_server_shared_secret" id="auth_server_shared_secret" type="text" class="formfld unknown" size="66" value="<?=htmlspecialchars($pconfig['auth_server_shared_secret']);?>">
+ <br/>
+ </td>
+ </tr>
+ <? endif; ?>
+ <tr>
+ <td colspan="2" valign="top" height="16"></td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Private networks</td>
+ </tr>
+ <tr>
+ <td valign="middle" class="vncell">&nbsp;</td>
+ <td class="vtable">
+ <a name="rfc1918"></a>
+ <input name="blockpriv" type="checkbox" id="blockpriv" value="yes" <?php if ($pconfig['blockpriv']) echo "checked"; ?>>
+ <strong>Block private networks</strong><br>
+ When set, this option blocks traffic from IP addresses that are reserved
+ for private networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as
+ well as loopback addresses (127/8).&nbsp;&nbsp; You should generally
+ leave this option turned on, unless your WAN network lies in such
+ a private address space, too.
+ </td>
+ </tr>
+ <tr>
+ <td valign="middle" class="vncell">&nbsp;</td>
+ <td class="vtable">
+ <input name="blockbogons" type="checkbox" id="blockbogons" value="yes" <?php if ($pconfig['blockbogons']) echo "checked"; ?>>
+ <strong>Block bogon networks</strong><br>
+ When set, this option blocks traffic from IP addresses that are reserved
+ (but not RFC 1918) or not yet assigned by IANA.&nbsp;&nbsp;
+ Bogons are prefixes that should never appear in the Internet routing table,
+ and obviously should not appear as the source address in any packets you receive.
+ </td>
+ </tr>
+ </table> <!-- End "allcfg" table -->
+ </div> <!-- End "allcfg" div -->
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="100" valign="top">
+ &nbsp;
+ </td>
+ <td>
+ <br/>
+ <input id="save" name="Submit" type="submit" class="formbtn" value="Save">
+ <input id="cancel" type="button" class="formbtn" value="Cancel" onclick="history.back()">
+ <input name="if" type="hidden" id="if" value="<?=$if;?>">
+ <?php if ($wancfg['ptpid'] == $a_ppps[$pppid]['ptpid']) : ?>
+ <input name="pppid" type="hidden" value="<?=$pppid;?>">
+ <input name="ppp_port" type="hidden" value="<?=$a_ppps[$pppid]['ports'];?>">
+ <input name="ptpid" type="hidden" value="<?=$a_ppps[$pppid]['ptpid'];?>">
+ <input name="defaultgw" type="hidden" value="<?=$pconfig['defaultgw'];?>">
+ <?php else: ?>
+ <input name="ptpid" type="hidden" value="<?=uniqid('', true);?>">
+ <?php endif; ?>
+ </td>
+ </tr>
</table>
- </form>
- <script type="text/javascript">
- var gatewayip;
- var name;
- function show_add_gateway() {
- document.getElementById("addgateway").style.display = '';
- document.getElementById("addgwbox").style.display = 'none';
- document.getElementById("gateway").style.display = 'none';
- document.getElementById("save").style.display = 'none';
- document.getElementById("cancel").style.display = 'none';
- document.getElementById("gwsave").style.display = '';
- document.getElementById("gwcancel").style.display = '';
- $('notebox').innerHTML="";
- }
- function hide_add_gateway() {
- document.getElementById("addgateway").style.display = 'none';
- document.getElementById("addgwbox").style.display = '';
- document.getElementById("gateway").style.display = '';
- document.getElementById("save").style.display = '';
- document.getElementById("cancel").style.display = '';
- document.getElementById("gwsave").style.display = '';
- document.getElementById("gwcancel").style.display = '';
- }
- function hide_add_gatewaysave() {
- document.getElementById("addgateway").style.display = 'none';
- $('status').innerHTML = '<img src="/themes/metallic/images/misc/loader.gif"> One moment please...';
- var iface = $F('if');
- name = $('name').getValue();
- var descr = $('gatewaydescr').getValue();
- gatewayip = $('gatewayip').getValue();
- addrtype = $('addrtype').getValue();
- var defaultgw = $('defaultgw').getValue();
- var url = "system_gateways_edit.php";
- var pars = 'isAjax=true&defaultgw=' + escape(defaultgw) + '&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip) + '&type=' + escape(addrtype);
- var myAjax = new Ajax.Request(
- url,
- {
- method: 'post',
- parameters: pars,
- onFailure: report_failure,
- onComplete: save_callback
- });
- }
- function addOption(selectbox,text,value)
- {
- var optn = document.createElement("OPTION");
- optn.text = text;
- optn.value = value;
- selectbox.options.add(optn);
- selectbox.selectedIndex = (selectbox.options.length-1);
- $('notebox').innerHTML="<p/><strong>NOTE:</strong> You can manage Gateways <a target='_new' href='system_gateways.php'>here</a>.";
- }
- function report_failure() {
- alert("Sorry, we could not create your gateway at this time.");
- hide_add_gateway();
- }
- function save_callback(transport) {
- var response = transport.responseText;
- if(response) {
- document.getElementById("addgateway").style.display = 'none';
- hide_add_gateway();
- $('status').innerHTML = '';
- addOption($('gateway'), name, name);
- // Auto submit form?
- //document.iform.submit();
- //$('status').innerHTML = '<img src="/themes/metallic/images/misc/loader.gif">';
- } else {
- report_failure();
- }
- }
- <?php
- if ($if == "wan" || $if == "lan")
- echo "\$('allcfg').show();";
- else
- echo "show_allcfg(document.iform.enable);";
- echo "updateType('{$pconfig['type']}')";
- ?>
- </script>
- <?php include("fend.inc"); ?>
- </body>
+ </td>
+ </tr>
+ </table>
+ <!--
+ </div>
+ </td></tr>
+ </table>
+ -->
+ </form>
+ <script type="text/javascript">
+ var gatewayip;
+ var name;
+ function show_add_gateway() {
+ document.getElementById("addgateway").style.display = '';
+ document.getElementById("addgwbox").style.display = 'none';
+ document.getElementById("gateway").style.display = 'none';
+ document.getElementById("save").style.display = 'none';
+ document.getElementById("cancel").style.display = 'none';
+ document.getElementById("gwsave").style.display = '';
+ document.getElementById("gwcancel").style.display = '';
+ $('notebox').innerHTML="";
+ }
+ function hide_add_gateway() {
+ document.getElementById("addgateway").style.display = 'none';
+ document.getElementById("addgwbox").style.display = '';
+ document.getElementById("gateway").style.display = '';
+ document.getElementById("save").style.display = '';
+ document.getElementById("cancel").style.display = '';
+ document.getElementById("gwsave").style.display = '';
+ document.getElementById("gwcancel").style.display = '';
+ }
+ function hide_add_gatewaysave() {
+ document.getElementById("addgateway").style.display = 'none';
+ $('status').innerHTML = '<img src="/themes/metallic/images/misc/loader.gif"> One moment please...';
+ var iface = $F('if');
+ name = $('name').getValue();
+ var descr = $('gatewaydescr').getValue();
+ gatewayip = $('gatewayip').getValue();
+ addrtype = $('addrtype').getValue();
+ var defaultgw = $('defaultgw').getValue();
+ var url = "system_gateways_edit.php";
+ var pars = 'isAjax=true&defaultgw=' + escape(defaultgw) + '&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip) + '&type=' + escape(addrtype);
+ var myAjax = new Ajax.Request(
+ url,
+ {
+ method: 'post',
+ parameters: pars,
+ onFailure: report_failure,
+ onComplete: save_callback
+ });
+ }
+ function addOption(selectbox,text,value)
+ {
+ var optn = document.createElement("OPTION");
+ optn.text = text;
+ optn.value = value;
+ selectbox.options.add(optn);
+ selectbox.selectedIndex = (selectbox.options.length-1);
+ $('notebox').innerHTML="<p/><strong>NOTE:</strong> You can manage Gateways <a target='_new' href='system_gateways.php'>here</a>.";
+ }
+ function report_failure() {
+ alert("Sorry, we could not create your gateway at this time.");
+ hide_add_gateway();
+ }
+ function save_callback(transport) {
+ var response = transport.responseText;
+ if(response) {
+ document.getElementById("addgateway").style.display = 'none';
+ hide_add_gateway();
+ $('status').innerHTML = '';
+ addOption($('gateway'), name, name);
+ // Auto submit form?
+ //document.iform.submit();
+ //$('status').innerHTML = '<img src="/themes/metallic/images/misc/loader.gif">';
+ } else {
+ report_failure();
+ }
+ }
+ <?php
+ if ($if == "wan" || $if == "lan")
+ echo "\$('allcfg').show();\n";
+ else
+ echo "show_allcfg(document.iform.enable);";
+ echo "updateType('{$pconfig['type']}');\n";
+ ?>
+ </script>
+ <?php include("fend.inc"); ?>
+ </body>
</html>
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index 407755f..36aa469 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -128,10 +128,16 @@ if (is_array($config['qinqs']['qinqentry']) && count($config['qinqs']['qinqentry
/* add PPP interfaces */
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
- $portname = basename($ppp['port']);
+ $portname = $ppp['type'].$pppid;
$portlist[$portname] = $ppp;
$portlist[$portname]['isppp'] = true;
- $portlist[$portname]['descr'] = "PPP " . basename($ppp['port']);
+ $ports_base = basename($ppp['ports']);
+ if (isset($ppp['descr']))
+ $portlist[$portname]['descr'] = strtoupper($ppp['type']). "({$ports_base}) - {$ppp['descr']}";
+ else if (isset($ppp['username']))
+ $portlist[$portname]['descr'] = strtoupper($ppp['type']). "({$ports_base}) - {$ppp['username']}";
+ else
+ $portlist[$portname]['descr'] = strtoupper($ppp['type']). "({$ports_base})";
}
}
@@ -201,11 +207,20 @@ if ($_POST['apply']) {
$reloadif = true;
}
$config['interfaces'][$ifname]['if'] = $ifport;
- if (file_exists("/dev/{$ifport}")) {
- $config['interfaces'][$ifname]['if'] = basename($portlist[$ifport]['port']);
- $config['interfaces'][$ifname]['ipaddr'] = "ppp";
- }
-
+
+ /*For PPP interfaces, write link type to IP address field to signal that IP
+ addr is dynamic and comes from PPP, PPPoE, or PPTP */
+ if (isset($portlist[$ifport]['isppp'])){
+ if ($ifname == "wan")
+ $config['interfaces'][$ifname]['if'] = $portlist[$ifport]['type'] ."0";
+ else
+ $config['interfaces'][$ifname]['if'] = $portlist[$ifport]['type'] . substr($ifname,3);
+
+ $config['interfaces'][$ifname]['ipaddr'] = $portlist[$ifport]['type'];
+ $config['interfaces'][$ifname]['ptpid'] = $portlist[$ifport]['ptpid'];
+ } else
+ unset($config['interfaces'][$ifname]['ptpid']);
+
/* check for wireless interfaces, set or clear ['wireless'] */
if (preg_match($g['wireless_regex'], $ifport)) {
if (!is_array($config['interfaces'][$ifname]['wireless']))
@@ -217,6 +232,7 @@ if ($_POST['apply']) {
/* make sure there is a descr for all interfaces */
if (!isset($config['interfaces'][$ifname]['descr']))
$config['interfaces'][$ifname]['descr'] = strtoupper($ifname);
+
if ($reloadif == true) {
if (preg_match($g['wireless_regex'], $ifport))
interface_sync_wireless_clones($config['interfaces'][$ifname], false);
@@ -263,23 +279,23 @@ if ($_GET['act'] == "del") {
}
if (count($config['filter']['rule']) > 0) {
- foreach ($config['filter']['rule'] as $x => $rule) {
- if($rule['interface'] == $id)
- unset($config['filter']['rule'][$x]);
+ foreach ($config['filter']['rule'] as $x => $rule) {
+ if($rule['interface'] == $id)
+ unset($config['filter']['rule'][$x]);
}
}
if (is_array($config['nat']['advancedoutbound']) && count($config['nat']['advancedoutbound']['rule']) > 0) {
- foreach ($config['nat']['advancedoutbound']['rule'] as $x => $rule) {
- if($rule['interface'] == $id)
- unset($config['nat']['advancedoutbound']['rule'][$x]['interface']);
+ foreach ($config['nat']['advancedoutbound']['rule'] as $x => $rule) {
+ if($rule['interface'] == $id)
+ unset($config['nat']['advancedoutbound']['rule'][$x]['interface']);
}
}
- if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) {
- foreach ($config['nat']['rule'] as $x => $rule) {
- if($rule['interface'] == $id)
- unset($config['nat']['rule'][$x]['interface']);
+ if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) {
+ foreach ($config['nat']['rule'] as $x => $rule) {
+ if($rule['interface'] == $id)
+ unset($config['nat']['rule'][$x]['interface']);
}
- }
+ }
write_config();
@@ -392,11 +408,11 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", false, "interfaces_gre.php");
- $tab_array[7] = array("GIF", false, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[7] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
@@ -420,45 +436,50 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
<td valign="middle" class="listr">
<select name="<?=$ifname;?>" id="<?=$ifname;?>">
<?php foreach ($portlist as $portname => $portinfo): ?>
- <option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo "selected";?>>
- <?php if ($portinfo['isvlan']) {
- $descr = "VLAN {$portinfo['tag']} on {$portinfo['if']}";
- if ($portinfo['descr'])
- $descr .= " (" . $portinfo['descr'] . ")";
- echo htmlspecialchars($descr);
- } elseif ($portinfo['iswlclone']) {
- $descr = $portinfo['cloneif'];
- if ($portinfo['descr'])
- $descr .= " (" . $portinfo['descr'] . ")";
- echo htmlspecialchars($descr);
- } elseif ($portinfo['isppp']) {
- echo htmlspecialchars($portinfo['descr']);
- } elseif ($portinfo['isbridge']) {
- $descr = strtoupper($portinfo['bridgeif']);
- if ($portinfo['descr'])
- $descr .= " (" . $portinfo['descr'] . ")";
- echo htmlspecialchars($descr);
- } elseif ($portinfo['isgre']) {
- $descr = "GRE {$portinfo['remote-addr']}";
- if ($portinfo['descr'])
- $descr .= " (" . $portinfo['descr'] . ")";
- echo htmlspecialchars($descr);
- } elseif ($portinfo['isgif']) {
- $descr = "GRE {$portinfo['remote-addr']}";
- if ($portinfo['descr'])
- $descr .= " (" . $portinfo['descr'] . ")";
- echo htmlspecialchars($descr);
- } elseif ($portinfo['islagg']) {
- $descr = strtoupper($portinfo['laggif']);
- if ($portinfo['descr'])
- $descr .= " (" . $portinfo['descr'] . ")";
- echo htmlspecialchars($descr);
- } elseif ($portinfo['isqinq']) {
- echo htmlspecialchars($portinfo['descr']);
- } else
- echo htmlspecialchars($portname . " (" . $portinfo['mac'] . ")");
- ?>
- </option>
+ <option value="<?=$portname;?>" <?php
+ if (isset($portinfo['isppp'])){
+ if ($portinfo['ptpid'] == $iface['ptpid']) echo "selected";
+ }
+ else
+ if ($portname == $iface['if']) echo "selected";
+ ?>><?php
+ if ($portinfo['isvlan']) {
+ $descr = "VLAN {$portinfo['tag']} on {$portinfo['if']}";
+ if ($portinfo['descr'])
+ $descr .= " (" . $portinfo['descr'] . ")";
+ echo htmlspecialchars($descr);
+ } elseif ($portinfo['iswlclone']) {
+ $descr = $portinfo['cloneif'];
+ if ($portinfo['descr'])
+ $descr .= " (" . $portinfo['descr'] . ")";
+ echo htmlspecialchars($descr);
+ } elseif ($portinfo['isppp']) {
+ echo htmlspecialchars($portinfo['descr']);
+ } elseif ($portinfo['isbridge']) {
+ $descr = strtoupper($portinfo['bridgeif']);
+ if ($portinfo['descr'])
+ $descr .= " (" . $portinfo['descr'] . ")";
+ echo htmlspecialchars($descr);
+ } elseif ($portinfo['isgre']) {
+ $descr = "GRE {$portinfo['remote-addr']}";
+ if ($portinfo['descr'])
+ $descr .= " (" . $portinfo['descr'] . ")";
+ echo htmlspecialchars($descr);
+ } elseif ($portinfo['isgif']) {
+ $descr = "GRE {$portinfo['remote-addr']}";
+ if ($portinfo['descr'])
+ $descr .= " (" . $portinfo['descr'] . ")";
+ echo htmlspecialchars($descr);
+ } elseif ($portinfo['islagg']) {
+ $descr = strtoupper($portinfo['laggif']);
+ if ($portinfo['descr'])
+ $descr .= " (" . $portinfo['descr'] . ")";
+ echo htmlspecialchars($descr);
+ } elseif ($portinfo['isqinq']) {
+ echo htmlspecialchars($portinfo['descr']);
+ } else
+ echo htmlspecialchars($portname . " (" . $portinfo['mac'] . ")");
+ ?></option>
<?php endforeach; ?>
</select>
</td>
diff --git a/usr/local/www/interfaces_bridge.php b/usr/local/www/interfaces_bridge.php
index 9e009ba..8244d50 100644
--- a/usr/local/www/interfaces_bridge.php
+++ b/usr/local/www/interfaces_bridge.php
@@ -91,11 +91,11 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", false, "interfaces_gre.php");
- $tab_array[7] = array("GIF", false, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", true, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[7] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", true, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_gif.php b/usr/local/www/interfaces_gif.php
index cd214e7..f09ef95 100644
--- a/usr/local/www/interfaces_gif.php
+++ b/usr/local/www/interfaces_gif.php
@@ -73,7 +73,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array("Interfaces","gif");
+$pgtitle = array("Interfaces","GIF");
include("head.inc");
?>
@@ -90,11 +90,11 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", false, "interfaces_gre.php");
- $tab_array[7] = array("GIF", true, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[7] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", true, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_gre.php b/usr/local/www/interfaces_gre.php
index 5ad7026..b92a25f 100644
--- a/usr/local/www/interfaces_gre.php
+++ b/usr/local/www/interfaces_gre.php
@@ -90,11 +90,11 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", true, "interfaces_gre.php");
- $tab_array[7] = array("GIF", false, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[7] = array("GRE", true, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_groups.php b/usr/local/www/interfaces_groups.php
index 65564dd..b582eb2 100755
--- a/usr/local/www/interfaces_groups.php
+++ b/usr/local/www/interfaces_groups.php
@@ -70,18 +70,18 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<?php
- $tab_array = array();
- $tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
+ $tab_array = array();
+ $tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", true, "interfaces_groups.php");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
- $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
- $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", false, "interfaces_gre.php");
- $tab_array[7] = array("GIF", false, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
- display_top_tabs($tab_array);
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[7] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
+ display_top_tabs($tab_array);
?>
</td></tr>
<tr>
diff --git a/usr/local/www/interfaces_lagg.php b/usr/local/www/interfaces_lagg.php
index 0beac77..19d2aa2 100644
--- a/usr/local/www/interfaces_lagg.php
+++ b/usr/local/www/interfaces_lagg.php
@@ -96,11 +96,11 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", false, "interfaces_gre.php");
- $tab_array[7] = array("GIF", false, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", true, "interfaces_lagg.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[7] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", true, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_ppp.php b/usr/local/www/interfaces_ppp.php
index 41d36f9..0ef20f0 100644
--- a/usr/local/www/interfaces_ppp.php
+++ b/usr/local/www/interfaces_ppp.php
@@ -90,10 +90,11 @@ include("head.inc");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
$tab_array[5] = array("PPP", true, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", false, "interfaces_gre.php");
- $tab_array[7] = array("GIF", false, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[6] = array("MLPPP", false, "interfaces_mlppp.php");
+ $tab_array[7] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_ppps.php b/usr/local/www/interfaces_ppps.php
new file mode 100644
index 0000000..fc598b6
--- /dev/null
+++ b/usr/local/www/interfaces_ppps.php
@@ -0,0 +1,133 @@
+<?php
+/* $Id$ */
+/*
+ interfaces_ppps.php
+ part 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_BUILDER_BINARIES: /sbin/ifconfig
+ pfSense_MODULE: interfaces
+*/
+
+##|+PRIV
+##|*IDENT=page-interfaces-ppps
+##|*NAME=Interfaces: ppps page
+##|*DESCR=Allow access to the 'Interfaces: ppps' page.
+##|*MATCH=interfaces_ppps.php*
+##|-PRIV
+
+require("guiconfig.inc");
+
+if (!is_array($config['ppps']['ppp']))
+ $config['ppps']['ppp'] = array();
+
+$a_ppps = &$config['ppps']['ppp'] ;
+
+function ppp_inuse($num) {
+ global $config, $g, $a_ppps;
+ $iflist = get_configured_interface_list(false, true);
+ foreach ($iflist as $if) {
+ if (isset($config['interfaces'][$if]['ptpid']) && $config['interfaces'][$if]['ptpid'] == $a_ppps[$num]['ptpid'])
+ return true;
+ }
+ return false;
+}
+
+if ($_GET['act'] == "del") {
+ /* check if still in use */
+ if (ppp_inuse($_GET['id'])) {
+ $input_errors[] = "This point-to-point link cannot be deleted because it is still being used as an interface.";
+ } else {
+ unset($a_ppps[$_GET['id']]);
+ write_config();
+ header("Location: interfaces_ppps.php");
+ exit;
+ }
+}
+
+$pgtitle = "Interfaces: PPPs";
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+<?php
+ $tab_array = array();
+ $tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
+ $tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ display_top_tabs($tab_array);
+?>
+ </td></tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="20%" class="listhdrr">Type</td>
+ <td width="20%" class="listhdrr">Interface(s)/Port(s)</td>
+ <td width="40%" class="listhdr">Description</td>
+ <td width="10%" class="list"></td>
+ </tr>
+ <?php $i = 0; foreach ($a_ppps as $id => $ppp): ?>
+ <tr ondblclick="document.location='interfaces_ppps_edit.php?id=<?=$i;?>'">
+ <td class="listr">
+ <?=htmlspecialchars($ppp['type']);?>
+ </td>
+ <td class="listr">
+ <?=htmlspecialchars($ppp['ports']);?>
+ </td>
+ <td class="listbg">
+ <?=htmlspecialchars($ppp['descr']);?>&nbsp;
+ </td>
+ <td valign="middle" nowrap class="list"> <a href="interfaces_ppps_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a>
+ &nbsp;<a href="interfaces_ppps.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this PPP interface?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ <?php $i++; endforeach; ?>
+ <tr>
+ <td class="list" colspan="3">&nbsp;</td>
+ <td class="list"> <a href="interfaces_ppps_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
+</table>
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php
new file mode 100644
index 0000000..0464a49
--- /dev/null
+++ b/usr/local/www/interfaces_ppps_edit.php
@@ -0,0 +1,891 @@
+<?php
+/* $Id$ */
+/*
+ interfaces_ppps_edit.php
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+ Copyright (C) 2010 Gabriel B. <gnoahb@gmail.com>.
+ 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: interfaces
+*/
+
+##|+PRIV
+##|*IDENT=page-interfaces-ppps-edit
+##|*NAME=Interfaces: PPPs: Edit page
+##|*DESCR=Allow access to the 'Interfaces: PPPs: Edit' page.
+##|*MATCH=interfaces_ppps_edit.php*
+##|-PRIV
+
+require("guiconfig.inc");
+require("functions.inc");
+
+define("CRON_PPPOE_CMD_FILE", "{$g['varetc_path']}/pppoe_restart_");
+define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
+define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
+define("CRON_DAILY_PATTERN", "0 0 * * *");
+define("CRON_HOURLY_PATTERN", "0 * * * *");
+
+function getMPDCRONSettings($ptpid_) {
+ global $config;
+ if (is_array($config['cron']['item'])) {
+ for ($i = 0; $i < count($config['cron']['item']); $i++) {
+ $item = $config['cron']['item'][$i];
+ if (strpos($item['command'], CRON_PPPOE_CMD_FILE.$ptpid_) !== false) {
+ return array("ID" => $i, "ITEM" => $item);
+ }
+ }
+ }
+ return NULL;
+}
+
+if (!is_array($config['ppps']['ppp']))
+ $config['ppps']['ppp'] = array();
+
+$a_ppps = &$config['ppps']['ppp'];
+
+$portlist = get_interface_list();
+
+$id = $_GET['id'];
+if (isset($_POST['id']))
+ $id = $_POST['id'];
+
+
+if (isset($id) && $a_ppps[$id]) {
+ $pconfig['type'] = $a_ppps[$id]['type'];
+ $pconfig['interfaces'] = $a_ppps[$id]['ports'];
+ $pconfig['username'] = $a_ppps[$id]['username'];
+ $pconfig['password'] = base64_decode($a_ppps[$id]['password']);
+ if (isset($a_ppps[$id]['defaultgw']))
+ $pconfig['defaultgw'] = true;
+ if (isset($a_ppps[$id]['ondemand']))
+ $pconfig['ondemand'] = true;
+ $pconfig['idletimeout'] = $a_ppps[$id]['idletimeout'];
+ $pconfig['uptime'] = $a_ppps[$id]['uptime'];
+ $pconfig['descr'] = $a_ppps[$id]['descr'];
+ $pconfig['bandwidth'] = explode(",",$a_ppps[$id]['bandwidth']);
+ $pconfig['mtu'] = explode(",",$a_ppps[$id]['mtu']);
+ $pconfig['mru'] = explode(",",$a_ppps[$id]['mru']);
+ $pconfig['mrru'] = $a_ppps[$id]['mrru'];
+ if (isset($a_ppps[$id]['shortseq']))
+ $pconfig['shortseq'] = true;
+ if (isset($a_ppps[$id]['acfcomp']))
+ $pconfig['acfcomp'] = true;
+ if (isset($a_ppps[$id]['protocomp']))
+ $pconfig['protocomp'] = true;
+ if (isset($a_ppps[$id]['vjcomp']))
+ $pconfig['vjcomp'] = true;
+ if (isset($a_ppps[$id]['tcpmssfix']))
+ $pconfig['tcpmssfix'] = true;
+ if ($a_ppps[$id]['type'] == "ppp") {
+ $pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']);
+ $pconfig['simpin'] = $a_ppps[$id]['simpin'];
+ $pconfig['pin-wait'] = $a_ppps[$id]['pin-wait'];
+ $pconfig['apn'] = $a_ppps[$id]['apn'];
+ $pconfig['apnum'] = $a_ppps[$id]['apnum'];
+ $pconfig['phone'] = $a_ppps[$id]['phone'];
+ $pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout'];
+ $pconfig['localip'] = $a_ppps[$id]['localip'];
+ $pconfig['gateway'] = $a_ppps[$id]['gateway'];
+ }
+ if ($a_ppps[$id]['type'] == "pptp") {
+ $pconfig['localip'] = $a_ppps[$id]['localip'];
+ $pconfig['subnet'] = $a_ppps[$id]['subnet'];
+ $pconfig['gateway'] = $a_ppps[$id]['gateway'];
+ }
+ if ($a_ppps[$id]['type'] == "pppoe") {
+ $pconfig['provider'] = $a_ppps[$id]['provider'];
+ /* ================================================ */
+ /* = force a connection reset at a specific time? = */
+ /* ================================================ */
+
+ if (isset($a_ppps[$id]['pppoe-reset-type'])) {
+ $pconfig['pppoe-reset-type'] = $a_ppps[$id]['pppoe-reset-type'];
+ $itemhash = getMPDCRONSettings($a_ppps[$id]['ptpid']);
+ $cronitem = $itemhash['ITEM'];
+ if (isset($cronitem)) {
+ $resetTime = "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}";
+ } else {
+ $resetTime = NULL;
+ }
+
+ if ($a_ppps[$id]['pppoe-reset-type'] == "custom") {
+ $resetTime_a = split(" ", $resetTime);
+ $pconfig['pppoe_pr_custom'] = true;
+ $pconfig['pppoe_resetminute'] = $resetTime_a[0];
+ $pconfig['pppoe_resethour'] = $resetTime_a[1];
+ /* just initialize $pconfig['pppoe_resetdate'] if the
+ * coresponding item contains appropriate numeric values.
+ */
+ if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*")
+ $pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y");
+ } else if ($a_ppps[$id]['pppoe-reset-type'] == "preset") {
+ $pconfig['pppoe_pr_preset'] = true;
+ switch ($resetTime) {
+ case CRON_MONTHLY_PATTERN:
+ $pconfig['pppoe_monthly'] = true;
+ break;
+ case CRON_WEEKLY_PATTERN:
+ $pconfig['pppoe_weekly'] = true;
+ break;
+ case CRON_DAILY_PATTERN:
+ $pconfig['pppoe_daily'] = true;
+ break;
+ case CRON_HOURLY_PATTERN:
+ $pconfig['pppoe_hourly'] = true;
+ break;
+ }
+ }
+ }
+ }
+
+}
+
+if ($_POST) {
+
+ unset($input_errors);
+ $pconfig = $_POST;
+
+ /* okay first of all, cause we are just hiding the PPPoE HTML
+ * fields releated to PPPoE resets, we are going to unset $_POST
+ * vars, if the reset feature should not be used. Otherwise the
+ * data validation procedure below, may trigger a false error
+ * message.
+ */
+ if (empty($_POST['pppoe-reset-type'])) {
+ unset($_POST['pppoe_resethour']);
+ unset($_POST['pppoe_resetminute']);
+ unset($_POST['pppoe_resetdate']);
+ unset($_POST['pppoe_pr_preset_val']);
+ }
+
+ /* input validation */
+ switch($_POST['type']) {
+ case "ppp":
+ $reqdfields = explode(" ", "interfaces phone");
+ $reqdfieldsn = explode(",", "Link Interface(s),Phone Number");
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+ break;
+ case "pppoe":
+ if ($_POST['ondemand']) {
+ $reqdfields = explode(" ", "interfaces username password ondemand idletimeout");
+ $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Dial on demand,Idle timeout value");
+ } else {
+ $reqdfields = explode(" ", "interfaces username password");
+ $reqdfieldsn = explode(",", "Link Interface(s),Username,Password");
+ }
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+ break;
+ case "pptp":
+ if ($_POST['ondemand']) {
+ $reqdfields = explode(" ", "interfaces username password localip subnet gateway ondemand idletimeout");
+ $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Local IP address,Subnet,Remote IP address,Dial on demand,Idle timeout value");
+ } else {
+ $reqdfields = explode(" ", "interfaces username password localip subnet gateway");
+ $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Local IP address,Subnet,Remote IP address");
+ }
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+ break;
+ default:
+ $input_errors[] = "Please choose a Link Type.";
+ break;
+ }
+ if ($_POST['type'] == "ppp" && count($_POST['interfaces']) > 1)
+ $input_errors[] = "Multilink connections (MLPPP) using the PPP link type is not currently supported. Please select only one Link Interface.";
+ if ($_POST['type'] == "pptp" && count($_POST['interfaces']) > 1)
+ $input_errors[] = "Multilink connections (MLPPP) using the PPTP link type is not currently supported. Please select only one Link Interface.";
+ if (($_POST['provider'] && !is_domain($_POST['provider'])))
+ $input_errors[] = "The service name contains invalid characters.";
+ if (($_POST['idletimeout'] != "") && !is_numericint($_POST['idletimeout']))
+ $input_errors[] = "The idle timeout value must be an integer.";
+ if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resethour'] <> "" && !is_numericint($_POST['pppoe_resethour']) &&
+ $_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23)
+ $input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23).");
+ if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetminute'] <> "" && !is_numericint($_POST['pppoe_resetminute']) &&
+ $_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <=59)
+ $input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59).");
+ if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate'])))
+ $input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy).");
+ if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))){
+ $date_nums = explode("/",$_POST['pppoe_resetdate']);
+ if ($date_nums[0] < 1 || $date_nums[0] > 12)
+ $input_errors[] = gettext("A valid PPPoE reset month must be specified (1-12) in the Custom PPPoE Periodic reset fields.");
+ if ($date_nums[1] < 1 || $date_nums[1] > 31)
+ $input_errors[] = gettext("A valid PPPoE reset day of month must be specified (1-31) in the Custom PPPoE Periodic reset fields. No checks are done on valid # of days per month");
+ if ($date_nums[2] < date("Y"))
+ $input_errors[] = gettext("A valid PPPoE reset year must be specified. Don't select a year in the past!");
+ }
+ if (($_POST['localip'] && !is_ipaddr($_POST['localip'])))
+ $input_errors[] = "A valid PPTP local IP address must be specified.";
+ if (($_POST['subnet'] && !is_numeric($_POST['subnet'])))
+ $input_errors[] = "A valid PPTP subnet bit count must be specified.";
+ if (($_POST['gateway'] && !is_ipaddr($_POST['gateway'])))
+ $input_errors[] = "A valid PPTP remote IP address must be specified.";
+/*
+ if (($_POST['bandwidth'] != "") && !is_numericint($_POST['bandwidth']))
+ $input_errors[] = "The bandwidth value must be an integer.";
+ if ($_POST['mtu'] && ($_POST['mtu'] < 576))
+ $input_errors[] = "The MTU must be greater than 576 bytes.";
+ if ($_POST['mru'] && ($_POST['mru'] < 576))
+ $input_errors[] = "The MRU must be greater than 576 bytes.";
+*/
+
+/*
+ foreach ($a_ppps as $ppp) {
+ if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp))
+ continue;
+
+ if ($ppp['serialport'] == $_POST['serialport']) {
+ $input_errors[] = "Serial port is in use";
+ break;
+ }
+ }
+*/
+
+ if (!$input_errors) {
+ $ppp = array();
+ $ppp['ptpid'] = $_POST['ptpid'];
+ $ppp['type'] = $_POST['type'];
+ $ppp['ports'] = implode(',',$_POST['interfaces']);
+ $ppp['username'] = $_POST['username'];
+ $ppp['password'] = base64_encode($_POST['password']);
+ $ppp['defaultgw'] = $_POST['defaultgw'] ? true : false;
+ $ppp['ondemand'] = $_POST['ondemand'] ? true : false;
+ if (!empty($_POST['idletimeout']))
+ $ppp['idletimeout'] = $_POST['idletimeout'];
+ else
+ unset($ppp['idletimeout']);
+ $ppp['uptime'] = $_POST['uptime'] ? true : false;
+ if (!empty($_POST['descr']))
+ $ppp['descr'] = $_POST['descr'];
+ else
+ unset($ppp['descr']);
+
+ switch($_POST['type']) {
+ case "ppp":
+ if (!empty($_POST['initstr']))
+ $ppp['initstr'] = base64_encode($_POST['initstr']);
+ else
+ unset($ppp['initstr']);
+ if (!empty($_POST['simpin'])) {
+ $ppp['simpin'] = $_POST['simpin'];
+ $ppp['pin-wait'] = $_POST['pin-wait'];
+ } else {
+ unset($ppp['simpin']);
+ unset($ppp['pin-wait']);
+ }
+
+ if (!empty($_POST['apn'])){
+ $ppp['apn'] = $_POST['apn'];
+ if (!empty($_POST['apnum']))
+ $ppp['apnum'] = $_POST['apnum'];
+ else
+ $ppp['apnum'] = "1";
+ } else {
+ unset($ppp['apn']);
+ unset($ppp['apnum']);
+ }
+ $ppp['phone'] = $_POST['phone'];
+ if (!empty($_POST['localip']))
+ $ppp['localip'] = $_POST['localip'];
+ else
+ unset($ppp['localip']);
+ if (!empty($_POST['gateway']))
+ $ppp['gateway'] = $_POST['gateway'];
+ else
+ unset($ppp['gateway']);
+ if (!empty($_POST['connect-timeout']))
+ $ppp['connect-timeout'] = $_POST['connect-timeout'];
+ else
+ unset($ppp['connect-timeout']);
+ break;
+ case "pppoe":
+ if (!empty($_POST['provider']))
+ $ppp['provider'] = $_POST['provider'];
+ else
+ unset($ppp['provider']);
+ if (!empty($_POST['pppoe-reset-type']))
+ $ppp['pppoe-reset-type'] = $_POST['pppoe-reset-type'];
+ else
+ unset($ppp['pppoe-reset-type']);
+
+ break;
+ case "pptp":
+ $ppp['localip'] = $_POST['localip'];
+ $ppp['subnet'] = $_POST['subnet'];
+ $ppp['gateway'] = $_POST['gateway'];
+ break;
+ default:
+ break;
+
+ }
+
+ $ppp['shortseq'] = $_POST['shortseq'] ? true : false;
+ $ppp['acfcomp'] = $_POST['acfcomp'] ? true : false;
+ $ppp['protocomp'] = $_POST['protocomp'] ? true : false;
+ $ppp['vjcomp'] = $_POST['vjcomp'] ? true : false;
+ $ppp['tcpmssfix'] = $_POST['tcpmssfix'] ? true : false;
+
+/* while(count($_POST['bandwidth'])){
+ if($_POST['bandwidth'][count($_POST['bandwidth'])-1] == "")
+ array_pop(&$_POST['bandwidth']);
+ else
+ break;
+ }
+ */
+ foreach($_POST['bandwidth'] as $bw){
+ if(!empty($bw) && count($bw_array) < count($_POST['interfaces'])+1)
+ $bw_array[] = $bw;
+ }
+ if (count($bw_array)){
+
+ $ppp['bandwidth'] = implode(',', $bw_array);
+ } else
+ unset($ppp['bandwidth']);
+
+ foreach($_POST['mtu'] as $mtu){
+ if(!empty($mtu))
+ $mtu_array[] = $mtu;
+ }
+ if (count($mtu_array)){
+
+ $ppp['mtu'] = implode(',', $mtu_array);
+ } else
+ unset($ppp['mtu']);
+ foreach($_POST['mru'] as $mru){
+ if(!empty($mru))
+ $mru_array[] = $mru;
+ }
+ if (count($mru_array)){
+
+ $ppp['mru'] = implode(',', $mru_array);
+ } else
+ unset($ppp['mru']);
+ /* handle_pppoe_reset is called here because if user changes Link Type from PPPoE to another type we
+ must be able to clear the config data in the <cron> section of config.xml if it exists
+ */
+ handle_pppoe_reset();
+
+ $iflist = get_configured_interface_list();
+ foreach ($iflist as $if) {
+ if ($config['interfaces'][$if]['ptpid'] == $_POST['ptpid']){
+ $thisif = $if;
+ break;
+ }
+ }
+ if (isset($id) && $a_ppps[$id])
+ $a_ppps[$id] = $ppp;
+ else
+ $a_ppps[] = $ppp;
+
+ write_config();
+ configure_cron();
+
+ if (isset($thisif)){
+ interface_ppps_configure($thisif);
+ }
+ header("Location: interfaces_ppps.php");
+ exit;
+ }
+} // end if($_POST)
+
+function handle_pppoe_reset() {
+ global $_POST, $config, $g;
+
+ if (!is_array($config['cron']['item']))
+ $config['cron']['item'] = array();
+ $itemhash = getMPDCRONSettings($_POST['ptpid']);
+ $item = $itemhash['ITEM'];
+
+ /* reset cron items if necessary and return*/
+ if (empty($_POST['pppoe-reset-type'])) {
+ if (isset($item))
+ unset($config['cron']['item'][$itemhash['ID']]);
+ sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP");
+ return;
+ }
+
+ if (empty($item))
+ $item = array();
+ if (isset($_POST['pppoe-reset-type']) && $_POST['pppoe-reset-type'] == "custom") {
+ $item['minute'] = $_POST['pppoe_resetminute'];
+ $item['hour'] = $_POST['pppoe_resethour'];
+ if (isset($_POST['pppoe_resetdate']) && $_POST['pppoe_resetdate'] <> "") {
+ $date = explode("/", $_POST['pppoe_resetdate']);
+ $item['mday'] = $date[1];
+ $item['month'] = $date[0];
+ } else {
+ $item['mday'] = "*";
+ $item['month'] = "*";
+ }
+ $item['wday'] = "*";
+ $item['who'] = "root";
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
+ } else if (isset($_POST['pppoe-reset-type']) && $_POST['pppoe-reset-type'] == "preset") {
+ switch ($_POST['pppoe_pr_preset_val']) {
+ case "monthly":
+ $item['minute'] = "0";
+ $item['hour'] = "0";
+ $item['mday'] = "1";
+ $item['month'] = "*";
+ $item['wday'] = "*";
+ $item['who'] = "root";
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
+ break;
+ case "weekly":
+ $item['minute'] = "0";
+ $item['hour'] = "0";
+ $item['mday'] = "*";
+ $item['month'] = "*";
+ $item['wday'] = "0";
+ $item['who'] = "root";
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
+ break;
+ case "daily":
+ $item['minute'] = "0";
+ $item['hour'] = "0";
+ $item['mday'] = "*";
+ $item['month'] = "*";
+ $item['wday'] = "*";
+ $item['who'] = "root";
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
+ break;
+ case "hourly":
+ $item['minute'] = "0";
+ $item['hour'] = "*";
+ $item['mday'] = "*";
+ $item['month'] = "*";
+ $item['wday'] = "*";
+ $item['who'] = "root";
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
+ break;
+ } // end switch
+ }// end if
+ if (isset($itemhash['ID']))
+ $config['cron']['item'][$itemhash['ID']] = $item;
+ else
+ $config['cron']['item'][] = $item;
+}
+
+$closehead = false;
+$pgtitle = array("Interfaces","PPPs","Edit");
+include("head.inc");
+
+$types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP"/*, "l2tp" => "L2TP", "tcp" => "TCP", "udp" => "UDP"*/ );
+
+?>
+ <script type="text/javascript" src="/javascript/numericupdown/js/numericupdown.js"></script>
+ <link href="/javascript/numericupdown/css/numericupdown.css" rel="stylesheet" type="text/css" />
+ <script type="text/javascript" src="/javascript/datepicker/js/datepicker.js"></script>
+ <link href="/javascript/datepicker/css/datepicker.css" rel="stylesheet" type="text/css"/>
+ <script type="text/javascript" >
+ document.observe("dom:loaded", function() { updateType(<?php echo "'{$pconfig['type']}'";?>); });
+ </script>
+</head>
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC" >
+<?php include("fbegin.inc"); ?>
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+ <form action="interfaces_ppps_edit.php" method="post" name="iform" id="iform">
+ <table id="interfacetable" width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("PPPs configuration"); ?></td>
+ </tr>
+ <tr>
+ <td valign="middle" class="vncell"><strong><?= gettext("Link Type"); ?></strong></td>
+ <td class="vtable">
+ <select name="type" onChange="updateType(this.value);" class="formselect" id="type">
+ <?php
+ foreach ($types as $key => $opt) {
+ echo "<option onClick=\"updateType('{$key}');\"";
+ if ($key == $pconfig['type'])
+ echo " selected";
+ echo " value=\"{$key}\" >" . htmlspecialchars($opt) . "</option>";
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <tr name="interface" id="interface" >
+ <td width="22%" valign="top" class="vncellreq"><?= gettext("Link interface(s)"); ?></td>
+ <td width="78%" class="vtable">
+ <select valign="top" name="interfaces[]" multiple="true" class="formselect" size="4" onChange="show_hide_linkfields(this.options);">
+ <option></option>
+ </select>
+
+ <br/><span class="vexpl"><?= gettext("Interfaces or ports participating in the multilink connection."); ?></span>
+ <span style="display:none" id="prefil_ppp">
+ <p/><?= gettext("Click a link to fill in defaults for these carriers:"); ?>&nbsp;
+ <a href='#' onClick='javascript:prefill_att();'>ATT</A>
+ <a href='#' onClick='javascript:prefill_sprint();'>Sprint</A>
+ <a href='#' onClick='javascript:prefill_vzw();'>Verizon</A>
+ </span>
+ </td>
+ </tr>
+ <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);
+ $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))
+ echo ",1|";
+ else
+ echo ",|";
+ }
+ echo $serport_count;
+ ?></td>
+ <td id="ports"><?php
+ $port_count = 0;
+ foreach ($portlist as $ifn => $ifinfo){
+ $port_count++;
+ echo htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")") . ",{$ifn}";
+ if (in_array($ifn,$selected_ports))
+ echo ",1|";
+ else
+ echo ",|";
+ }
+ echo $port_count;
+ if($serport_count > $port_count)
+ $port_count=$serport_count;
+ ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Username"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Password"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="password" type="password" class="formfld pwd" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Gateway"); ?></td>
+ <td width="78%" class="vtable">
+ <input type="checkbox" value="on" id="defaultgw" name="defaultgw" <?php if (isset($pconfig['defaultgw'])) echo "checked"; ?>><?= gettext("This link will be used as the default gateway."); ?>
+ <br/><span class="vexpl"><?= gettext("\"Allow DNS Server list to be overridden\" must also be checked in the System -> General Setup menu."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell"><?= gettext("Dial On Demand"); ?></td>
+ <td class="vtable">
+ <input type="checkbox" value="on" id="ondemand" name="ondemand" <?php if (isset($pconfig['ondemand'])) echo "checked"; ?>> <?= gettext("Enable Dial-on-Demand mode"); ?>
+ <br/> <span class="vexpl"><?= gettext("This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection.
+ The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected."); ?> </span>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell"><?= gettext("Idle Timeout"); ?></td>
+ <td class="vtable">
+ <input name="idletimeout" type="text" class="formfld unknown" id="idletimeout" size="12" value="<?=htmlspecialchars($pconfig['idletimeout']);?>"> <?= gettext("(seconds) Default is 0, which disables the timeout feature."); ?>
+ <br/> <span class="vexpl"><?= gettext("If no incoming or outgoing packets are transmitted for the entered number of seconds the connection is brought down.
+ <br/>When the idle timeout occurs, if the dial-on-demand option is enabled, mpd goes back into dial-on-demand mode. Otherwise, the interface is brought down and all associated routes removed."); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell"><?= gettext("Uptime Logging"); ?></td>
+ <td class="vtable">
+ <input type="checkbox" value="on" id="uptime" name="uptime" <?php if (isset($pconfig['uptime'])) echo "checked"; ?>> <?= gettext("Enable persistent logging of connection uptime."); ?>
+ <br/> <span class="vexpl"><?= gettext("This option causes cumulative uptime to be recorded and displayed on the Status Interfaces page."); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Description"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
+ <br/> <span class="vexpl"><?= gettext("You may enter a description here for your reference. Description will appear in the \"Interfaces Assign\" select lists."); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" height="16"></td>
+ </tr>
+ <tr style="display:none" name="select" id="select">
+ </tr>
+ <tr style="display:none" name="ppp" id="ppp">
+ <td colspan="2" style="padding:0px;">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("PPP configuration"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Init String"); ?></td>
+ <td width="78%" class="vtable">
+ <input type="text" size="40" class="formfld unknown" id="initstr" name="initstr" value="<?=htmlspecialchars($pconfig['initstr']);?>">
+ <br/><span class="vexpl"><?= gettext("Note: Enter the modem initialization string here. Do NOT include the \"AT\"
+ string at the beginning of the command. Many modern USB 3G modems don't need an initialization string."); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Sim PIN"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="simpin" type="text" class="formfld unknown" id="simpin" size="12" value="<?=htmlspecialchars($pconfig['simpin']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Sim PIN wait"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="pin-wait" type="text" class="formfld unknown" id="pin-wait" size="2" value="<?=htmlspecialchars($pconfig['pin-wait']);?>">
+ <br/><span class="vexpl"><?= gettext("Note: Time to wait for SIM to discover network after PIN is sent to SIM (seconds)."); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Access Point Name (APN)"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="apn" type="text" class="formfld unknown" id="apn" size="40" value="<?=htmlspecialchars($pconfig['apn']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("APN number (optional)"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="apnum" type="text" class="formfld unknown" id="apnum" size="2" value="<?=htmlspecialchars($pconfig['apnum']);?>">
+ <br/><span class="vexpl"><?= gettext("Note: Defaults to 1 if you set APN above. Ignored if you set no APN above."); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Phone Number"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="phone" type="text" class="formfld unknown" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>">
+ <br/><span class="vexpl"><?= gettext("Note: Typically (*99# or *99***# or *99***1#) for GSM networks and *777 for CDMA networks"); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Connection Timeout"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="connect-timeout" type="text" class="formfld unknown" id="connect-timeout" size="2" value="<?=htmlspecialchars($pconfig['connect-timeout']);?>">
+ <br/><span class="vexpl"><?= gettext("Note: Enter timeout in seconds for connection to be established (sec.) Default is 45 sec."); ?></span>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr style="display:none" name="pppoe" id="pppoe">
+ <td colspan="2" style="padding:0px;">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("PPPoE configuration"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Service name"); ?></td>
+ <td width="78%" class="vtable"><input name="provider" type="text" class="formfld unknown" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>">
+ <br/> <span class="vexpl"><?= gettext("Hint: this field can usually be left empty"); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td>
+ <td width="78%" class="vtable">
+ <table id="presetwrap" cellspacing="0" cellpadding="0" width="100%">
+ <tr>
+ <td align="left" valign="top">
+ <p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;">
+ <select valign="top" id="reset_type" name="pppoe-reset-type" class="formselect" onChange="show_reset_settings(this.value);">
+ <option value = ""><?= gettext("Disabled"); ?></option>
+ <option value="custom" <?php if ($pconfig['pppoe-reset-type'] == "custom") echo "selected"; ?>><?= gettext("Custom"); ?></option>
+ <option value="preset" <?php if ($pconfig['pppoe-reset-type'] == "preset") echo "selected"; ?>><?= gettext("Pre-Set"); ?></option>
+ </select> <?= gettext("Select a reset timing type"); ?>
+ </p>
+ <?php if ($pconfig['pppoe_pr_custom']): ?>
+ <p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap">
+ <?php else: ?>
+ <p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap">
+ <?php endif; ?>
+ <input type="text" name="pppoe_resethour" class="fd_incremental_inp_range_0_23 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resethour" value="<?= $pconfig['pppoe_resethour']; ?>" size="3" />
+ <?= gettext("hour (0-23)"); ?><br />
+ <input type="text" name="pppoe_resetminute" class="fd_incremental_inp_range_0_59 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resetminute" value="<?= $pconfig['pppoe_resetminute']; ?>" size="3" />
+ <?= gettext("minute (0-59)"); ?><br />
+ <input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" />
+ <?= gettext("reset at a specific date (mm/dd/yyyy)"); ?>
+ <br />&nbsp;<br />
+ <span class="red"><strong>Note: </strong></span>
+ <?= gettext("If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field."); ?>
+ </p>
+ <?php if ($pconfig['pppoe_pr_preset']): ?>
+ <p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap">
+ <?php else: ?>
+ <p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap">
+ <?php endif; ?>
+ <input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> />
+ <?= gettext("reset at each month ('0 0 1 * *')"); ?>
+ <br />
+ <input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> />
+ <?= gettext("reset at each week ('0 0 * * 0')"); ?>
+ <br />
+ <input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> />
+ <?= gettext("reset at each day ('0 0 * * *')"); ?>
+ <br />
+ <input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> />
+ <?= gettext("reset at each hour ('0 * * * *')"); ?>
+ </p>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr style="display:none" name="pptp" id="pptp">
+ <td colspan="2" style="padding:0px;">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("PPTP configuration"); ?></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr style="display:none" id="ipfields">
+ <td colspan="2" style="padding:0px;">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Local IP address"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
+ /
+ <select style="display:none" name="subnet" class="formselect" id="subnet">
+ <?php for ($i = 31; $i > 0; $i--): ?>
+ <option value="<?=$i;?>"<?php if ($i == $pconfig['subnet']) echo "selected"; ?>><?=$i;?></option>
+ <?php endfor; ?>
+ </select>
+ <br><span class="vexpl"><?= gettext("Note: Local IP/subnet is required for PPTP connections. LocalIP is automatically assigned for PPP links if this field is empty."); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Remote IP (Gateway)"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="gateway" type="text" class="formfld unknown" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>">
+ <br><span class="vexpl"><?= gettext("Note: This is where the packets will be routed. Remote IP is required for PPTP connections. Remote IP is automatically assigned for PPP links if this field is empty."); ?></span>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <tr>
+ <td colspan="2" valign="top" height="16"></td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("Advanced Options"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Compression"); ?></td>
+ <td width="78%" class="vtable">
+ <input type="checkbox" value="on" id="vjcomp" name="vjcomp" <?php if (isset($pconfig['vjcomp'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable vjcomp(compression) (enabled by default)."); ?>
+ <br/> <span class="vexpl">This option enables Van Jacobson TCP header compression, which saves several bytes per TCP data packet.
+ You almost always want this option. This compression ineffective for TCP connections with enabled modern extensions like time
+ stamping or SACK, which modify TCP options between sequential packets.</span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?= gettext("TCPmssFix"); ?></td>
+ <td width="78%" class="vtable">
+ <input type="checkbox" value="on" id="tcpmssfix" name="tcpmssfix" <?php if (isset($pconfig['tcpmssfix'])) echo "checked"; ?>>&nbsp;<?= gettext("Enable tcpmssfix (disabled by default)."); ?>
+ <br/> <span class="vexpl">This option causes mpd to adjust incoming and outgoing TCP SYN segments so that the requested maximum segment size is not greater than the amount
+ allowed by the interface MTU. This is necessary in many setups to avoid problems caused by routers that drop ICMP Datagram Too Big messages. Without these messages,
+ the originating machine sends data, it passes the rogue router then hits a machine that has an MTU that is not big enough for the data. Because the IP Don't Fragment option is set,
+ this machine sends an ICMP Datagram Too Big message back to the originator and drops the packet. The rogue router drops the ICMP message and the originator never
+ gets to discover that it must reduce the fragment size or drop the IP Don't Fragment option from its outgoing data.</span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">ShortSeq</td>
+ <td width="78%" class="vtable">
+ <input type="checkbox" value="on" id="shortseq" name="shortseq" <?php if (isset($pconfig['shortseq'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable shortseq (enabled by default)."); ?>
+ <br/> <span class="vexpl"><?= gettext("This option is only meaningful if multi-link PPP is negotiated. It proscribes shorter multi-link fragment headers, saving two bytes on every frame.
+ It is not necessary to disable this for connections that are not multi-link."); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">ACFComp</td>
+ <td width="78%" class="vtable">
+ <input type="checkbox" value="on" id="acfcomp" name="acfcomp" <?php if (isset($pconfig['acfcomp'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable acfcomp(compression) (enabled by default)."); ?>
+ <br/> <span class="vexpl"><?= gettext("Address and control field compression. This option only applies to asynchronous link types. It saves two bytes per frame."); ?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">ProtoComp</td>
+ <td width="78%" class="vtable">
+ <input type="checkbox" value="on" id="protocomp" name="protocomp" <?php if (isset($pconfig['protocomp'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable protocomp(compression) (enabled by default)."); ?>
+ <br/> <span class="vexpl"><?= gettext("Protocol field compression. This option saves one byte per frame for most frames."); ?></span>
+ </td>
+ </tr>
+
+ <?php for($i=0; $i < $port_count; $i++) : ?>
+ <tr style="display:none" id="link<?=$i;?>">
+ <td width="22%" valign="top" id="linklabel<?=$i;?>" class="vncell"> Link Parameters</td>
+ <td class="vtable">
+ <table name="link_parameters" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top"class="vncell"> Bandwidth</td>
+ <td width="78%" id="bandwidth<?=$i;?>" class="vtable">
+ <br/><input name="bandwidth[]" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['bandwidth'][$i]);?>">
+ <br/> <span class="vexpl">Set Bandwidth for each link ONLY for MLPPP connections and ONLY when links have different bandwidths.</span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"> MTU</td>
+ <td width="78%" id="mtu<?=$i;?>" class="vtable">
+ <input name="mtu[]" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mtu'][$i]);?>">
+ <br> <span class="vexpl">Set MTU for each link if links have different bandwidths, otherwise, mtu will default to 1492.</span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"> MRU</td>
+ <td width="78%" id="mru<?=$i;?>" class="vtable">
+ <input name="mru[]" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mru'][$i]);?>">
+ <br> <span class="vexpl">Set MRU for each link if links have different bandwidths, otherwise, mru will default to 1492.</span>
+ </td>
+ </tr>
+ </table
+ </td>
+ </tr><?php endfor; ?>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="Save">
+ <input type="button" value="Cancel" onclick="history.back()">
+ <?php
+ if (isset($a_ppps[$id]['ptpid']))
+ $ptpid = $a_ppps[$id]['ptpid'];
+ else
+ $ptpid = uniqid('', true);
+ ?>
+ <input name="ptpid" type="hidden" value="<?=$ptpid;?>">
+ <?php if (isset($id) && $a_ppps[$id]): ?>
+ <input name="id" type="hidden" value="<?=$id;?>">
+ <?php endif; ?>
+ </td>
+ </tr>
+ </table>
+</form>
+<?php include("fend.inc"); ?>
+</body>
+</html> \ No newline at end of file
diff --git a/usr/local/www/interfaces_qinq.php b/usr/local/www/interfaces_qinq.php
index 604d778..62e4a41 100755
--- a/usr/local/www/interfaces_qinq.php
+++ b/usr/local/www/interfaces_qinq.php
@@ -98,11 +98,11 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", true, "interfaces_qinq.php");
- $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", false, "interfaces_gre.php");
- $tab_array[7] = array("GIF", false, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[7] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_vlan.php b/usr/local/www/interfaces_vlan.php
index 0adfa7d..20f41bb 100755
--- a/usr/local/www/interfaces_vlan.php
+++ b/usr/local/www/interfaces_vlan.php
@@ -92,11 +92,11 @@ include("head.inc");
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", true, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", false, "interfaces_gre.php");
- $tab_array[7] = array("GIF", false, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[7] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_wireless.php b/usr/local/www/interfaces_wireless.php
index f833fba..f639615 100644
--- a/usr/local/www/interfaces_wireless.php
+++ b/usr/local/www/interfaces_wireless.php
@@ -90,11 +90,11 @@ include("head.inc");
$tab_array[2] = array("Wireless", true, "interfaces_wireless.php");
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[6] = array("GRE", false, "interfaces_gre.php");
- $tab_array[7] = array("GIF", false, "interfaces_gif.php");
- $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[5] = array("PPPs", false, "interfaces_ppps.php");
+ $tab_array[7] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[8] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[9] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[10] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js
new file mode 100644
index 0000000..c9ace67
--- /dev/null
+++ b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js
@@ -0,0 +1,112 @@
+
+function update_select_list(new_options, select_list){
+ var option_array = new_options.split("|");
+ var i = 0;
+ select_list.length = 0;
+ for(var j=0; j < option_array.length-1; j++){
+ var option = option_array[j].split(",");
+ var selected = Boolean(parseInt(option[2]));
+ select_list[j] = new Option(option[0], option[1], false, selected);
+ //for testing and debugging
+ //select_list.options[option_array.length-1+j] = new Option(option[2].toString() +" "+ selected.toString());
+ //select_list.options[option_array.length-1+j] = new Option("Link Label: " + linklabel + " Label Text:" + label_text);
+ }
+ show_hide_linkfields(select_list);
+}
+
+function clear_selected(list_name){
+ var select_list = document.iform[list_name];
+ for(var j=0; j < select_list.options.length; j++){
+ select_list.options[j].selected = 0;
+ }
+}
+
+function show_hide_linkfields(options){
+ var select_count = 0;
+ // this for loop is not used currently
+ for(var j=0; j < options.length; j++){
+ var label = "link" + select_count.toString();
+ if (options[j].selected){
+ var linklabel = "linklabel" + select_count.toString();
+ $(linklabel).innerHTML = "Link Parameters (" + options[j].value + ")";
+ $(label).show();
+ select_count++;
+ continue;
+ }
+ $(label).hide();
+ }
+}
+
+
+function updateType(t){
+ var serialports = $('serialports').innerHTML;
+ var ports = $('ports').innerHTML;
+ var select_list = document.iform["interfaces[]"].options;
+ switch(t) {
+ case "select": {
+ $('ppp','pppoe','pptp','ipfields','prefil_ppp').invoke('hide');
+ select_list.length = 0;
+ select_list.options[0] = new Option("Select Link Type First","");
+ break;
+ }
+ case "ppp": {
+ update_select_list(serialports, select_list);
+ $('select','pppoe','pptp','subnet').invoke('hide');
+ $('ipfields','prefil_ppp').invoke('show');
+ break;
+ }
+ case "pppoe": {
+ update_select_list(ports, select_list);
+ $('select','ppp','pptp','ipfields','prefil_ppp').invoke('hide');
+ break;
+ }
+ case "pptp": {
+ update_select_list(ports, select_list);
+ $('select','ppp','pppoe','prefil_ppp').invoke('hide');
+ $('ipfields','subnet').invoke('show');
+ break;
+ }
+ default:
+ select_list.length = 0;
+ break;
+ }
+ $(t).show();
+}
+
+function show_reset_settings(reset_type) {
+ if (reset_type == 'preset') {
+ Effect.Appear('pppoepresetwrap', { duration: 0.0 });
+ Effect.Fade('pppoecustomwrap', { duration: 0.0 });
+ }
+ else if (reset_type == 'custom') {
+ Effect.Appear('pppoecustomwrap', { duration: 0.0 });
+ Effect.Fade('pppoepresetwrap', { duration: 0.0 });
+ } else {
+ Effect.Fade('pppoecustomwrap', { duration: 0.0 });
+ Effect.Fade('pppoepresetwrap', { duration: 0.0 });
+ }
+}
+function prefill_att() {
+ $('initstr').value = "Q0V1E1S0=0&C1&D2+FCLASS=0";
+ $('apn').value = "ISP.CINGULAR";
+ $('apnum').value = "1";
+ $('phone').value = "*99#";
+ $('username').value = "att";
+ $('password').value = "att";
+}
+function prefill_sprint() {
+ $('initstr').value = "E1Q0";
+ $('apn').value = "";
+ $('apnum').value = "";
+ $('phone').value = "#777";
+ $('username').value = "sprint";
+ $('password').value = "sprint";
+}
+function prefill_vzw() {
+ $('initstr').value = "E1Q0s7=60";
+ $('apn').value = "";
+ $('apnum').value = "";
+ $('phone').value = "#777";
+ $('username').value = "123@vzw3g.com";
+ $('password').value = "vzw";
+}
OpenPOWER on IntegriCloud