Comment 11 for bug 1353516

Aaron Wells (u-aaronw) wrote :

Hi Tony,

Looking at the git history, it appears the $username parameter of display_username() was added back in 2010 in order to support the $cfg->searchusernames option, i.e. Administration -> Site options -> User settings -> Search usernames. This option is on by default, and its help text: "If checked, allow usernames to be search on as part of 'Search users'."

I think we could use some consistency in our approach, though. As it currently stands, usernames are... semi-private.

- Admins & staff can always see usernames
- Users can see their own username, on their account settings page
- The username is displayed on the user search page, if you don't disable "Search usernames"
- If you have clean URLs turned on, the username is a default part of a user's cleanurl.

If we're adding a sitewide option to hide usernames (and apparently there is a use-case for it), then we should just eliminate "Search usernames" as a separate option. Instead, we say that if usernames are hidden, you can't search by them. Also if usernames are hidden, we should use a different method to the default Clean URL. Maybe by passing the user's name (or preferred name) through the url generator, instead of their username.