fix has_capability() to work when $nomoodlecookie = true; MDL-7156 - needed for RSS file.php that is serving feeds; merged from MOODLE_17_STABLE

This commit is contained in:
skodak
2006-10-21 20:42:50 +00:00
parent e80ca6c658
commit 013f2e7cd9
+1 -1
View File
@@ -284,7 +284,7 @@ function has_capability($capability, $context=NULL, $userid=NULL, $doanything=tr
}
}
if ($userid && $userid != $USER->id) {
if ($userid && (($USER === NULL) or ($userid != $USER->id))) {
if (empty($USER->id) or ($userid != $USER->id)) {
$capabilities = load_user_capability($capability, $context, $userid);
} else { //$USER->id == $userid