Permalink
Browse files

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

  • Loading branch information...
1 parent b1c9e09 commit 1c349f7fa2fd9e0b20f366c9e1be0decc92d1893 gustav_delius committed Sep 25, 2005
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/moodlelib.php
View
@@ -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

0 comments on commit 1c349f7

Please sign in to comment.