From fb830a1b60b7becd91d6fce8b7e5d471239df601 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 8 Feb 2005 07:45:53 +0000 Subject: [PATCH] Merged isteacher fix from stable --- lib/moodlelib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 5520e23615..56ba4ef3f9 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1379,15 +1379,18 @@ function isadmin($userid=0) { * @return boolean * @todo Finish documenting this function */ -function isteacher($courseid, $userid=0, $includeadmin=true) { - global $USER; +function isteacher($courseid=0, $userid=0, $includeadmin=true) { +/// Is the user a teacher or admin? + global $USER, $CFG; if ($includeadmin and isadmin($userid)) { // admins can do anything the teacher can return true; } if (empty($courseid)) { - notify('isteacher() should not be used without a valid course id as argument'); + if (isadmin() or $CFG->debug > 7) { + notify('Coding error: isteacher() should not be used without a valid course id as argument. Please notify a developer.'); + } return isteacherinanycourse($userid, $includeadmin); } -- 2.39.5