diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-03-17 15:45:46 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-03-17 15:45:46 -0400 |
commit | b00bbc0b56413690eab7e0314ab8725cf583af71 (patch) | |
tree | 12ff74b5e82013baef4cc08676a4d8ed9e3b95c6 /src | |
parent | 18e7bc466f369049b64e5f207527a8445ff17eba (diff) | |
download | pfsense-b00bbc0b56413690eab7e0314ab8725cf583af71.zip pfsense-b00bbc0b56413690eab7e0314ab8725cf583af71.tar.gz |
Fixed #6003
Corrected showadv logic
Corrected long standing iussue displaying reset times (goes back to 2.0)
Corrected config save by adding hidden ptpid
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/interfaces_ppps_edit.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/usr/local/www/interfaces_ppps_edit.php b/src/usr/local/www/interfaces_ppps_edit.php index 09e2210..a799cbd 100644 --- a/src/usr/local/www/interfaces_ppps_edit.php +++ b/src/usr/local/www/interfaces_ppps_edit.php @@ -79,6 +79,10 @@ if (!is_array($config['ppps']['ppp'])) { $a_ppps = &$config['ppps']['ppp']; +$iflist = get_configured_interface_with_descr(); +$portlist = get_interface_list(); +$portlist = array_merge($portlist, $iflist); + if (isset($_REQUEST['type'])) { $pconfig['type'] = $_REQUEST['type']; } @@ -87,7 +91,12 @@ if (isset($_REQUEST['id']) && is_numericint($_REQUEST['id'])) { $id = $_REQUEST['id']; } +if (isset($_POST['id']) && is_numericint($_POST['id'])) { + $id = $_POST['id']; +} + if (isset($id) && $a_ppps[$id]) { + $pconfig['ptpid'] = $a_ppps[$id]['ptpid']; $pconfig['type'] = $a_ppps[$id]['type']; $pconfig['interfaces'] = explode(",", $a_ppps[$id]['ports']); $pconfig['username'] = $a_ppps[$id]['username']; @@ -195,6 +204,8 @@ if (isset($id) && $a_ppps[$id]) { } break; } +} else { + $pconfig['ptpid'] = interfaces_ptpid_next(); } if (isset($_POST) && is_array($_POST) && count($_POST) > 0) { @@ -338,6 +349,7 @@ if (isset($_POST) && is_array($_POST) && count($_POST) > 0) { $ppp['ptpid'] = interfaces_ptpid_next(); else $ppp['ptpid'] = $a_ppps[$id]['ptpid']; + $ppp['type'] = $_POST['type']; $ppp['if'] = $ppp['type'].$ppp['ptpid']; $ppp['ports'] = implode(',', $_POST['interfaces']); @@ -945,6 +957,13 @@ $section->addInput($linkparamhelp); $form->add($section); +$form->addGlobal(new Form_Input( + 'ptpid', + null, + 'hidden', + $pconfig['ptpid'] +)); + if (isset($id) && $a_ppps[$id]) { $form->addGlobal(new Form_Input( 'id', @@ -1015,9 +1034,9 @@ events.push(function() { var pppoetype = ($('#type').val() == 'pppoe'); hideClass('pppoe', !pppoetype); + hideResetDisplay(!(showadvopts && pppoetype)); hideInput('pppoe-reset-type', !(showadvopts && pppoetype)); - hideResetDisplay(true); hideInterfaces(); if (showadvopts) { @@ -1026,7 +1045,7 @@ events.push(function() { text = "<?=gettext('Display Advanced');?>"; } $('#btnadvopts').html('<i class="fa fa-cog"></i> ' + text); - } + } // e-o-show_advopts $('#btnadvopts').prop('type', 'button'); |