forked from science-ation/science-ation
Fix updateSessionRoles once and for all
This commit is contained in:
parent
759ecc0a1a
commit
ab068fdfbb
12
user.inc.php
12
user.inc.php
@ -906,14 +906,16 @@ function try_login($user, $pass)
|
|||||||
/* Login successful */
|
/* Login successful */
|
||||||
return $r['id'];
|
return $r['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSessionRoles($u=null) {
|
function updateSessionRoles($u=null) {
|
||||||
if(!$u)
|
if(!$u)
|
||||||
$u=user_load($_SESSION['user_id']);
|
$u=user_load($_SESSION['users_id']);
|
||||||
|
|
||||||
$_SESSION['roles']=array();
|
$_SESSION['roles']=array();
|
||||||
foreach($u['roles'] AS $r=>$rd) {
|
if($u && is_array($u['roles'])) {
|
||||||
if($rd['active']=="yes")
|
foreach($u['roles'] AS $r=>$rd) {
|
||||||
$_SESSION['roles'][]=$r;
|
if($rd['active']=="yes")
|
||||||
|
$_SESSION['roles'][]=$r;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user