diff options
author | gnhb <gnoahb@gmail.com> | 2010-06-08 22:32:25 +0700 |
---|---|---|
committer | gnhb <gnoahb@gmail.com> | 2010-06-08 22:32:25 +0700 |
commit | 8256f324086c5c85f02663aa729f6bb52aed827a (patch) | |
tree | b6b8514cb3fbd4c55154f82f9033424731586f35 /usr | |
parent | 743994a651e76254f2f079e896efd5cf5f3a29b3 (diff) | |
download | pfsense-8256f324086c5c85f02663aa729f6bb52aed827a.zip pfsense-8256f324086c5c85f02663aa729f6bb52aed827a.tar.gz |
Fix all issues that Ermal found.
Interfaces.php problems.
1- When creating a pppoe ptpid on the config is empty(<<ptpid/>).
2- after switching from pppoe to pptp in the config there remains
pppoe-reset-type which is not that much of a bug but needs to be
fixed.
3- When choosing ppp type even though i do not have a device i am
allowed to save. After saving it switches to none type automatically.
The <ppp> section still has values of pptp config and some of pppoe
and only the apn related to ppp. The interface assignment still has
teh interface pptp1! (This is quite buggy i would say.)
Interfaces -> assign
1- After doing all the tests on interfaces.php everything is shown
with ppp() on interfaces.php picture attached. (probably an issue with
how you do find ppp interfaces around.)
2- MPD is started even though the interface is not enabled after assignment.
3- During assignment as i tell you even below remove teh pptpid from
the interface an duse interface name.
Interfaces -> assign -> ppp
1- I have an emtpy thing in there when i do all the actions on interfaces.php
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/interfaces.php | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index f35ae64..4d6c4c4 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -94,14 +94,12 @@ $a_gateways = &$config['gateways']['gateway_item']; $wancfg = &$config['interfaces'][$if]; -if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { - foreach ($a_ppps as $pppid => $ppp) { - if ($wancfg['ptpid'] == $ppp['ptpid']) - break; - } +foreach ($a_ppps as $pppid => $ppp) { + if ($wancfg['ptpid'] == $ppp['ptpid']) + break; } -if ($wancfg['ptpid'] == $a_ppps[$pppid]['ptpid']) { +if (isset($wancfg['ptpid']) && $wancfg['ptpid'] == $a_ppps[$pppid]['ptpid']) { $pconfig['pppid'] = $pppid; if ($a_ppps[$pppid]['type'] == "ppp"){ @@ -171,6 +169,9 @@ if ($wancfg['ptpid'] == $a_ppps[$pppid]['ptpid']) { $pconfig['pptp_dialondemand'] = isset($a_ppps[$pppid]['ondemand']); $pconfig['pptp_idletimeout'] = $a_ppps[$pppid]['timeout']; } +} else { + $new_ptpid=uniqid('', true); + $pppid = count($a_ppps); } $pconfig['dhcphostname'] = $wancfg['dhcphostname']; $pconfig['alias-address'] = $wancfg['alias-address']; @@ -499,12 +500,17 @@ if ($_POST) { unset($wancfg['provider']); unset($wancfg['ondemand']); unset($wancfg['timeout']); - if ($wancfg['pppoe']['pppoe-reset-type']) - unset($wancfg['pppoe']['pppoe-reset-type']); + unset($wancfg['pppoe']['pppoe-reset-type']); unset($wancfg['local']); unset($wancfg['subnet']); unset($wancfg['remote']); - + unset($a_ppps[$pppid]['apn']); + unset($a_ppps[$pppid]['phone']); + unset($a_ppps[$pppid]['localip']); + unset($a_ppps[$pppid]['subnet']); + unset($a_ppps[$pppid]['gateway']); + unset($a_ppps[$pppid]['pppoe-reset-type']); + $wancfg['descr'] = remove_bad_chars($_POST['descr']); $wancfg['enable'] = $_POST['enable'] == "yes" ? true : false; @@ -568,7 +574,13 @@ if ($_POST) { $a_ppps[$pppid]['ports'] = $_POST['port']; $a_ppps[$pppid]['username'] = $_POST['username']; $a_ppps[$pppid]['password'] = base64_encode($_POST['password']); + $a_ppps[$pppid]['phone'] = $_POST['phone']; $a_ppps[$pppid]['apn'] = $_POST['apn']; + $wancfg['if'] = $_POST['type'] . $if_num; + $wancfg['ptpid'] = $_POST['ptpid']; + $wancfg['ipaddr'] = $_POST['type']; + unset($a_ppps[$pppid]['ondemand']); + unset($a_ppps[$pppid]['idletimeout']); break; case "pppoe": @@ -1962,12 +1974,11 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" = <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;?>"> + <?php if (isset ($wancfg['ptpid']) && $wancfg['ptpid'] == $a_ppps[$pppid]['ptpid']) : ?> <input name="ppp_port" type="hidden" value="<?=$a_ppps[$pppid]['ports'];?>"> <input name="ptpid" type="hidden" value="<?=$a_ppps[$pppid]['ptpid'];?>"> <?php else: ?> - <input name="ptpid" type="hidden" value="<?=uniqid('', true);?>"> + <input name="ptpid" type="hidden" value="<?=$new_ptpid;?>"> <?php endif; ?> </td> </tr> |