Skip to content
Browse files

Don't show isteacher() notice to everyone

  • Loading branch information...
1 parent c7a3002 commit f760a27352b2846da176dbfcfbc56f27d097a4a6 moodler committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/moodlelib.php
View
6 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);
}

0 comments on commit f760a27

Please sign in to comment.
Something went wrong with that request. Please try again.