From 2a3e31a21bdf6c0f7db79a237b24c04a5365feaf Mon Sep 17 00:00:00 2001 From: gnhb Date: Thu, 22 Apr 2010 05:33:54 +0700 Subject: Javascript working for interface/port select lists. --- usr/local/www/interfaces_mlppp_edit.php | 144 +++++++++++++++++--------------- 1 file changed, 77 insertions(+), 67 deletions(-) diff --git a/usr/local/www/interfaces_mlppp_edit.php b/usr/local/www/interfaces_mlppp_edit.php index 0cff4b8..22266d8 100644 --- a/usr/local/www/interfaces_mlppp_edit.php +++ b/usr/local/www/interfaces_mlppp_edit.php @@ -90,6 +90,7 @@ if (isset($_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'] = $a_ppps[$id]['password']; if (isset($a_ppps[$id]['defaultgw'])) @@ -97,6 +98,7 @@ if (isset($id) && $a_ppps[$id]) { 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'] = $a_ppps[$id]['bandwidth']; $pconfig['mtu'] = $a_ppps[$id]['mtu']; @@ -113,7 +115,6 @@ if (isset($id) && $a_ppps[$id]) { if (isset($a_ppps[$id]['tcpmssfix'])) $pconfig['tcpmssfix'] = true; if ($a_ppps[$id]['type'] == "ppp") { - $pconfig['interfaces'] = $a_ppps[$id]['ports']; $pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']); $pconfig['simpin'] = $a_ppps[$id]['simpin']; $pconfig['pin-wait'] = $a_ppps[$id]['pin-wait']; @@ -125,13 +126,11 @@ if (isset($id) && $a_ppps[$id]) { $pconfig['gateway'] = $a_ppps[$id]['gateway']; } if ($a_ppps[$id]['type'] == "pptp") { - $pconfig['interfaces'] = $a_ppps[$id]['ports']; $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['interfaces'] = $a_ppps[$id]['ports']; $pconfig['provider'] = $a_ppps[$id]['provider']; /* ================================================ */ /* = force a connection reset at a specific time? = */ @@ -264,6 +263,7 @@ if ($_POST) { if (!$input_errors) { $ppp = array(); $ppp['type'] = $_POST['type']; + $ppp['ports'] = implode(',', $_POST['interfaces']); $ppp['username'] = $_POST['username']; $ppp['password'] = $_POST['password']; $ppp['defaultgw'] = $_POST['defaultgw'] ? true : false; @@ -272,13 +272,13 @@ if ($_POST) { $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": - $ppp['ports'] = implode(',', $_POST['interfaces']); if (!empty($_POST['initstr'])) $ppp['initstr'] = base64_encode($_POST['initstr']); else @@ -316,16 +316,13 @@ if ($_POST) { unset($ppp['connect-timeout']); break; case "pppoe": - $ppp['ports'] = implode(',', $_POST['interfaces']); if (!empty($_POST['provider'])) $ppp['provider'] = $_POST['provider']; else unset($ppp['provider']); handle_pppoe_reset(); - break; case "pptp": - $ppp['ports'] = implode(',', $_POST['interfaces']); $ppp['localip'] = $_POST['localip']; $ppp['subnet'] = $_POST['subnet']; $ppp['gateway'] = $_POST['gateway']; @@ -477,66 +474,65 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" ?> @@ -588,33 +584,41 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" - Member interface(s) + Link interface(s) - +
Interfaces participating in the multilink connection. + + + $ifinfo){ + //if (is_jumbo_capable($ifn)) { + echo htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")") . ",{$ifn}"; + //echo "\"{$ifn}\""; + if (stristr($pconfig['interfaces'], $ifn)) + echo ",1|"; + else + echo ",0|"; + } + ?> + Username @@ -650,6 +654,13 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
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. + + Uptime Logging + + > Enable persistent logging of connection uptime. +
This option causes cumulative uptime to be recorded and displayed on the Status Interfaces page. + + Description @@ -734,7 +745,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" - onclick="show_periodic_reset(this);" /> + onclick="show_more_settings(this,presetwrap);" />
@@ -813,14 +824,14 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" -
Note: Enter the local IP here if not automatically assigned. Subnet is ignored for PPP connections. +
Note: Local IP/subnet is required for PPTP connections. LocalIP is automatically assigned for PPP links if this field is empty. Remote IP (Gateway) -
Note: Enter the remote IP here if not automatically assigned. This is where the packets will be routed. +
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. @@ -834,11 +845,10 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" Bandwidth - onclick="show_bandwidth_input_boxes();" /> + onclick="show_more_settings(this,bandwidth_input);" /> Set unequal bandwidths for links in this multilink connection. -