Commit d8ad6950 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix PHP warning on admin user search page



When a user is an administrator in one institution, and staff in
another, and performs a search with no results, PHP gives an "Invalid
argument supplied for foreach()" warning.

Change-Id: I3706a639fb11e98cb64c8ef14aede371386e86b4
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 6763b52a
......@@ -358,7 +358,7 @@ function build_admin_user_search_results($search, $offset, $limit) {
unset($cols['select']);
}
}
else if (!$USER->get('admin')) {
else if (!$USER->get('admin') && $results['data']) {
foreach ($results['data'] as &$r) {
if (!isset($r['email'])) {
$r['email'] = '- ' . get_string('emailaddresshidden', 'admin') . ' -';
......
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