From 258f1ca439af24026849e15f8dbfc558be0e1ef3 Mon Sep 17 00:00:00 2001 From: gnhb Date: Tue, 27 Apr 2010 15:53:17 +0700 Subject: [PATCH] Push all work on mlppp to the interfaces_ppp_edit and interfaces_ppp pages. --- usr/local/www/interfaces_mlppp_edit.php | 47 +- usr/local/www/interfaces_ppp.php | 33 +- usr/local/www/interfaces_ppp_edit.php | 1031 ++++++++++++++++++----- 3 files changed, 865 insertions(+), 246 deletions(-) diff --git a/usr/local/www/interfaces_mlppp_edit.php b/usr/local/www/interfaces_mlppp_edit.php index 22266d88a1..7fb99425e2 100644 --- a/usr/local/www/interfaces_mlppp_edit.php +++ b/usr/local/www/interfaces_mlppp_edit.php @@ -91,7 +91,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['user'] = $a_ppps[$id]['username']; $pconfig['password'] = $a_ppps[$id]['password']; if (isset($a_ppps[$id]['defaultgw'])) $pconfig['defaultgw'] = true; @@ -203,20 +203,20 @@ if ($_POST) { break; case "pppoe": if ($_POST['ondemand']) { - $reqdfields = explode(" ", "interfaces username password ondemand idletimeout"); + $reqdfields = explode(" ", "interfaces user password ondemand idletimeout"); $reqdfieldsn = explode(",", "Link Interface(s),Username,Password,Dial on demand,Idle timeout value"); } else { - $reqdfields = explode(" ", "interfaces username password"); + $reqdfields = explode(" ", "interfaces user 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"); + $reqdfields = explode(" ", "interfaces user 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"); + $reqdfields = explode(" ", "interfaces user 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); @@ -264,7 +264,7 @@ if ($_POST) { $ppp = array(); $ppp['type'] = $_POST['type']; $ppp['ports'] = implode(',', $_POST['interfaces']); - $ppp['username'] = $_POST['username']; + $ppp['username'] = $_POST['user']; $ppp['password'] = $_POST['password']; $ppp['defaultgw'] = $_POST['defaultgw'] ? true : false; $ppp['ondemand'] = $_POST['ondemand'] ? true : false; @@ -480,7 +480,8 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" for(var j=0; j < option_array.length-1; j++){ var option = option_array[j].split(","); var selected = Boolean(parseInt(option[2])); - select_list.options[j] = new Option(" "+option[0]+" ", option[1], false, selected); + select_list.options[j] = new Option(option[0], option[1], false, selected); + //this line for debugging the javascript above //select_list.options[option_array.length-1+j] = new Option(option[2].toString() +" "+ selected.toString()); } } @@ -538,7 +539,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" $('apn').value = "ISP.CINGULAR"; $('apnum').value = "1"; $('phone').value = "*99#"; - $('username').value = "att"; + $('user').value = "att"; $('password').value = "att"; } function prefill_sprint() { @@ -546,7 +547,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" $('apn').value = ""; $('apnum').value = ""; $('phone').value = "#777"; - $('username').value = "sprint"; + $('user').value = "sprint"; $('password').value = "sprint"; } function prefill_vzw() { @@ -554,7 +555,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" $('apn').value = ""; $('apnum').value = ""; $('phone').value = "#777"; - $('username').value = "123@vzw3g.com"; + $('user').value = "123@vzw3g.com"; $('password').value = "vzw"; } document.observe("dom:loaded", function() { updateType(); }); @@ -587,12 +588,13 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" Link interface(s) -
Interfaces participating in the multilink connection. +
Select one or more interfaces or ports to participate in the connection. Select more than one + interface to create a multilink (MLPPP) connection. - + "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" if (stristr($pconfig['interfaces'], $port)) echo ",1|"; else - echo ",0|"; + echo ",|"; } ?> "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" if (stristr($pconfig['interfaces'], $ifn)) echo ",1|"; else - echo ",0|"; + echo ",|"; } ?> Username - + @@ -679,6 +681,15 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" PPP configuration + + Default PPP settings + + ATT  + Sprint  + Verizon +
Click the links to fill default connection settings for these carriers. + + Init String @@ -846,8 +857,8 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" Bandwidth onclick="show_more_settings(this,bandwidth_input);" /> - Set unequal bandwidths for links in this multilink connection. -