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:
moodler
2002-12-11 14:59:37 +00:00
parent cc2c8c6dc5
commit d7facad81e
5 changed files with 202 additions and 1 deletions
+8 -1
View File
@@ -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