summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/authgui.inc4
-rw-r--r--etc/inc/priv.inc24
-rw-r--r--usr/local/www/widgets/widgets/system_information.widget.php2
3 files changed, 18 insertions, 12 deletions
diff --git a/etc/inc/authgui.inc b/etc/inc/authgui.inc
index 686bd53..6fa3cfa 100644
--- a/etc/inc/authgui.inc
+++ b/etc/inc/authgui.inc
@@ -38,6 +38,7 @@
*/
include_once("auth.inc");
+include_once("priv.defs.inc");
include_once("priv.inc");
/* We only support htpasswd backed HTTP Basic auth and session
@@ -55,8 +56,7 @@ include_once("priv.inc");
/* enable correct auth backend, default to htpasswd_backed */
$ldapcase = $config['system']['webgui']['backend'];
-switch($ldapcase)
-{
+switch($ldapcase) {
case ldap:
$backing_method="ldap_backed";
break;
diff --git a/etc/inc/priv.inc b/etc/inc/priv.inc
index 74ee212..13913f7 100644
--- a/etc/inc/priv.inc
+++ b/etc/inc/priv.inc
@@ -45,8 +45,7 @@
*/
/* Load and process custom privs. */
-function load_custom_privs($directory) {
- global $priv_list;
+function get_priv_files($directory) {
$dir_array = array();
if(!is_dir($directory))
return;
@@ -64,16 +63,23 @@ function load_custom_privs($directory) {
}
if(!is_array($dir_array))
return;
- foreach ($dir_array as $file)
- if (!is_dir("{$directory}/{$file}") && stristr($file,".inc"))
- include("{$directory}/{$file}");
+ return $dir_array;
}
// Load and sort privs
-load_custom_privs("/etc/inc/priv");
-if(is_dir("/usr/local/pkg/priv"))
- load_custom_privs("/usr/local/pkg/priv");
-sort_privs($priv_list);
+$dir_array = get_priv_files("/etc/inc/priv");
+foreach ($dir_array as $file)
+ if (!is_dir("/etc/inc/priv/{$file}") && stristr($file,".inc"))
+ include("/etc/inc/priv/{$file}");
+if(is_dir("/usr/local/pkg/priv")) {
+ $dir_array = get_priv_files("/usr/local/pkg/priv");
+ foreach ($dir_array as $file)
+ if (!is_dir("/usr/local/pkg/priv/{$file}") && stristr($file,".inc"))
+ include("/usr/local/pkg/priv/{$file}");
+}
+
+if(is_array($priv_list))
+ sort_privs($priv_list);
function cmp_privkeys($a, $b) {
/* user privs at the top */
diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php
index 42c56b1..d275010 100644
--- a/usr/local/www/widgets/widgets/system_information.widget.php
+++ b/usr/local/www/widgets/widgets/system_information.widget.php
@@ -31,8 +31,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-require_once("guiconfig.inc");
require_once("functions.inc");
+require_once("guiconfig.inc");
require_once('notices.inc');
if($_REQUEST['getupdatestatus']) {
OpenPOWER on IntegriCloud