From f760a27352b2846da176dbfcfbc56f27d097a4a6 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 8 Feb 2005 07:44:01 +0000 Subject: [PATCH] Don't show isteacher() notice to everyone --- lib/moodlelib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index c24cb3d2996..9b057d675b9 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -751,14 +751,16 @@ function isadmin($userid=0) { function isteacher($courseid=0, $userid=0, $includeadmin=true) { /// Is the user a teacher or admin? - global $USER; + 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); }