accesslib MDL-19730 fixing regression from MDL-19077 where has_capability fails when $USER->id=0 (so they couldn't see blocks etc)
This commit is contained in:
+1
-1
@@ -482,7 +482,7 @@ function has_capability($capability, $context, $userid=NULL, $doanything=true) {
|
||||
if (empty($userid)) { // we must accept null, 0, '0', '' etc. in $userid
|
||||
if (empty($USER->id)) {
|
||||
// Session not set up yet.
|
||||
return false;
|
||||
$userid = 0;
|
||||
}
|
||||
$userid = $USER->id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user