summaryrefslogtreecommitdiffstats
path: root/usr/local/www/wizards
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-09-20 21:57:13 +0700
committergnhb <gnoahb@gmail.com>2010-09-20 21:57:13 +0700
commit389c778ec29d929a17843139f8cddf337b8fa9ad (patch)
tree4117a6f03265bc795d52a067d252425b054dac94 /usr/local/www/wizards
parent8ad39798ef9532f2793f9567db87423fc8f641f8 (diff)
downloadpfsense-389c778ec29d929a17843139f8cddf337b8fa9ad.zip
pfsense-389c778ec29d929a17843139f8cddf337b8fa9ad.tar.gz
Update wizard files for setup wizard to write proper config for current ppp architecture.
I also allowed selection of physical interface from the wizard screen. This is crucial because if the user has the WAN set to anything other than the same phyical interface used by pppoe/pptp, the old wizard has no way of knowing what physical port to use, and the wizard can generate a bad config. Feel free to expand the list of available interfaces in the dropdown for interface selection.
Diffstat (limited to 'usr/local/www/wizards')
-rw-r--r--usr/local/www/wizards/setup_wizard.xml74
1 files changed, 61 insertions, 13 deletions
diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml
index d0ef4b3..aad3a59 100644
--- a/usr/local/www/wizards/setup_wizard.xml
+++ b/usr/local/www/wizards/setup_wizard.xml
@@ -162,14 +162,13 @@
if(document.forms[0].ipaddress.value == 'dhcp') {
selectedItem = 1;
document.forms[0].ipaddress.value = '';
- } else if(document.forms[0].ipaddress.value == 'PPPoE') {
+ } else if(document.forms[0].ipaddress.value == 'pppoe') {
selectedItem = 2;
document.forms[0].ipaddress.value = '';
- } else if(document.forms[0].ipaddress.value == 'PPTP') {
+ } else if(document.forms[0].ipaddress.value == 'pptp') {
selectedItem = 3;
document.forms[0].ipaddress.value = '';
- } else if(document.forms[0].ipaddress.value == 'BigPond') {
- selectedItem = 4;
+ } else if(document.forms[0].ipaddress.value == 'ppp' || document.forms[0].ipaddress.value == 'l2tp') {
document.forms[0].ipaddress.value = '';
} else {
selectedItem = 0;
@@ -211,6 +210,13 @@
<type>listtopic</type>
</field>
<field>
+ <name>interface</name>
+ <type>interface_select</type>
+ <donotdisable>true</donotdisable>
+ <displayname>Interface</displayname>
+ <bindstofield>interfaces->wan->if</bindstofield>
+ </field>
+ <field>
<donotdisable>true</donotdisable>
<name>MAC Address</name>
<bindstofield>interfaces->wan->spoofmac</bindstofield>
@@ -271,28 +277,31 @@
<field>
<name>PPPoE Username</name>
<type>input</type>
- <bindstofield>interfaces->wan->pppoe_username</bindstofield>
+ <bindstofield>interfaces->tmp->username</bindstofield>
</field>
<field>
<name>PPPoE Password</name>
<type>input</type>
- <bindstofield>interfaces->wan->pppoe_password</bindstofield>
+ <bindstofield>interfaces->tmp->password</bindstofield>
</field>
<field>
<name>PPPoE Service name</name>
<type>input</type>
<description>Hint: this field can usually be left empty</description>
+ <bindstofield>interfaces->tmp->provider</bindstofield>
</field>
<field>
<name>PPPoE Dial on demand</name>
<typehint>Enable Dial-On-Demand mode</typehint>
<type>checkbox</type>
<description>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.</description>
+ <bindstofield>interfaces->tmp->ondemand</bindstofield>
</field>
<field>
<name>PPPoE Idle timeout</name>
<type>input</type>
<description>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.</description>
+ <bindstofield>interfaces->tmp->idletimeout</bindstofield>
</field>
<field>
<name>PPTP configuration</name>
@@ -301,19 +310,19 @@
<field>
<name>PPTP Username</name>
<type>input</type>
- <bindstofield>interfaces->wan->pptp_username</bindstofield>
+ <bindstofield>interfaces->tmp->pptpusername</bindstofield>
</field>
<field>
<name>PPTP Password</name>
<type>input</type>
- <bindstofield>interfaces->wan->pptp_password</bindstofield>
+ <bindstofield>interfaces->tmp->pptppassword</bindstofield>
</field>
<field>
<combinefieldsbegin>true</combinefieldsbegin>
<name>PPTP Local IP Address</name>
<type>input</type>
<typehint> / </typehint>
- <bindstofield>pptp->local</bindstofield>
+ <bindstofield>interfaces->tmp->localip</bindstofield>
<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
<message>PPTP Local IP Address field is invalid</message>
</field>
@@ -322,12 +331,12 @@
<dontdisplayname>true</dontdisplayname>
<dontcombinecells>true</dontcombinecells>
<name>pptplocalsubnet</name>
- <bindstofield>pptp->subnet</bindstofield>
+ <bindstofield>interfaces->tmp->subnet</bindstofield>
<type>subnet_select</type>
</field>
<field>
<name>PPTP Remote IP Address</name>
- <bindstofield>pptp->remote</bindstofield>
+ <bindstofield>interfaces->tmp->gateway</bindstofield>
<type>input</type>
<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
<message>PPTP Remote IP Address field is invalid</message>
@@ -336,13 +345,13 @@
<name>PPTP Dial on demand</name>
<typehint>Enable Dial-On-Demand mode</typehint>
<type>checkbox</type>
- <bindstofield>pptp->ondemand</bindstofield>
+ <bindstofield>interfaces->tmp->pptpondemand</bindstofield>
<description>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.</description>
</field>
<field>
<name>PPTP Idle timeout</name>
<type>input</type>
- <bindstofield>pptp->timeout</bindstofield>
+ <bindstofield>interfaces->tmp->pptpidletimeout</bindstofield>
<description>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.</description>
</field>
<field>
@@ -374,6 +383,11 @@
<type>submit</type>
</field>
</fields>
+ <stepbeforeformdisplay>
+ <![CDATA[
+ $config['interfaces']['tmp'] = array();
+ ]]>
+ </stepbeforeformdisplay>
<stepsubmitphpaction>
<![CDATA[
if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
@@ -400,6 +414,40 @@
print_info_box_np("Invalid PPTP Remopte IP Address. Please press back in your browser window and correct.");
die;
}
+ $type = $_POST['selectedtype'];
+ if ($type == "pppoe" || $type == "pptp") {
+ if (!is_array($config['ppps']['ppp']))
+ $config['ppps']['ppp'] = array();
+ if (count($config['ppps']['ppp'])) {
+ foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
+ if ($ppp['ptpid'] == "0") {
+ unset($config['ppps']['ppp'][$pppid]);
+ // break;
+ }
+
+ }
+ }
+ if ($type == "pptp") {
+ $config['interfaces']['tmp']['username'] = $config['interfaces']['tmp']['pptpusername'];
+ $config['interfaces']['tmp']['password'] = $config['interfaces']['tmp']['pptppassword'];
+ $config['interfaces']['tmp']['ondemand'] = $config['interfaces']['tmp']['pptpondemand'];
+ $config['interfaces']['tmp']['idletimeout'] = $config['interfaces']['tmp']['pptpidletimeout'];
+ unset($config['interfaces']['tmp']['pptpusername']);
+ unset($config['interfaces']['tmp']['pptppassword']);
+ unset($config['interfaces']['tmp']['pptpondemand']);
+ unset($config['interfaces']['tmp']['pptpidletimeout']);
+ }
+ $config['interfaces']['tmp']['password'] = base64_encode($config['interfaces']['tmp']['password']);
+ $tmp = array();
+ $tmp['ptpid'] = "0";
+ $tmp['type'] = $type;
+ $tmp['if'] = $type . "0";
+ $tmp['ports'] = $config['interfaces']['wan']['if'];
+ $config['ppps']['ppp'][] = array_merge($tmp, $config['interfaces']['tmp']);
+ unset($tmp);
+ $config['interfaces']['wan']['if'] = $type."0";
+ }
+ unset($config['interfaces']['tmp']);
]]>
</stepsubmitphpaction>
<stepsubmitbeforesave>
OpenPOWER on IntegriCloud