From 4b94f9ec0bc9aeeffaa770c916c91ebcafa9e7ca Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Fri, 7 Aug 2015 16:21:22 -0400 Subject: [PATCH] Partially converted Requires revised save logic using an array rather than multiple POST fields Also like to look at possibility of changing allowDuplication() method to add buttons horizontally. --- clean.sh | 26 +-- usr/local/www/interfaces_qinq_edit.php | 298 +++++++++---------------- 2 files changed, 113 insertions(+), 211 deletions(-) diff --git a/clean.sh b/clean.sh index 540a94e406..3f141151ea 100755 --- a/clean.sh +++ b/clean.sh @@ -1,15 +1,15 @@ #!/bin/sh -sed -i -e 's/> ]+listhdrr[^>]+>//g' $1 ; -sed -i -e 's/]*>//g' $1 ; -sed -i -e 's/<\(table\|td\|span\|div\)[^>]\+>/<\1>/g' $1 ; -sed -i -e 's///g' $1 ; -sed -i -e 's///g' $1 ; -sed -i -e 's//?>/g' $1 ; -sed -i -e 's/ / != /g' $1 ; \ No newline at end of file +sed -i '' 's/> ]+listhdrr[^>]+>//g' $1 ; +sed -i '' 's/]*>//g' $1 ; +sed -i '' 's/<\(table\|td\|span\|div\)[^>]\+>/<\1>/g' $1 ; +sed -i '' 's///g' $1 ; +sed -i '' 's///g' $1 ; +sed -i '' 's//?>/g' $1 ; +sed -i '' 's/ / != /g' $1 ; diff --git a/usr/local/www/interfaces_qinq_edit.php b/usr/local/www/interfaces_qinq_edit.php index 085ab8df41..dd3ad7a5c1 100644 --- a/usr/local/www/interfaces_qinq_edit.php +++ b/usr/local/www/interfaces_qinq_edit.php @@ -44,6 +44,8 @@ $shortcut_section = "interfaces"; require("guiconfig.inc"); +print('POST: '); print_r($_POST); print('
'); + if (!is_array($config['qinqs']['qinqentry'])) $config['qinqs']['qinqentry'] = array(); @@ -53,8 +55,8 @@ $portlist = get_interface_list(); /* add LAGG interfaces */ if (is_array($config['laggs']['lagg']) && count($config['laggs']['lagg'])) { - foreach ($config['laggs']['lagg'] as $lagg) - $portlist[$lagg['laggif']] = $lagg; + foreach ($config['laggs']['lagg'] as $lagg) + $portlist[$lagg['laggif']] = $lagg; } if (count($portlist) < 1) { @@ -64,6 +66,7 @@ if (count($portlist) < 1) { if (is_numericint($_GET['id'])) $id = $_GET['id']; + if (isset($_POST['id']) && is_numericint($_POST['id'])) $id = $_POST['id']; @@ -81,7 +84,6 @@ if (isset($id) && $a_qinqs[$id]) { } if ($_POST) { - unset($input_errors); $pconfig = $_POST; @@ -120,7 +122,7 @@ if ($_POST) { $isfirst = 0; /* item is a normal qinqentry type */ for($x=0; $x<9999; $x++) { - if($_POST["members{$x}"] <> "") { + if($_POST["members{$x}"] != "") { $member = explode("-", $_POST["members{$x}"]); if (count($member) > 1) { if (preg_match("/([^0-9])+/", $member[0], $match) || @@ -214,207 +216,107 @@ if ($_POST) { } } +function build_parent_list() { + global $portlist; + + $list = array(); + + foreach ($portlist as $ifn => $ifinfo) { + if (is_jumbo_capable($ifn)) + $list[$ifn] = $ifn . ' (' . $ifinfo['mac'] . ')'; + } + + return($list); +} + include("head.inc"); -?> -"> - +require('classes/Form.class.php'); - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
- -
- - - -
- -
- /> - Auto assign interface so it can be configured with ip etc... -
- /> - Auto enable interface so it can be used on filter rules. -
- /> - Allows to keep clients mtu unchanged(1500).
NOTE: if you are using jumbo frames this option is not needed and may produce incorrect results!
- -
- /> - -
- -
- - - -
- - - -
- - - - - - - "") { - $item = explode(" ", $members); - foreach($item as $ww) { - $member = $item[$counter]; - ?> - - - - - - -
- - - remove -
- - " /> - -
  - " /> - " /> - - - -
-
- - - - - - +include("foot.inc");