From: moodler Date: Mon, 7 Apr 2003 15:30:34 +0000 (+0000) Subject: Use the cached admin bit if it's there! X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=aa6fbca550cc11c8fec3a5e04e9665412ee870d7;p=moodle.git Use the cached admin bit if it's there! (saves one database access per editable activity on the course page!) :-/ --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 10fd5845fa..b9801eea69 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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); }