mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #46611
[Bug 1749834] [NEW] Not showing username to users when "never display usernames" is set to no
Public bug reported:
Operating system: Linux
PHP: 7
Mahara: 17.04.2
Database: MySQL
Browser: Chrome
Site config setting in Question:
Changed "Never show usernames" to "no" for site config
Expectaiton:
Users can now see usernames for other users
Actual Result:
Username does not appear when searching for users to share a page with (It only appears to admins and staff)
The setting for this on the config page is that changing this setting does not affect admin and staff (which is true), however regardless of this setting - users cannot see a username appear in search areas when sharing portfolio items.
Possible Reason:
Searchlib.php Function search_user calls "display_name($result)" (located in lib/user.php)
User.php line 1125 - display_name takes 5 params - the last one of which
is $username which is set to false by default.
Lines 1134:
$nousernames = get_config('nousernames');
$userto = get_user_for_display($userto);
$user = get_user_for_display($user);
$addusername = ($username && empty($nousernames)) ||
!empty($userto->admin) || !empty($userto->staff);
As username is set to false when calling this function from a search,
the net result for normal users $addusername is always false.
Cheers
Kevin
** Affects: mahara
Importance: Undecided
Status: New
** Tags: search username
** Patch added: "user.php"
https://bugs.launchpad.net/bugs/1749834/+attachment/5056180/+files/user.php
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1749834
Title:
Not showing username to users when "never display usernames" is set to
no
Status in Mahara:
New
Bug description:
Operating system: Linux
PHP: 7
Mahara: 17.04.2
Database: MySQL
Browser: Chrome
Site config setting in Question:
Changed "Never show usernames" to "no" for site config
Expectaiton:
Users can now see usernames for other users
Actual Result:
Username does not appear when searching for users to share a page with (It only appears to admins and staff)
The setting for this on the config page is that changing this setting does not affect admin and staff (which is true), however regardless of this setting - users cannot see a username appear in search areas when sharing portfolio items.
Possible Reason:
Searchlib.php Function search_user calls "display_name($result)" (located in lib/user.php)
User.php line 1125 - display_name takes 5 params - the last one of
which is $username which is set to false by default.
Lines 1134:
$nousernames = get_config('nousernames');
$userto = get_user_for_display($userto);
$user = get_user_for_display($user);
$addusername = ($username && empty($nousernames)) ||
!empty($userto->admin) || !empty($userto->staff);
As username is set to false when calling this function from a search,
the net result for normal users $addusername is always false.
Cheers
Kevin
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1749834/+subscriptions
Follow ups
-
[Bug 1749834] Re: Not showing username to users when "never display usernames" is set to no
From: Cecilia Vela Gurovic, 2018-10-25
-
[Bug 1749834] Re: Not showing username to users when "never display usernames" is set to no
From: Cecilia Vela Gurovic, 2018-04-05
-
[Bug 1749834] Re: Not showing username to users when "never display usernames" is set to no
From: Robert Lyon, 2018-04-05
-
[Bug 1749834] A change has been merged
From: Mahara Bot, 2018-03-20
-
[Bug 1749834] A change has been merged
From: Mahara Bot, 2018-03-20
-
[Bug 1749834] Re: Not showing username to users when "never display usernames" is set to no
From: Robert Lyon, 2018-03-20
-
[Bug 1749834] A patch has been submitted for review
From: Mahara Bot, 2018-03-20
-
[Bug 1749834] A change has been merged
From: Mahara Bot, 2018-03-20
-
[Bug 1749834] A patch has been submitted for review
From: Mahara Bot, 2018-03-20
-
[Bug 1749834] A change has been merged
From: Mahara Bot, 2018-03-20
-
[Bug 1749834] Re: Not showing username to users when "never display usernames" is set to no
From: Robert Lyon, 2018-03-20
-
[Bug 1749834] Re: Not showing username to users when "never display usernames" is set to no
From: Kristina Hoeppner, 2018-03-20
-
[Bug 1749834] A patch has been submitted for review
From: Mahara Bot, 2018-03-19
-
[Bug 1749834] A patch has been submitted for review
From: Mahara Bot, 2018-03-19