Don't show isteacher() notice to everyone

This commit is contained in:
moodler
2005-02-08 07:44:01 +00:00
parent c7a3002e4e
commit f760a27352
+4 -2
View File
@@ -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);
}