From: moodler Date: Tue, 28 Oct 2003 14:44:39 +0000 (+0000) Subject: Sometimes you really want to know if they are a teacher X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9788367bb9dae253d7761c7eb892ab955f47e95d;p=moodle.git Sometimes you really want to know if they are a teacher --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index fd37fb402d..ad6abe38a4 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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; }