Skip to content
Permalink
Browse files

Merged isteacher fix from stable

  • Loading branch information...
moodler
moodler committed Feb 8, 2005
1 parent 3dcdf94 commit fb830a1b60b7becd91d6fce8b7e5d471239df601
Showing with 6 additions and 3 deletions.
  1. +6 −3 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);
}

0 comments on commit fb830a1

Please sign in to comment.
You can’t perform that action at this time.