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:
moodler 2009-07-07 07:06:19 +00:00
parent 19c9f09430
commit 024f3f9749

View File

@ -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;
}