Skip to content
Browse files

Fix for Bug #5057 - hidden teachers aren't completely hidden

  • Loading branch information...
1 parent e761ca0 commit b839781a953f8b6374c8560802a3cc9cef2895a7 vyshane committed Apr 10, 2006
Showing with 11 additions and 4 deletions.
  1. +11 −4 blocks/online_users/block_online_users.php
View
15 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 b839781

Please sign in to comment.
Something went wrong with that request. Please try again.