Permalink
Browse files

Fixed Bug #5057 - hidden teachers aren't completely hidden

  • Loading branch information...
vyshane
vyshane committed Apr 10, 2006
1 parent b525bd2 commit 3f763c86cf44f301bc4cb28c5eb53b2759fba47c
Showing with 11 additions and 4 deletions.
  1. +11 −4 blocks/online_users/block_online_users.php
@@ -82,14 +82,21 @@ function get_content() {
}
}
- if ($teachers = get_records_sql("SELECT u.id, u.username, u.firstname, u.lastname, u.picture, u.lastaccess, s.timeaccess
+ $findteacherssql = "SELECT u.id, u.username, u.firstname, u.lastname, u.picture, u.lastaccess, s.timeaccess
FROM {$CFG->prefix}user u,
{$CFG->prefix}user_teachers s
$groupmembers
- WHERE u.id = s.userid $courseselect $groupselect $timeselect
- ORDER BY s.timeaccess DESC")) {
+ WHERE u.id = s.userid $courseselect $groupselect $timeselect ";
+
+ if (!isteacher($course->id)) {
+ // Hide hidden teachers from students.
+ $findteacherssql .= 'AND s.authority > 0 ';
+ }
+ $findteacherssql .= 'ORDER BY s.timeaccess DESC';
+
+ if ($teachers = get_records_sql($findteacherssql)) {
foreach ($teachers as $teacher) {
- $teacher->fullname = '<b>'.fullname($teacher).'</b>';
+ $teacher->fullname = '<strong>'.fullname($teacher).'</strong>';
$users[$teacher->id] = $teacher;
}
}

0 comments on commit 3f763c8

Please sign in to comment.