Loading...
 
Skip to main content

PATCH: wikiplugin_userlist.php handles privileges the opposite way

Status
Closed
Subject
PATCH: wikiplugin_userlist.php handles privileges the opposite way
Version
10.x
8.x
9.x
Category
  • Error
  • Less than 30-minutes fix
  • Patch
Feature
Wiki Plugin (extends basic syntax)
Resolution status
Fixed or Solved
Submitted by
josefg
Volunteered to solve
Pascal St-Jean
Lastmod by
josefg
Rating
(0)
Description

When using the UserList plugin, the links on the user names leading to their personal information pages, are shown and hidden depending on privileges of the logged in user. Unfortunately, the logic is reverse of what it should be.

Correct logic is: show links for all users that when either A.) You have admin privileges. B.) User listed is yourself. C.) User listed has chosen to make his profile information public.

Current logic is: show links when A.) You have admin privileges. B.) User listed is NOT yourself, AND user listed has chosen NOT to make his information public.

Solution

in the file /lib/wiki-plugins/wikiplugin_userlist.php, change the line 153 from:

wikiplugin_userlist.php line 153 (BUG)
Copy to clipboard
if ($user_information == 'private' && $row['login'] != $user) {


to

wikiplugin_userlist.php line 153 (FIX)
Copy to clipboard
if (!($user_information == 'private' && $row['login'] != $user)) {


and the trick should be done.


While you're at it, the sister file /lib/wiki-plugins/wikiplugin_realnamelist.php can be fixed as well.

Change line 153 from

wikiplugin_realnamelist.php line 153 (BUG)
Copy to clipboard
if (isset($user) && $user_information == 'private' && $row['login'] != $user) {


to

wikiplugin_realnamelist.php line 153 (FIX)
Copy to clipboard
if (isset($user) && ($user_information != 'private' || $row['login'] == $user)) {
Importance
5
Easy to solve?
10 easy
Priority
50
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
4190
Created
Tuesday 03 April, 2012 10:37:58 UTC
by josefg
LastModif
Friday 13 April, 2012 20:27:57 UTC


Show PHP error messages