summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-07-14 18:56:47 +0000
committerErmal Luçi <eri@pfsense.org>2009-07-14 18:57:08 +0000
commit4504a76990aebf536c14501cf71907ae546d9c2a (patch)
tree57cd4267d81555c0e49fc5ff3fdcc5ae45a5872e
parent4666b7875109373ab373fd25aff4606c87f32742 (diff)
downloadpfsense-4504a76990aebf536c14501cf71907ae546d9c2a.zip
pfsense-4504a76990aebf536c14501cf71907ae546d9c2a.tar.gz
Remove all nested functions decalaration seems php does not like them! Make all the nested functions real functions.
-rwxr-xr-xusr/local/www/services_captiveportal_filemanager.php10
-rwxr-xr-xusr/local/www/services_captiveportal_ip_edit.php8
-rwxr-xr-xusr/local/www/services_captiveportal_mac_edit.php10
-rwxr-xr-xusr/local/www/services_dnsmasq_edit.php8
-rwxr-xr-xusr/local/www/services_proxyarp_edit.php40
-rwxr-xr-xusr/local/www/services_wol_edit.php10
-rw-r--r--usr/local/www/system_groupmanager_addprivs.php10
-rwxr-xr-xusr/local/www/system_routes_edit.php8
-rw-r--r--usr/local/www/system_usermanager_addprivs.php10
-rw-r--r--usr/local/www/vpn_l2tp_users_edit.php12
-rwxr-xr-xusr/local/www/vpn_pppoe_users_edit.php12
-rwxr-xr-xusr/local/www/vpn_pptp_users_edit.php11
12 files changed, 74 insertions, 75 deletions
diff --git a/usr/local/www/services_captiveportal_filemanager.php b/usr/local/www/services_captiveportal_filemanager.php
index 898323b..93bdb9b 100755
--- a/usr/local/www/services_captiveportal_filemanager.php
+++ b/usr/local/www/services_captiveportal_filemanager.php
@@ -36,12 +36,12 @@
##|*MATCH=services_captiveportal_filemanager.php*
##|-PRIV
-function cpelements_sort() {
- global $g, $config;
+function cpelementscmp($a, $b) {
+ return strcasecmp($a['name'], $b['name']);
+}
- function cpelementscmp($a, $b) {
- return strcasecmp($a['name'], $b['name']);
- }
+function cpelements_sort() {
+ global $config;
usort($config['captiveportal']['element'],"cpelementscmp");
}
diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php
index 19e2595..0810077 100755
--- a/usr/local/www/services_captiveportal_ip_edit.php
+++ b/usr/local/www/services_captiveportal_ip_edit.php
@@ -35,13 +35,13 @@
##|*MATCH=services_captiveportal_ip_edit.php*
##|-PRIV
+function allowedipscmp($a, $b) {
+ return strcmp($a['ip'], $b['ip']);
+}
+
function allowedips_sort() {
global $g, $config;
- function allowedipscmp($a, $b) {
- return strcmp($a['ip'], $b['ip']);
- }
-
usort($config['captiveportal']['allowedip'],"allowedipscmp");
}
diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php
index c4e138f..da6e6b3 100755
--- a/usr/local/www/services_captiveportal_mac_edit.php
+++ b/usr/local/www/services_captiveportal_mac_edit.php
@@ -35,12 +35,12 @@
##|*MATCH=services_captiveportal_mac_edit.php*
##|-PRIV
-function passthrumacs_sort() {
- global $g, $config;
+function passthrumacscmp($a, $b) {
+ return strcmp($a['mac'], $b['mac']);
+}
- function passthrumacscmp($a, $b) {
- return strcmp($a['mac'], $b['mac']);
- }
+function passthrumacs_sort() {
+ global $config;
usort($config['captiveportal']['passthrumac'],"passthrumacscmp");
}
diff --git a/usr/local/www/services_dnsmasq_edit.php b/usr/local/www/services_dnsmasq_edit.php
index c2df114..26773b8 100755
--- a/usr/local/www/services_dnsmasq_edit.php
+++ b/usr/local/www/services_dnsmasq_edit.php
@@ -36,16 +36,16 @@
##|*MATCH=services_dnsmasq_edit.php*
##|-PRIV
+function hostcmp($a, $b) {
+ return strcasecmp($a['host'], $b['host']);
+}
+
function hosts_sort() {
global $g, $config;
if (!is_array($config['dnsmasq']['hosts']))
return;
- function hostcmp($a, $b) {
- return strcasecmp($a['host'], $b['host']);
- }
-
usort($config['dnsmasq']['hosts'], "hostcmp");
}
diff --git a/usr/local/www/services_proxyarp_edit.php b/usr/local/www/services_proxyarp_edit.php
index 0e93924..c84fdbc 100755
--- a/usr/local/www/services_proxyarp_edit.php
+++ b/usr/local/www/services_proxyarp_edit.php
@@ -36,27 +36,27 @@
##|*MATCH=services_proxyarp_edit.php*
##|-PRIV
-function proxyarp_sort() {
- global $g, $config;
+function proxyarpcmp($a, $b) {
+ if (isset($a['network']))
+ list($ast,$asn) = explode("/", $a['network']);
+ else if (isset($a['range'])) {
+ $ast = $a['range']['from'];
+ $asn = 32;
+ }
+ if (isset($b['network']))
+ list($bst,$bsn) = explode("/", $b['network']);
+ else if (isset($b['range'])) {
+ $bst = $b['range']['from'];
+ $bsn = 32;
+ }
+ if (ipcmp($ast, $bst) == 0)
+ return ($asn - $bsn);
+ else
+ return ipcmp($ast, $bst);
+}
- function proxyarpcmp($a, $b) {
- if (isset($a['network']))
- list($ast,$asn) = explode("/", $a['network']);
- else if (isset($a['range'])) {
- $ast = $a['range']['from'];
- $asn = 32;
- }
- if (isset($b['network']))
- list($bst,$bsn) = explode("/", $b['network']);
- else if (isset($b['range'])) {
- $bst = $b['range']['from'];
- $bsn = 32;
- }
- if (ipcmp($ast, $bst) == 0)
- return ($asn - $bsn);
- else
- return ipcmp($ast, $bst);
- }
+function proxyarp_sort() {
+ global $config;
usort($config['proxyarp']['proxyarpnet'], "proxyarpcmp");
}
diff --git a/usr/local/www/services_wol_edit.php b/usr/local/www/services_wol_edit.php
index 30f710b..e9b238e 100755
--- a/usr/local/www/services_wol_edit.php
+++ b/usr/local/www/services_wol_edit.php
@@ -36,12 +36,12 @@
##|*MATCH=services_wol_edit.php*
##|-PRIV
-function wol_sort() {
- global $g, $config;
+function wolcmp($a, $b) {
+ return strcmp($a['descr'], $b['descr']);
+}
- function wolcmp($a, $b) {
- return strcmp($a['descr'], $b['descr']);
- }
+function wol_sort() {
+ global $config;
usort($config['wol']['wolentry'], "wolcmp");
}
diff --git a/usr/local/www/system_groupmanager_addprivs.php b/usr/local/www/system_groupmanager_addprivs.php
index 98736a8..95a5570 100644
--- a/usr/local/www/system_groupmanager_addprivs.php
+++ b/usr/local/www/system_groupmanager_addprivs.php
@@ -35,16 +35,16 @@
##|*MATCH=system_groupmanager_addprivs.php*
##|-PRIV
+function cpusercmp($a, $b) {
+ return strcasecmp($a['name'], $b['name']);
+}
+
function admin_groups_sort() {
- global $g, $config;
+ global $config;
if (!is_array($config['system']['group']))
return;
- function cpusercmp($a, $b) {
- return strcasecmp($a['name'], $b['name']);
- }
-
usort($config['system']['group'], "cpusercmp");
}
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php
index e83b88a..4bb2e6c 100755
--- a/usr/local/www/system_routes_edit.php
+++ b/usr/local/www/system_routes_edit.php
@@ -36,16 +36,16 @@
##|*MATCH=system_routes_edit.php*
##|-PRIV
+function staticroutecmp($a, $b) {
+ return strcmp($a['network'], $b['network']);
+}
+
function staticroutes_sort() {
global $g, $config;
if (!is_array($config['staticroutes']['route']))
return;
- function staticroutecmp($a, $b) {
- return strcmp($a['network'], $b['network']);
- }
-
usort($config['staticroutes']['route'], "staticroutecmp");
}
diff --git a/usr/local/www/system_usermanager_addprivs.php b/usr/local/www/system_usermanager_addprivs.php
index 123875b..9ee3145 100644
--- a/usr/local/www/system_usermanager_addprivs.php
+++ b/usr/local/www/system_usermanager_addprivs.php
@@ -35,17 +35,17 @@
##|*MATCH=system_usermanager_addprivs.php*
##|-PRIV
+function admusercmp($a, $b) {
+ return strcasecmp($a['name'], $b['name']);
+}
+
function admin_users_sort() {
global $g, $config;
if (!is_array($config['system']['user']))
return;
- function cpusercmp($a, $b) {
- return strcasecmp($a['name'], $b['name']);
- }
-
- usort($config['system']['user'], "cpusercmp");
+ usort($config['system']['user'], "admusercmp");
}
require("guiconfig.inc");
diff --git a/usr/local/www/vpn_l2tp_users_edit.php b/usr/local/www/vpn_l2tp_users_edit.php
index 4b5a8f5..c54a449 100644
--- a/usr/local/www/vpn_l2tp_users_edit.php
+++ b/usr/local/www/vpn_l2tp_users_edit.php
@@ -37,17 +37,17 @@
$pgtitle = array(gettext("VPN"),gettext("L2TP"),gettext("User"),gettext("Edit"));
+function l2tpusercmp($a, $b) {
+ return strcasecmp($a['name'], $b['name']);
+}
+
function l2tp_users_sort() {
- global $g, $config;
+ global $config;
if (!is_array($config['l2tp']['user']))
return;
- function usercmp($a, $b) {
- return strcasecmp($a['name'], $b['name']);
- }
-
- usort($config['l2tp']['user'], "usercmp");
+ usort($config['l2tp']['user'], "l2tpusercmp");
}
require("guiconfig.inc");
diff --git a/usr/local/www/vpn_pppoe_users_edit.php b/usr/local/www/vpn_pppoe_users_edit.php
index ce43e08..de5a314 100755
--- a/usr/local/www/vpn_pppoe_users_edit.php
+++ b/usr/local/www/vpn_pppoe_users_edit.php
@@ -35,17 +35,17 @@
##|*MATCH=vpn_pppoe_users_edit.php*
##|-PRIV
+function pppoeusercmp($a, $b) {
+ return strcasecmp($a['name'], $b['name']);
+}
+
function pppoe_users_sort() {
- global $g, $config;
+ global $config;
if (!is_array($config['pppoe']['user']))
return;
- function usercmp($a, $b) {
- return strcasecmp($a['name'], $b['name']);
- }
-
- usort($config['pppoe']['user'], "usercmp");
+ usort($config['pppoe']['user'], "pppoeusercmp");
}
require("guiconfig.inc");
diff --git a/usr/local/www/vpn_pptp_users_edit.php b/usr/local/www/vpn_pptp_users_edit.php
index 07961da..b8ad074 100755
--- a/usr/local/www/vpn_pptp_users_edit.php
+++ b/usr/local/www/vpn_pptp_users_edit.php
@@ -35,18 +35,17 @@
##|*MATCH=vpn_pptp_users_edit.php*
##|-PRIV
+function pptpusercmp($a, $b) {
+ return strcasecmp($a['name'], $b['name']);
+}
function pptpd_users_sort() {
- global $g, $config;
+ global $config;
if (!is_array($config['ppptpd']['user']))
return;
- function usercmp($a, $b) {
- return strcasecmp($a['name'], $b['name']);
- }
-
- usort($config['pptpd']['user'], "usercmp");
+ usort($config['pptpd']['user'], "pptpusercmp");
}
require("guiconfig.inc");
OpenPOWER on IntegriCloud