Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-4130 now.

viewprofile links : get_username_string function (fix completed in vcs)

For bots or users who don’t have permission to view profiles, it doesn’t make much sense to allow the links to exist to go to the viewprofile pages.
But also, it is possible to give Guests permission to view profiles, but in reality that’s impossible since it’s restricted from Guests hardcoded into the function.
This would be my suggestion: (in get_username_string() function)
Code: Select all
if ($user_id && $auth->acl_get('u_viewprofile')) // globalize $auth
    
{
        

    
}
    else

Or at least...
Code: Select all
if ($user_id && $user_id != ANONYMOUS && !$user->data['is_bot'])
    {
        

    
}
    else

So the links won’t show unnecessarily for spiders and bots.

Comments / History

Posted by A_Jelly_Doughnut (Former Team Member) on May 6th 2007, 10:21

Um...Not really sure what you're getting at HoL.

The code in get_username_string() checks if the poster (or other use of get_username_string()) is a guest, not if the user trying to view the topic is a guest. Note the user of $user_id instead of $user->data['user_id']

Posted by Highway of Life (QA Team) on May 6th 2007, 12:35

You are right... never report bugs late at night. ;)

Anyways, the original point of the bug report is the fact that it’s useless to have links to member’s profiles if the user viewing does not have permission to see it... thus the $auth->acl_get('u_viewprofile').
The same goes for bots... they don’t have permission (by default) to the memberlist/profiles, so having hundreds of links all over the board going there does not make sense... to the bot they are dead.
The alternative was to change it in the templates
Code: Select all
<!-- IF S_IS_BOT -->{topicrow.POST_AUTHOR_FULL}<!-- ELSE -->{topicrow.POST_AUTHOR}<!-- ENDIF -->
which doesn’t make much sense.
So in that case, it would be:
Code: Select all
if ($user_id && $user_id != ANONYMOUS && $auth->acl_get('u_viewprofile'))
    {
        

    
}
    else

Changed ticket status from "New" to "Fix in progress"

Action performed by Acyd Burn (Server Manager) on May 6th 2007, 14:21

Assigned ticket to user "Acyd Burn"

Action performed by Acyd Burn (Server Manager) on May 6th 2007, 14:22

Linked ticket with changeset: r7485

Action performed by Anonymous (I am too lazy to register) on May 6th 2007, 15:31

Changed ticket status from "Fix in progress" to "Fix completed in CVS"

Action performed by Acyd Burn (Server Manager) on May 6th 2007, 18:09

Ticket details

Related SVN changesets