diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/globals.inc | 2 | ||||
-rw-r--r-- | etc/inc/util.inc | 27 |
2 files changed, 27 insertions, 2 deletions
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index cf16cac..2cc39c8 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -54,7 +54,7 @@ function get_nics_with_capabilities($CAPABILITIES) { } $g = array( - "base_packages" => "AutoConfigBackup, siproxd", + "base_packages" => "siproxd", "factory_shipped_username" => "admin", "factory_shipped_password" => "pfsense", "upload_path" => "/root", diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 818b08e..85bf991 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -996,4 +996,29 @@ function timeout($timer = 9) { return $key; } -?> +function msort($array, $id="id", $sort_ascending=true) { + $temp_array = array(); + while(count($array)>0) { + $lowest_id = 0; + $index=0; + foreach ($array as $item) { + if (isset($item[$id])) { + if ($array[$lowest_id][$id]) { + if (strtolower($item[$id]) < strtolower($array[$lowest_id][$id])) { + $lowest_id = $index; + } + } + } + $index++; + } + $temp_array[] = $array[$lowest_id]; + $array = array_merge(array_slice($array, 0,$lowest_id), array_slice($array, $lowest_id+1)); + } + if ($sort_ascending) { + return $temp_array; + } else { + return array_reverse($temp_array); + } +} + +?>
\ No newline at end of file |