fix to isstudent() for student view feature, see bug 4113
This commit is contained in:
+5
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user