Commit 8f4060da authored by Richard Mansfield's avatar Richard Mansfield

Show usernames in search results when searchusernames is enabled

Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 0cdaaa1d
......@@ -1311,11 +1311,12 @@ function get_users_data($userlist, $getviews=true) {
$userid = $USER->get('id');
$data = get_records_sql_assoc($sql, array($userid, $userid, $userid, $userid));
$allowhidename = get_config('userscanhiderealnames');
$showusername = get_config('searchusernames');
foreach ($data as &$record) {
$record->messages = ($record->messages == 'allow' || $record->friend && $record->messages == 'friends' || $USER->get('admin')) ? 1 : 0;
$record->institutions = get_institution_string_for_user($record->id);
$record->display_name = display_name($record, null, false, !$allowhidename || !$record->hidenamepref);
$record->display_name = display_name($record, null, false, !$allowhidename || !$record->hidenamepref, $showusername);
}
if (!$data || !$getviews || !$views = get_views(array_keys($data), null, null)) {
......
......@@ -50,9 +50,7 @@
<div class="rightdiv">
<h3>
<a href="{$WWWROOT}user/view.php?id={$user->id}">
{$user->display_name}
</a>
<a href="{$WWWROOT}user/view.php?id={$user->id}">{$user->display_name}</a>
{if $user->pending}- {str tag='pending' section='group'}
{elseif $user->friend && $page == 'find'}- {str tag='existingfriend' section='group'}
{/if}
......
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