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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user