From: martin Date: Wed, 3 Apr 2002 06:30:09 +0000 (+0000) Subject: Add check for admin to isteacher() rather than doing checks everywhere else X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d115a57f128262a649d924b9118ea8e40b3c2e7c;p=moodle.git Add check for admin to isteacher() rather than doing checks everywhere else --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 19ec0442f8..729ba863b1 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -713,6 +713,10 @@ function isadmin($userid=0) { function isteacher($course, $userid=0) { global $USER; + if (isadmin($userid)) { // admins can do anything the teacher can + return true; + } + if (!$userid) { return $USER->teacher[$course]; } @@ -746,7 +750,7 @@ function set_moodle_cookie($thing) { $days = 60; $seconds = 60*60*24*$days; - setCookie ('MOODLEID'); + setCookie ('MOODLEID', "", time() - 3600, "/"); setCookie ('MOODLEID', rc4encrypt($thing), time()+$seconds, "/"); }