• Resolved eddypiv

    (@eddypiv)


    Hi,

    I am trying to figure out how to handle/act on a user that is set up for one subsite, and then moves to another (2nd) subsite.

    I ran a test and noticed that he is considered a logged-in user, but has no rights to access the user-restricted areas for that 2nd subsite.

    I am working with plugins that act on logged-in user functionality, and this gets fooled, i.e. the user – although not setup for the 2nd subsite – sees texts, widgets and menu options he is not entitled to.

    Is there a way to recognize this, and show a message that he needs to register for this subsite, or even better, that he gets redirected to the registration page?

    • This topic was modified 4 years, 9 months ago by eddypiv.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Justin Fletcher

    (@justinticktock)

    What is the default role that you have in your NSUR settings for the second sub-site ?
    By default this is ‘subscriber’ and it sounds like this is the case.

    When a ‘logged in user’ gets to another sub site on the network they are already know by the network and so automatically get added with the default role you have chosen. So if this is ‘subscriber’ then they will get dashboard only access to the second site when they travel to that site’s admin side. You can change the default role does that help?

    Thread Starter eddypiv

    (@eddypiv)

    No, not really.

    Point is, that the user may even not be aware that the website he is visiting is a subsite of the same multisite. And yet he is given (subscriber) access and treated by the website as logged-in user.

    And if he is aware that it is all part of the same multisite, he was not registered for that website and hence is there as guest visitor. But the system considers him not as guest but as logged in subscriber.

    Is there a way to recognize that the logged-in user has not been set up/registered for the website he is visiting? I want to show an invite to him to register for this website, so that he gets the correct access rights, or no rights at all, i.e. be treated as guest.

    Hope this clarifies.

    • This reply was modified 4 years, 9 months ago by eddypiv.
    Plugin Author Justin Fletcher

    (@justinticktock)

    the user may even not be aware that the website he is visiting is a subsite of the same multisite.

    yes I agree that is the case and can be confusing, the issue is that the Network already knows them and if they are logged in then they will not be asked to register. If they are not logged in on any other sub-site then they would need to register, since the Network won’t know that it has them on the user list until they login on a sub-site.

    And if he is aware that it is all part of the same multisite, he was not registered for that website and hence is there as guest visitor. But the system considers him not as guest but as logged in subscriber.

    I guess what NSUR is doing by default is saying that you have registration enabled for users so, if they are currently logged in, i’ll add them straight in without the need to register as I know who they are already. So in a way there is currently no choice with this but they miss the registration which could be confusing too.

    he gets the correct access rights

    what exactly would be examples of the correct access rights ?

    if you log out from all sub-sites and then travel to the new site do you get the experience you are looking for ?

    Thread Starter eddypiv

    (@eddypiv)

    Are you saying that somebody logged in for one subsite will have – once he visits another subsite for which he has not been set up – the standard role for that second subsite?

    That is not what I am seeing.

    The standard role on all my subsites is subscriber. (Actually, I have given the WP subscriber role the name GuestMember, while all users for a particular subsite have the role ActiveMember, which is a copy of the subscriber role.)

    I am using User Role Editor PRO for the conditional showing for legitimate users of menu options in front end and admin area and text blocks, and Custom Sidebars PRO for the conditional showing of widgets.

    In the mainmenu I have the option Log In, which is visible for “Not logged-in and logged-in users with Subscriber role”. Hence for the GuestMember role.
    But the Log In option is not shown for the “guestuser”.
    Also the widgets that are to be shown for the role GuestMember (i.e. subscriber) are not visible.

    So my question is still there: how to recognize a “guestuser/guestmember” so that he can be treated as any other visitor?

    Plugin Author Justin Fletcher

    (@justinticktock)

    Are you saying that somebody logged in for one subsite will have – once he visits another subsite for which he has not been set up – the standard role for that second subsite?

    Only if the user tries to go to an admin (restricted) page e.g the dashboard “WP-admin/…” if they stay on the front (public) side they won’t get added as a role on the new sub-site.

    I think what is happening for you is, that being part of the same network, they are actually logged in to the network and so all network site see them in this way (e.g logged in) the new Sub-site being part of that same network will be seeing this. One suggestion is that you Change the conditionals for visibility of items on your menus to something like “user has role xxx” or “user have capability you” rather than use the “user is logged in”

    Thread Starter eddypiv

    (@eddypiv)

    Hi Justin, thanks for your constructive feedback each time.

    I am concentrating on the front-end, and didn’t look much to the admin area. Looked now, and that is like you said, so admin area is covered.

    For the front-end: widgets, menu options and text blocks targeted based on user roles are working nicely.

    What I am still struggling with is when I want to show widgets, menu options and/or text blocks to visitors, where I consider a logged-in user without rights for a subsite as visitor, too.
    Not-logged in does not work, and there is no role assigned to the user.
    So how to recognize / handle this?

    Plugin Author Justin Fletcher

    (@justinticktock)

    you could use the opposite of the ‘read’ capability, e.g. show your widget when the user has no ‘read’ capability.

    The read capability comes with the basic Subscriber role and all roles (normally), it gives access to the backend admin side. So without ‘read’ ability you are either a visitor e.g Not logged in anywhere or a member of the network somewhere else as a logged user but with no ‘read’ cap on the current site.

    So can you do a condition “No read capability” ?

    Plugin Author Justin Fletcher

    (@justinticktock)

    It’s been 3 weeks now So I hope you got things working?
    I’m going close this ticket out.

    If you have more to ask then come back to me here.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘What happens when logging into a subsite where not registered?’ is closed to new replies.