Modifications from Greg Barnett at Crown College to add more admins.
See http://bugs.moodle.org/bug.php?op=show&bugid=202
This commit is contained in:
+8
-1
@@ -1339,7 +1339,7 @@ function isadmin($userid=0) {
|
||||
global $USER;
|
||||
|
||||
if (!$userid) {
|
||||
return $USER->admin;
|
||||
return record_exists_sql("SELECT * FROM user_admins WHERE user='{$USER->id}'");
|
||||
}
|
||||
|
||||
return record_exists_sql("SELECT * FROM user_admins WHERE user='$userid'");
|
||||
@@ -1519,6 +1519,13 @@ function get_admin () {
|
||||
}
|
||||
}
|
||||
|
||||
function get_admins() {
|
||||
return get_records_sql("SELECT u.* FROM user u, user_admins a
|
||||
WHERE a.user = u.id
|
||||
ORDER BY u.id ASC");
|
||||
}
|
||||
|
||||
|
||||
function get_teacher($courseid) {
|
||||
// Returns $user object of the main teacher for a course
|
||||
if ( $teachers = get_records_sql("SELECT u.* FROM user u, user_teachers t
|
||||
|
||||
Reference in New Issue
Block a user