Permalink
Browse files

MDL-26262 fix online users block error on non-course pages

  • Loading branch information...
skodak committed Feb 6, 2011
1 parent 54b7b59 commit 801dea060579108f15179d4f975bcc3b64f8a1b3
Showing with 1 addition and 1 deletion.
  1. +1 −1 blocks/online_users/block_online_users.php
@@ -54,7 +54,7 @@ function get_content() {
$userfields = user_picture::fields('u', array('username'));
- if ($this->page->course->id == SITEID) { // Site-level
+ if ($this->page->course->id == SITEID or $this->page->context->contextlevel < CONTEXT_COURSE) { // Site-level
$sql = "SELECT $userfields, MAX(u.lastaccess) AS lastaccess
FROM {user} u $groupmembers
WHERE u.lastaccess > $timefrom

0 comments on commit 801dea0

Please sign in to comment.