]> git.mjollnir.org Git - moodle.git/commitdiff
Use the cached admin bit if it's there!
authormoodler <moodler>
Mon, 7 Apr 2003 15:30:34 +0000 (15:30 +0000)
committermoodler <moodler>
Mon, 7 Apr 2003 15:30:34 +0000 (15:30 +0000)
(saves one database access per editable activity on the course page!)  :-/

lib/moodlelib.php

index 10fd5845fa0cbca4a21fcc2feae4ffeee34c5ee8..b9801eea69c9bc2a772beb8d0aebd66b90a50619 100644 (file)
@@ -376,6 +376,9 @@ function isadmin($userid=0) {
     }
 
     if (empty($userid)) {
+        if (!empty($USER->admin)) {
+            return true;
+        }
         return record_exists("user_admins", "userid", $USER->id);
     }