Sometimes you really want to know if they are a teacher

This commit is contained in:
moodler
2003-10-28 14:44:39 +00:00
parent 57ef348040
commit 9788367bb9
+2 -2
View File
@@ -400,11 +400,11 @@ function isadmin($userid=0) {
}
}
function isteacher($courseid, $userid=0) {
function isteacher($courseid, $userid=0, $includeadmin=true) {
/// Is the user a teacher or admin?
global $USER;
if (isadmin($userid)) { // admins can do anything the teacher can
if ($includeadmin and isadmin($userid)) { // admins can do anything the teacher can
return true;
}