]> git.mjollnir.org Git - moodle.git/commitdiff
accesslib MDL-19730 fixing regression from MDL-19077 where has_capability fails when...
authormoodler <moodler>
Tue, 7 Jul 2009 07:06:19 +0000 (07:06 +0000)
committermoodler <moodler>
Tue, 7 Jul 2009 07:06:19 +0000 (07:06 +0000)
lib/accesslib.php

index c4296104d4295e2d772d48d57ef4fe8717b3e131..900148dfe1d0dfc2e4821e7a28ab972224ddf473 100755 (executable)
@@ -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;
     }