Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Sader

    (@dsader)

    “if I go to the root site it shows me logged in in the site that the user belongs”

    You lost me here. I don’t understand what you need prevented. I’ll try. A user should see all visible sites in the network and those sites that they are members.

    A user only needs to login once onto the network, then they can see their own site and the root site will show them as logged in. That is how it is with WordPress. A user is “logged in” to every site in the network at the same time. The More Privacy Options plugin only changes the visibility, users remain logged in.

    If Suzy is a member of her own site, she should see her own site when logged in and any other “visible” sites. If Suzy is also a member of John’s site, then she should have access to both. If Suzy is not a member of John’s site, then she will not be able to see the front end of it and get a “Members Only” message if she visits it. But she remains logged in the network.

    Thread Starter nikolov.inn

    (@nikolovinn)

    On the root site (visible to all) I have two links to the other two subsites, which are visible only to it members.

    What I need is the following:

    If Suzi is member only to her own site, and she tries to login to John’s site to see “Members only”. Until here everything is ok. But after that Suzi is already logged to the network.Can I prevent logging to the network if she tries to login to John’s site?

    Thanks!

    Plugin Author David Sader

    (@dsader)

    “Can I prevent logging to the network if she tries to login to John’s site?”

    No. Login is never to an individual site, a user can only login to the network. But a user may have a member role of a particular site.

    In a WordPress Network this function – is_user_logged_in() – returns True if they are logged in to the Network. There is no – is_user_logged_in_to_johnsite().

    There is – is_user_member_of_blog( $user_id, $blog_id ). Of course the $blog_id is known without a login, but there must be a successful login to determine the $user_id.

    In short,

    If a User is Not Logged in:
    2 choices and site remains visible: searchable, or not.

    If a User is logged in:
    3 choices otherwise site not visible: visible to network users, visible to members only, or visible to admins only.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Wrong subsite login’ is closed to new replies.