Commit e1dcf029 authored by Penny Leach's avatar Penny Leach
Browse files

fixed missing db prefixes in suspended users

parent fdf244da
......@@ -39,12 +39,12 @@ $dbprefix = get_config('dbprefix');
// NOTE: the check is not done on the 'active' column here, since suspended
// users are by definition not active. However deleted users are filtered out.
$count = get_field_sql('SELECT COUNT(*) FROM usr WHERE suspendedcusr IS NOT NULL AND deleted = 0');
$count = get_field_sql('SELECT COUNT(*) FROM ' . $dbprefix . 'usr WHERE suspendedcusr IS NOT NULL AND deleted = 0');
$data = get_records_sql_array('SELECT u.id, u.firstname, u.lastname, u.studentid, u.suspendedreason AS reason,
i.displayname AS institution, ua.firstname AS cusrfirstname, ua.lastname AS cusrlastname
FROM ' . $dbprefix . 'usr u
LEFT JOIN ' . $dbprefix . 'institution i ON (u.institution = i.name)
LEFT JOIN usr ua on (ua.id = u.suspendedcusr)
LEFT JOIN ' . $dbprefix . 'usr ua on (ua.id = u.suspendedcusr)
WHERE u.suspendedcusr IS NOT NULL
AND u.deleted = 0
ORDER BY u.suspendedctime
......
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