Commit ec13abf0 authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Use db prefix on online users page (bug #796424)"

parents 724a1eff ad461f06
......@@ -2284,15 +2284,15 @@ function get_onlineusers($limit=10, $offset=0, $orderby='firstname,lastname') {
case 0: // show none
return $result;
case 1: // show institution only
$sql = "SELECT * FROM usr JOIN usr_institution i ON id = i.usr
$sql = "SELECT * FROM {usr} JOIN {usr_institution} i ON id = i.usr
WHERE deleted = 0 AND lastaccess > ? AND i.institution IN (" . join(',',array_map('db_quote', array_keys($institutions))) . ")
ORDER BY $orderby";
$countsql = 'SELECT count(id) FROM usr JOIN usr_institution i ON id = i.usr
$countsql = 'SELECT count(id) FROM {usr} JOIN {usr_institution} i ON id = i.usr
WHERE deleted = 0 AND lastaccess > ? AND i.institution IN (' . join(',',array_map('db_quote', array_keys($institutions))) . ')';
break;
case 2: // show all
$sql = "SELECT * FROM usr WHERE deleted = 0 AND lastaccess > ? ORDER BY $orderby";
$countsql = 'SELECT count(id) FROM usr WHERE deleted = 0 AND lastaccess > ?';
$sql = "SELECT * FROM {usr} WHERE deleted = 0 AND lastaccess > ? ORDER BY $orderby";
$countsql = 'SELECT count(id) FROM {usr} WHERE deleted = 0 AND lastaccess > ?';
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