Use the cached admin bit if it's there!

(saves one database access per editable activity on the course page!)  :-/
This commit is contained in:
moodler
2003-04-07 15:30:34 +00:00
parent 8daaf761c3
commit aa6fbca550
+3
View 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);
}