userlink does not return a link for the current user if user information pref != 'Public'
- Status
- Closed
- Subject
- userlink does not return a link for the current user if user information pref != 'Public'
- Version
- 10.x
6.x
7.x
8.x
9.x - Category
- Error
- Less than 30-minutes fix
- Feature
- Templates (Smarty)
- Submitted by
- DavidBright
- Volunteered to solve
- DavidBright
- Lastmod by
- DavidBright
- Rating
- Description
- The smarty function that generates a user link (lib/smarty_tiki/modifier.userlink.php) will only return an actual link if the user's user_information preference is set to 'public'. In the case where the user link is to the currently logged-in user, however, there is no reason not to display the link even if that preference is set to 'private' as the user should be able to view their own preferences. This is easy to demonstrate; set your user_information preference to private and then look at your name in login module. The name will not be a link to your user preferences.
- Solution
The fix is also easy. In lib/smarty_tiki/modifier.userlink.php, line 88 in the current trunk, this line:
Copy to clipboardif ($userlib->user_exists($other_user)&&(!empty($friend) || $tikilib->get_user_preference($other_user, 'user_information', 'public')=='public')) {
should be modified to:Copy to clipboardif ($userlib->user_exists($other_user)&&(!empty($friend) || $tikilib->get_user_preference($other_user, 'user_information', 'public')=='public' || $user == $other_user)) {
Fixed in r45676 (trunk only)- Importance
- 6
- Easy to solve?
- 9
- Priority
- 54
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 4440
- Created
- Monday 22 April, 2013 14:41:04 UTC
by DavidBright - LastModif
- Monday 22 April, 2013 17:49:58 UTC