From cdd948dfcc35c0ca78d8bcb8c7197fb2383ae2c8 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 22 Dec 2015 11:53:56 +0100 Subject: [PATCH] (legacy) refactor interfaces.php, box all sections --- src/www/interfaces.php | 399 +++++++++++++++++++++++------------------ 1 file changed, 228 insertions(+), 171 deletions(-) diff --git a/src/www/interfaces.php b/src/www/interfaces.php index b9ad68cd2..67e04e0b3 100644 --- a/src/www/interfaces.php +++ b/src/www/interfaces.php @@ -322,30 +322,30 @@ $ifdescrs = get_configured_interface_with_descr(false, true); // reference to interface section if (empty($config['interfaces']) || !is_array($config['interfaces'])) { - $config['interfaces'] = array(); + $config['interfaces'] = array(); } $a_interfaces = &$config['interfaces']; if (empty($config['ppps']['ppp']) || !is_array($config['ppps']['ppp'])) { $config['ppps'] = array(); - $config['ppps']['ppp'] = array(); + $config['ppps']['ppp'] = array(); } $a_ppps = &$config['ppps']['ppp']; if ($_SERVER['REQUEST_METHOD'] === 'GET') { - if (!empty($_GET['if']) && !empty($a_interfaces[$_GET['if']])) { - $if = $_GET['if']; - } else { - // no interface provided, redirect to interface assignments - header("Location: interfaces_assign.php"); - exit; - } + if (!empty($_GET['if']) && !empty($a_interfaces[$_GET['if']])) { + $if = $_GET['if']; + } else { + // no interface provided, redirect to interface assignments + header("Location: interfaces_assign.php"); + exit; + } - $pconfig = array(); + $pconfig = array(); $std_copy_fieldnames = array( "if", "descr", "dhcphostname", "alias-address", "alias-subnet", "dhcprejectfrom", "ipaddr", "subnet", "gateway", - "ipaddrv6", + "ipaddrv6", "media", "mediaopt", "adv_dhcp_pt_timeout", "adv_dhcp_pt_retry", "adv_dhcp_pt_select_timeout", "adv_dhcp_pt_reboot", "adv_dhcp_pt_backoff_cutoff", "adv_dhcp_pt_initial_interval", "adv_dhcp_pt_values", "adv_dhcp_send_options", "adv_dhcp_request_options", "adv_dhcp_required_options", "adv_dhcp_option_modifiers", @@ -522,13 +522,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } } } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - $pconfig = $_POST; + $pconfig = $_POST; $input_errors = array(); - if (!empty($_POST['if']) && !empty($a_interfaces[$_POST['if']])) { - $if = $_POST['if']; + if (!empty($_POST['if']) && !empty($a_interfaces[$_POST['if']])) { + $if = $_POST['if']; // read physcial interface name from config.xml $pconfig['if'] = $a_interfaces[$if]['if']; - } + } if (!empty($pconfig['apply'])) { if (!is_subsystem_dirty('interfaces')) { @@ -1095,7 +1095,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (!empty($pconfig['dhcp6-ia-pd-send-hint'])) { $new_config['dhcp6-ia-pd-send-hint'] = true; } - if (!empty($new_config['dhcp6prefixonly'])) { + if (!empty($pconfig['dhcp6prefixonly'])) { $new_config['dhcp6prefixonly'] = true; } if (!empty($pconfig['dhcp6usev4iface'])) { @@ -1645,134 +1645,151 @@ include("head.inc"); } ?>
-
-
-
+ +
- - - - - - - - + + + + + + + + + + + +
- - -
- /> - -
+ + +   +
+ /> + +
-
-
+
+
+
+
- - - - - - - - - - - - - - - - - - - - - - - - - 0):?> - - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + 0):?> + + + + + +
- - -
- -
- -
- - -
- - -
- - -
- - +
+ +
+ +
+ +
+ + +
+ + +
+ + +
+ + +
- - + + + +
+
+
@@ -1866,8 +1883,12 @@ include("head.inc");
- - + + + +
+
+
@@ -1960,8 +1981,12 @@ include("head.inc");
- - + + + +
+
+
@@ -2018,13 +2043,13 @@ include("head.inc"); endif; endfor;?> -
+ @@ -2124,8 +2149,12 @@ include("head.inc"); - - + + + +
+
+
@@ -2144,7 +2173,7 @@ include("head.inc"); /> - - +
- - + + + +
+
+
@@ -2371,8 +2404,12 @@ include("head.inc");
- - + + + +
+
+
@@ -2420,8 +2457,12 @@ include("head.inc");
- - + + + +
+
+
@@ -2522,8 +2563,12 @@ include("head.inc");
- - + + + +
+
+
@@ -2656,8 +2701,12 @@ include("head.inc");
- - + + + +
+
+
@@ -2735,13 +2784,14 @@ include("head.inc");
- - - +
+
- + /* Wireless interface? */ + if (isset($a_interfaces[$if]['wireless'])):?> + +
+
@@ -3249,9 +3299,13 @@ include("head.inc");
+
+
- + endif; ?> + +
+
@@ -3287,11 +3341,14 @@ include("head.inc");
-
+
+ +
-
+
+
@@ -3308,7 +3365,7 @@ include("head.inc");
-
+