fix to isstudent() for student view feature, see bug 4113

This commit is contained in:
gustav_delius
2005-09-25 21:44:09 +00:00
parent b1c9e0998a
commit 1c349f7fa2
+5 -1
View File
@@ -2189,7 +2189,11 @@ function isstudent($courseid, $userid=0) {
}
if (!$userid) {
return (!empty($USER->student[$courseid]) and empty($USER->studentview));
if (empty($USER->studentview)) {
return (!empty($USER->student[$courseid]));
} else {
return(!empty($USER->teacher[$courseid]) or isadmin());
}
}
// $timenow = time(); // todo: add time check below