Commit 1f944f45 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) fix some uninitialized vars in auth.inc

(cherry picked from commit 93e50c3f)
parent 43606d24
......@@ -286,16 +286,17 @@ function &getGroupEntryByGID($gid)
function get_user_privileges(&$user)
{
$privs = $user['priv'];
if (!is_array($privs)) {
$privs = array();
if (!isset($user['priv']) || !is_array($user['priv'])) {
$privs = array();
} else {
$privs = $user['priv'];
}
$names = local_user_get_groups($user, true);
foreach ($names as $name) {
$group = getGroupEntry($name);
if (is_array($group['priv'])) {
if (isset($group['priv']) && is_array($group['priv'])) {
$privs = array_merge($privs, $group['priv']);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment