Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Role List Fix

2»

Comments

  • Noticed that I'm getting the following errors in my error_log, any idea as to why?

    [22-Jun-2008 22:01:46] PHP Notice: Undefined offset: 0 in /home/XXXX/public_html/live/public/forums/extensions/RoleListFix/default.php on line 49
    [22-Jun-2008 22:01:46] PHP Notice: Undefined index: Account Options in /home/XXXX/public_html/live/public/forums/extensions/RoleListFix/default.php on line 52
    [22-Jun-2008 22:01:46] PHP Warning: Invalid argument supplied for foreach() in /home/XXXX/public_html/live/public/forums/extensions/RoleListFix/default.php on line 53
  • I'm seeing this:

    Notice: Undefined offset: 0 in /srv/www/vhosts/myhost.com/httpdocs/forum/extensions/RoleListFix/default.php on line 49

    on a applicant's profile page.
  • I'm getting the same errors as sherem and dkodr. It happens when I look at a user's account when not logged in (i.e. as a guest). I tried adding a bailout to line 49, adding '$Context->Session->User->Name == Guest' to the list of conditions but this didn't work. Obviously, a guest shouldn't see the role list so a simple exit should suffice but I don't know how to test whether a user is a guest or not. Thanks
  • Oh hang on, just figured it out. "Guest" is the user name displayed when the user doesn't have a name. Thus testing for "Guest" is daft, whereas testing for a name fixes it. Thus my line 49 now reads:

    if(!$AccountUser || !$Context->Session->User->Name || $rid == $FRL_AdminID || $FRL_Priorities[$rid] > $FRL_Priorities[$AccountUser -> RoleID]) return;

    and that seems to do the trick.
  • userID for guest users is 0, I think it's the most widespread comparison for that purpose throughout the Vanilla codebase
This discussion has been closed.