1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Stopping guests from viewing the members list

Discussion in 'XenForo Questions and Support' started by discoian, Aug 11, 2011.

  1. discoian

    discoian Active Member

    Is there any way of stopping this?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Wrap the page in a guest conditional.

    Open the member_list template.

    Look for this line near the top:
    Code:
    <xen:h1>{xen:phrase registered_members}</xen:h1>
    Directly after add this:
    Code:
    <xen:if is="{$visitor.user_id}">
    So it looks like this:
    Code:
    <xen:h1>{xen:phrase registered_members}</xen:h1>
    <xen:if is="{$visitor.user_id}">
    Then right at the bottom of the same template, look for:
    Code:
    </xen:sidebar>
    Directly after add this:
    Code:
    <xen:else />This content is visible to members only</xen:if>
    So it looks like this:
    Code:
    </xen:sidebar>
    <xen:else />This content is visible to members only</xen:if>
    You can obviously change the text to whatever you wish, or even insert a template there, etc.
     
  3. discoian

    discoian Active Member

    Thanks for this, I think I need to look at our config really, it's fairly unique and I don't think this would solve our problem.

    All of our members are in the "guest" group as their primary group and then have an additional group when they pay, wrapping the list template in a conditional would stop everyone from viewing the list who is in the "guest" group, which is everyone.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Guests are unregistered members.

    So as long as your members have confirmed their accounts then they are no longer classed as guests.
     
  5. discoian

    discoian Active Member

    What do you mean "confirmed" their accounts? If they have "Guest" as their primary group and "Member" as their secondary group then I understand that their permission set inherits the better permissions from the "member" group but if I used your conditional example above would that stop ANYONE who is in the Guest group from seeing the list? Would anyone with an additional group (with better permissions) be allowed to see that list?
     
  6. James

    James Well-Known Member

    XenForo doesn't have a usergroup named Guest, so which user group are you referring to?

    When a user is registered, their primary usergroup is Registered (user group ID 2).
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    You're doing it all wrong.

    Read the manual as to how to set up user groups: http://xenforo.com/help/user-groups/

    Specifically: "It is recommended however that all users have the Registered user group set as their primary user group and any additional groups they are members of are set as secondary groups. This makes it easy to manage permissions due to the cumulative nature in which they are applied."
     

Share This Page