From 0e3aa71cd00836a3621ca68cb7e060b0d07e1327 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Wed, 10 Mar 2010 19:26:08 -0700 Subject: Fix sorting issues that were introduced in an old commit, resulting in the incorrect item sometimes being shown when clicking edit buttons. --- usr/local/www/firewall_nat_1to1_edit.php | 3 +-- usr/local/www/firewall_schedule_edit.php | 3 +-- usr/local/www/services_captiveportal_filemanager.php | 2 +- usr/local/www/services_captiveportal_ip_edit.php | 3 +-- usr/local/www/services_captiveportal_mac_edit.php | 3 +-- usr/local/www/services_dnsmasq_edit.php | 3 +-- usr/local/www/services_wol_edit.php | 3 +-- usr/local/www/system_groupmanager_addprivs.php | 1 - usr/local/www/system_routes_edit.php | 3 +-- usr/local/www/system_usermanager_addprivs.php | 1 - usr/local/www/vpn_l2tp_users_edit.php | 3 +-- usr/local/www/vpn_pppoe_users_edit.php | 3 +-- usr/local/www/vpn_pptp_users_edit.php | 3 +-- 13 files changed, 11 insertions(+), 23 deletions(-) diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php index c4452d2..62c4c33 100755 --- a/usr/local/www/firewall_nat_1to1_edit.php +++ b/usr/local/www/firewall_nat_1to1_edit.php @@ -60,7 +60,6 @@ require("shaper.inc"); if (!is_array($config['nat']['onetoone'])) { $config['nat']['onetoone'] = array(); } -nat_1to1_rules_sort(); $a_1to1 = &$config['nat']['onetoone']; $id = $_GET['id']; @@ -141,11 +140,11 @@ if ($_POST) { $natent['descr'] = $_POST['descr']; $natent['interface'] = $_POST['interface']; - nat_1to1_rules_sort(); if (isset($id) && $a_1to1[$id]) $a_1to1[$id] = $natent; else $a_1to1[] = $natent; + nat_1to1_rules_sort(); mark_subsystem_dirty('natconf'); diff --git a/usr/local/www/firewall_schedule_edit.php b/usr/local/www/firewall_schedule_edit.php index f318611..62f0d99 100644 --- a/usr/local/www/firewall_schedule_edit.php +++ b/usr/local/www/firewall_schedule_edit.php @@ -71,7 +71,6 @@ $monthArray = array ('January','February','March','April','May','June','July','A if (!is_array($config['schedules']['schedule'])) $config['schedules']['schedule'] = array(); -schedule_sort(); $a_schedules = &$config['schedules']['schedule']; @@ -176,13 +175,13 @@ if ($_POST) { else $schedule['schedlabel'] = uniqid(); - schedule_sort(); if (isset($id) && $a_schedules[$id]){ $a_schedules[$id] = $schedule; } else{ $a_schedules[] = $schedule; } + schedule_sort(); write_config(); filter_configure(); diff --git a/usr/local/www/services_captiveportal_filemanager.php b/usr/local/www/services_captiveportal_filemanager.php index 84091d1..328f293 100755 --- a/usr/local/www/services_captiveportal_filemanager.php +++ b/usr/local/www/services_captiveportal_filemanager.php @@ -60,7 +60,6 @@ require("captiveportal.inc"); if (!is_array($config['captiveportal']['element'])) $config['captiveportal']['element'] = array(); -cpelements_sort(); $a_element = &$config['captiveportal']['element']; // Calculate total size of all files @@ -101,6 +100,7 @@ if ($_POST) { $element['content'] = base64_encode(file_get_contents($_FILES['new']['tmp_name'])); $a_element[] = $element; + cpelements_sort(); write_config(); captiveportal_write_elements(); diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php index 866c9f3..93628ba 100755 --- a/usr/local/www/services_captiveportal_ip_edit.php +++ b/usr/local/www/services_captiveportal_ip_edit.php @@ -59,7 +59,6 @@ require("captiveportal.inc"); if (!is_array($config['captiveportal']['allowedip'])) $config['captiveportal']['allowedip'] = array(); -allowedips_sort(); $a_allowedips = &$config['captiveportal']['allowedip']; $id = $_GET['id']; @@ -103,11 +102,11 @@ if ($_POST) { $ip['descr'] = $_POST['descr']; $ip['dir'] = $_POST['dir']; - allowedips_sort(); if (isset($id) && $a_allowedips[$id]) $a_allowedips[$id] = $ip; else $a_allowedips[] = $ip; + allowedips_sort(); write_config(); diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index 56618b7..9123303 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -58,7 +58,6 @@ require("captiveportal.inc"); if (!is_array($config['captiveportal']['passthrumac'])) $config['captiveportal']['passthrumac'] = array(); -passthrumacs_sort(); $a_passthrumacs = &$config['captiveportal']['passthrumac']; $id = $_GET['id']; @@ -102,11 +101,11 @@ if ($_POST) { $mac['mac'] = $_POST['mac']; $mac['descr'] = $_POST['descr']; - passthrumacs_sort(); if (isset($id) && $a_passthrumacs[$id]) $a_passthrumacs[$id] = $mac; else $a_passthrumacs[] = $mac; + passthrumacs_sort(); write_config(); diff --git a/usr/local/www/services_dnsmasq_edit.php b/usr/local/www/services_dnsmasq_edit.php index 307927b..7438758 100755 --- a/usr/local/www/services_dnsmasq_edit.php +++ b/usr/local/www/services_dnsmasq_edit.php @@ -57,7 +57,6 @@ require("guiconfig.inc"); if (!is_array($config['dnsmasq']['hosts'])) $config['dnsmasq']['hosts'] = array(); -hosts_sort(); $a_hosts = &$config['dnsmasq']['hosts']; $id = $_GET['id']; @@ -109,11 +108,11 @@ if ($_POST) { $hostent['ip'] = $_POST['ip']; $hostent['descr'] = $_POST['descr']; - hosts_sort(); if (isset($id) && $a_hosts[$id]) $a_hosts[$id] = $hostent; else $a_hosts[] = $hostent; + hosts_sort(); mark_subsystem_dirty('hosts'); diff --git a/usr/local/www/services_wol_edit.php b/usr/local/www/services_wol_edit.php index 871e6e9..04a7f2f 100755 --- a/usr/local/www/services_wol_edit.php +++ b/usr/local/www/services_wol_edit.php @@ -54,7 +54,6 @@ require("guiconfig.inc"); if (!is_array($config['wol']['wolentry'])) { $config['wol']['wolentry'] = array(); } -wol_sort(); $a_wol = &$config['wol']['wolentry']; $id = $_GET['id']; @@ -97,11 +96,11 @@ if ($_POST) { $wolent['mac'] = $_POST['mac']; $wolent['descr'] = $_POST['descr']; - wol_sort(); if (isset($id) && $a_wol[$id]) $a_wol[$id] = $wolent; else $a_wol[] = $wolent; + wol_sort(); write_config(); diff --git a/usr/local/www/system_groupmanager_addprivs.php b/usr/local/www/system_groupmanager_addprivs.php index 9d8669a..e1937a2 100644 --- a/usr/local/www/system_groupmanager_addprivs.php +++ b/usr/local/www/system_groupmanager_addprivs.php @@ -61,7 +61,6 @@ $groupid = $_GET['groupid']; if (isset($_POST['groupid'])) $groupid = $_POST['groupid']; -admin_groups_sort(); $a_group = & $config['system']['group'][$groupid]; if (!is_array($a_group)) { diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index 4e4a628..434bbbc 100755 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -60,7 +60,6 @@ if (!is_array($config['staticroutes']['route'])) if (!is_array($config['gateways']['gateway_item'])) $config['gateways']['gateway_item'] = array(); -staticroutes_sort(); $a_routes = &$config['staticroutes']['route']; $a_gateways = &$config['gateways']['gateway_item']; @@ -128,11 +127,11 @@ if ($_POST) { $route['gateway'] = $_POST['gateway']; $route['descr'] = $_POST['descr']; - staticroutes_sort(); if (isset($id) && $a_routes[$id]) $a_routes[$id] = $route; else $a_routes[] = $route; + staticroutes_sort(); mark_subsystem_dirty('staticroutes'); diff --git a/usr/local/www/system_usermanager_addprivs.php b/usr/local/www/system_usermanager_addprivs.php index 58a1d24..9272121 100644 --- a/usr/local/www/system_usermanager_addprivs.php +++ b/usr/local/www/system_usermanager_addprivs.php @@ -61,7 +61,6 @@ $userid = $_GET['userid']; if (isset($_POST['userid'])) $userid = $_POST['userid']; -admin_users_sort(); $a_user = & $config['system']['user'][$userid]; if (!is_array($a_user)) { pfSenseHeader("system_usermanager.php?id={$userid}"); diff --git a/usr/local/www/vpn_l2tp_users_edit.php b/usr/local/www/vpn_l2tp_users_edit.php index ad1db19..f88d821 100644 --- a/usr/local/www/vpn_l2tp_users_edit.php +++ b/usr/local/www/vpn_l2tp_users_edit.php @@ -56,7 +56,6 @@ require_once("vpn.inc"); if (!is_array($config['l2tp']['user'])) { $config['l2tp']['user'] = array(); } -l2tp_users_sort(); $a_secret = &$config['l2tp']['user']; $id = $_GET['id']; @@ -124,11 +123,11 @@ if ($_POST) { if ($_POST['passwordfld']) $secretent['password'] = $_POST['passwordfld']; - l2tp_users_sort(); if (isset($id) && $a_secret[$id]) $a_secret[$id] = $secretent; else $a_secret[] = $secretent; + l2tp_users_sort(); write_config(); diff --git a/usr/local/www/vpn_pppoe_users_edit.php b/usr/local/www/vpn_pppoe_users_edit.php index 2b884ab..4450c56 100755 --- a/usr/local/www/vpn_pppoe_users_edit.php +++ b/usr/local/www/vpn_pppoe_users_edit.php @@ -54,7 +54,6 @@ require_once("vpn.inc"); if (!is_array($config['pppoe']['user'])) { $config['pppoe']['user'] = array(); } -pppoe_users_sort(); $a_secret = &$config['pppoe']['user']; $id = $_GET['id']; @@ -116,11 +115,11 @@ if ($_POST) { if ($_POST['password']) $secretent['password'] = $_POST['password']; - pppoe_users_sort(); if (isset($id) && $a_secret[$id]) $a_secret[$id] = $secretent; else $a_secret[] = $secretent; + pppoe_users_sort(); write_config(); diff --git a/usr/local/www/vpn_pptp_users_edit.php b/usr/local/www/vpn_pptp_users_edit.php index 5d5c9e2..86202aa 100755 --- a/usr/local/www/vpn_pptp_users_edit.php +++ b/usr/local/www/vpn_pptp_users_edit.php @@ -54,7 +54,6 @@ require_once("vpn.inc"); if (!is_array($config['pptpd']['user'])) { $config['pptpd']['user'] = array(); } -pptpd_users_sort(); $a_secret = &$config['pptpd']['user']; $id = $_GET['id']; @@ -116,11 +115,11 @@ if ($_POST) { if ($_POST['password']) $secretent['password'] = $_POST['password']; - pptpd_users_sort(); if (isset($id) && $a_secret[$id]) $a_secret[$id] = $secretent; else $a_secret[] = $secretent; + pptpd_users_sort(); write_config(); mark_subsystem_dirty('pptpusers'); -- cgit v1.1