Commit 141e3ecb authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix online users sideblock to work with db prefix (bug #796424)



Change-Id: I0aadf9e62816ea3d9df81d3e6262d5ca515c1263
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent d99780a8
......@@ -2319,12 +2319,12 @@ function onlineusers_sideblock() {
'lastminutes' => floor(get_config('accessidletimeout') / 60),
);
case 1: // show institution only
$sql = 'SELECT u.* FROM usr u JOIN usr_institution i ON u.id = i.usr
$sql = 'SELECT u.* FROM {usr} u JOIN {usr_institution} i ON u.id = i.usr
WHERE i.institution IN ('.join(',', array_map('db_quote', array_keys($institutions))).')
AND lastaccess > ? AND deleted = 0 ORDER BY lastaccess DESC';
break;
case 2: // show all
$sql = 'SELECT * FROM usr WHERE lastaccess > ? AND deleted = 0 ORDER BY lastaccess DESC';
$sql = 'SELECT * FROM {usr} WHERE lastaccess > ? AND deleted = 0 ORDER BY lastaccess DESC';
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment