Forums | Mahara Community

Support /
How to allow group administrator to see username in the potential member list


na li's profile picture
Posts: 61

07 June 2017, 2:48 PM

Hi All,

I'm a big fan of Mahara. Our teachers and students love Mahara a lot.

I want to allow the group administrator to see users' username while selecting potential members to invite to the groups. I found that as the site admin, I can see users' information like Mike(mike01), in the brackets, that's the username. But for normal group admin, they cannot see the username. They can only see display name.

I have checked the site settings. The option "Users can hide real names " and "Never display usernames" are both disabled. Why the group admin still cannot see the username?

Could you please help to advise how can I set the settings to allow group admin to see the username?

Many thanks.

 

Best wishes,

Lina

Kristina Hoeppner's profile picture
Posts: 3590

08 June 2017, 4:54 PM

Hello Lina,

People with staff and admin permissions typically see the username. I suspect that your group admins are regular users. We don't display the username to regular users as that just makes the name display longer and is most of the time not needed.

Why do your group admins want to see the username rather than the proper name of a person? If your users use a display name and therefore make it harder to find their real name, maybe it were better if they weren't allowed to use a display name.

Would it also help to display a profile picture? Currently, the select box on the group member page is still in the old style. I could imagine that profile pictures could help differentiate between 5 different Mike's.

Cheers

Kristina

 

na li's profile picture
Posts: 61

08 June 2017, 6:12 PM

Hi Kristina,

Many thanks for your reply.

Yes, the group admin is regular user. Because the Chinese students always have same real names, the group admin cannot identify and select the right user just by their display name or real name. And we've integrated Mahara with LDAP, so the display name is actually the real name and they are not allowed to change the display name.

I think the profile picture will be helpful, but if a user didn't upload a profile picture, or they've uploaded a cat or a dog's picture, then the group admin can still not identify who is the right one.

If we could have regular users be able to see the username, it will be great.

Many thanks.

Cheers,

Lina

Kristina Hoeppner's profile picture
Posts: 3590

09 June 2017, 8:21 AM

Hello Lina,

Thank you for your explanation. You could change the display of the name either everywhere on Mahara or just for that one page in the group or groups in general by adjusting the code to display the username. There is a function that handles who can see usernames (staff and institution / site admins). If you modify that you should be able to reach your goal.

Cheers

Kristina

 

na li's profile picture
Posts: 61

12 June 2017, 2:28 PM

Hello Kristina,

Many thanks for your suggestions. I've checked your solutions:

1. Change the display name: we have locked all the users' display name, because we use LDAP integration and the display name will be automatically synchronize from LDAP to Mahara. To keep the continuance of data, we have locked this field and users cannot change.

2. Change the code of the group page: there are other situations that normal users want to search other users, not only the group members.

3. The function which can handle who can see usernames: I found a setting in "Administration->Configure site->Site options->User settings->Never display usernames", as the below screenshot shows, this option is currently off, I have tried both "YES" and "NO" options, but seems no effect to either admin or normal users. I'm wondering if this setting is not working or did I miss any other steps in order to make this setting work?

We are currently using Mahara 16.10.1 and plan to upgrade to the latest version next month.

Screen Shot 2017-06-12 at 10.23.46 AM.png

Thanks again for your help.

Best wishes,

Lina

Kristina Hoeppner's profile picture
Posts: 3590

13 June 2017, 11:07 AM

Hello Lina,

It would be a change in the Mahara codebase if you want to display usernames to everyone and not just staff and admins.

Cheers

Kristina

 

na li's profile picture
Posts: 61

13 June 2017, 2:12 PM

Hello Kristina,

Thank you very much. Could you please advice which code file I'll need to change in order to enable normal users to see username?

I really appreciate your great help.

Cheers,

Lina

Cecilia Vela's profile picture
Posts: 51

15 June 2017, 9:29 AM

Hello Lina,

The function that decides how to show the the name of the user is display_name() in file lib/user.php

This method has 5 parameters and we use the last one to indicate if we want to show the username or not:
    function display_name($user, $userto=null, $nameonly=false, $realname=false, $username=false) {

So, for example, to add username next to the display name in the group member search:

The function that manages the group member search is
    get_group_user_search_results in lib/searchlib.php

to decide how it is going to show the name of the user it makes a call to  
    display_name($result); //Line 960

if we change this call to
    display_name($result,null,false,false,true);

if the last parameters is true, then all the search results will show the username next to the display name.

 

Cheers,

Cecilia

na li's profile picture
Posts: 61

15 June 2017, 6:06 PM

Hello Cecilia,

Many thanks for this detail information. I found the function in the lib/user.php and I have changed the parameter in lib/searchlib.php, as the below screenshot shows, but it still doesn't show the username, I have cleared the server cache:

Screen Shot 2017-06-15 at 1.46.31 PM.png

Screen Shot 2017-06-15 at 1.46.18 PM.png

Screen Shot 2017-06-15 at 1.45.59 PM.png

Thanks again for your kind help. I really appreciate it. I feel strange, why the change of the code doesn't take effect.

Best wishes,

Lina

Cecilia Vela's profile picture
Posts: 51

19 June 2017, 9:33 AM

Hi Lina,

just to rule this out, have you check that 'Never display usernames' is set to No under Administation/User settings?

Cheers,

Cecilia

13 results