diff options
Diffstat (limited to 'etc/inc/priv.inc')
-rw-r--r-- | etc/inc/priv.inc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/etc/inc/priv.inc b/etc/inc/priv.inc index a15254d..45dcc3b 100644 --- a/etc/inc/priv.inc +++ b/etc/inc/priv.inc @@ -76,14 +76,14 @@ function get_priv_files($directory) { // Load and sort privs $dir_array = get_priv_files("/etc/inc/priv"); foreach ($dir_array as $file) { - if (!is_dir("/etc/inc/priv/{$file}") && stristr($file,".inc")) { + 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")) { + if (!is_dir("/usr/local/pkg/priv/{$file}") && stristr($file, ".inc")) { include("/usr/local/pkg/priv/{$file}"); } } @@ -128,12 +128,12 @@ function cmp_page_matches($page, & $matches, $fullwc = true) { foreach ($matches as $match) { /* possibly ignore full wildcard match */ - if (!$fullwc && !strcmp($match ,"*")) { + if (!$fullwc && !strcmp($match , "*")) { continue; } /* compare exact or wildcard match */ - $match = str_replace(array(".", "*","?"), array("\.", ".*","\?"), $match); + $match = str_replace(array(".", "*", "?"), array("\.", ".*", "\?"), $match); $result = preg_match("@^/{$match}$@", "/{$page}"); if ($result) { @@ -152,7 +152,7 @@ function map_page_privname($page) { continue; } $fullwc = false; - if (!strcasecmp($page,"any")||!strcmp($page,"*")) { + if (!strcasecmp($page, "any")||!strcmp($page, "*")) { $fullwc = true; } if (cmp_page_matches($page, $pdata['match'], $fullwc)) { @@ -182,7 +182,7 @@ function get_user_privdesc(& $user) { continue; } foreach ($group_privs as $pname) { - if (in_array($pname,$user_privs)) { + if (in_array($pname, $user_privs)) { continue; } if (!$priv_list[$pname]) { @@ -214,7 +214,7 @@ function isAllowed($username, $page) { $user = getUserEntry($username); if (isset($user)) { if (isset($user['uid'])) { - if ($user['uid']==0) { + if ($user['uid'] == 0) { return true; } } @@ -243,7 +243,7 @@ function isAllowedPage($page) { $user = getUserEntry($username); if (isset($user)) { if (isset($user['uid'])) { - if ($user['uid']==0) { + if ($user['uid'] == 0) { return true; } } |