Not showing username to users when "never display usernames" is set to no

Bug #1749834 reported by Kevin Dibble
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Cecilia Vela Gurovic
17.04
Fix Released
High
Unassigned
17.10
Fix Released
High
Unassigned
18.04
Fix Released
High
Cecilia Vela Gurovic
18.10
Fix Released
High
Cecilia Vela Gurovic

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

Revision history for this message
Kevin Dibble (digitalskill) wrote :
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "17.04_STABLE" branch: https://reviews.mahara.org/8660

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch: https://reviews.mahara.org/8662

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8662
Committed: https://git.mahara.org/mahara/mahara/commit/02cbb9ed2d953365ee39d0fb265bb0ccb19f44e0
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 02cbb9ed2d953365ee39d0fb265bb0ccb19f44e0
Author: Robert Lyon <email address hidden>
Date: Mon Mar 19 16:38:56 2018 +1300

Bug 1749834: Users can now see usernames for other users in share page

behatnotneeded

Change-Id: I1eacae46787c2353f27664ed2788a9ac8fe97ddc

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "18.04_STABLE" branch: https://reviews.mahara.org/8674

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8674
Committed: https://git.mahara.org/mahara/mahara/commit/1bbff55952a932935520377e2950a56c2e94267d
Submitter: Robert Lyon (<email address hidden>)
Branch: 18.04_STABLE

commit 1bbff55952a932935520377e2950a56c2e94267d
Author: Robert Lyon <email address hidden>
Date: Mon Mar 19 16:38:56 2018 +1300

Bug 1749834: Users can now see usernames for other users in share page

behatnotneeded

Change-Id: I1eacae46787c2353f27664ed2788a9ac8fe97ddc
(cherry picked from commit 02cbb9ed2d953365ee39d0fb265bb0ccb19f44e0)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "17.10_STABLE" branch: https://reviews.mahara.org/8675

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8675
Committed: https://git.mahara.org/mahara/mahara/commit/05ba4eb93a553bd6611664191f7eb261946388ed
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.10_STABLE

commit 05ba4eb93a553bd6611664191f7eb261946388ed
Author: Robert Lyon <email address hidden>
Date: Mon Mar 19 16:38:56 2018 +1300

Bug 1749834: Users can now see usernames for other users in share page

behatnotneeded

Change-Id: I1eacae46787c2353f27664ed2788a9ac8fe97ddc
(cherry picked from commit 02cbb9ed2d953365ee39d0fb265bb0ccb19f44e0)
(cherry picked from commit 1bbff55952a932935520377e2950a56c2e94267d)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/8660
Committed: https://git.mahara.org/mahara/mahara/commit/6c08a5b7b2a7e55ad73caccb885d9495772800fa
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.04_STABLE

commit 6c08a5b7b2a7e55ad73caccb885d9495772800fa
Author: Alexander Del Ponte <email address hidden>
Date: Mon Mar 19 16:38:56 2018 +1300

Bug 1749834: Users can now see usernames for other users in share page

behatnotneeded

Change-Id: I1eacae46787c2353f27664ed2788a9ac8fe97ddc

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.