From aa6fbca550cc11c8fec3a5e04e9665412ee870d7 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 7 Apr 2003 15:30:34 +0000 Subject: [PATCH] Use the cached admin bit if it's there! (saves one database access per editable activity on the course page!) :-/ --- lib/moodlelib.php | 3 +++ 1 file changed, 3 insertions(+) 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); } -- 2.39.5