Commit 128796cb authored by Nigel McNie's avatar Nigel McNie
Browse files

Make institutional admin search work in MySQL. Thanks to report from 'sysadmin'.

parent fd9b74d4
......@@ -419,16 +419,6 @@ class PluginSearchInternal extends PluginSearch {
public static function institutional_admin_search_user($query, $institution, $limit) {
if (is_postgres()) {
return self::institutional_admin_search_user_pg($query, $institution, $limit);
}
else {
throw new SQLException('institutional_admin_search_user() is not implemented for your database engine (' . get_config('dbtype') . ')');
}
}
public static function institutional_admin_search_user_pg($query, $institution, $limit) {
$sql = '
FROM {usr} u ';
......@@ -438,8 +428,8 @@ class PluginSearchInternal extends PluginSearch {
$values = array();
if (!empty($query)) {
$where .= '
AND (u.firstname ILIKE \'%\' || ? || \'%\'
OR u.lastname ILIKE \'%\' || ? || \'%\') ';
AND (u.firstname ' . db_ilike() . ' \'%\' || ? || \'%\'
OR u.lastname ' . db_ilike() . ' \'%\' || ? || \'%\') ';
$values = array($query,$query);
}
......
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