Support » Networking WordPress » Multisite User Registration & Access

  • Oh boy, not having a terribly good time getting to grips with WordPress Multisite.
    For my project, it would seem the natural way to go to base it all on a Multisite platform – but there appears to be so many headaches and hurdles – many of which I am astounded are not built in to core functionality. Having got around several issues already, some involving plugins, I am left with two big problems.

    1. User Registration and WordPress User Roles

    When a new user registers on a subdomain, no WP user role is automatically assigned. Instead this has to be manually done – even though the Network Admin setting is set to subscriber for default role.
    I need each user to be automatically assigned the subscriber role.

    2. User Access To Sites

    When a new user registers on a subdomain, they automatically have access to all other sites on the network. I need to be able to automatically restrict each user to the site on which they register.

    Obviously I have scoured forums and articles about both of these points, but the only answers offered so far involve out of date/unsupported plug ins or plug ins that go too far in hiding sites.
    Any other solutions would be gratefully received!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Network users do not register on subdomains, they signup to the entire network. They can login to any and all sites at once because all sites belong to one network.

    Perhaps the following two core functions in WordPress will help or hinder your quest for a plugin solution:

    is_user_logged_in()

    is_user_member_of_blog()

    In a WP Multisite network these two functions may not return the same True/False value when checked. In a network, a user can be logged in AND NOT a member of a site. To isolate sites from the prying eyes of other logged in users of the network, the plugin check should use the is_user_member_of_blog check vs is_user_logged_in I offer.

    Here is a case use example I can offer: Commenting
    Let’s say you want to restrict commenting on a blog to logged in users, all users of the network can comment when logged in. The Discussion Settings on each site can be toggled to handle this case. To restrict commenting to “members only”, you need a plugin for that. And would also then need to build the “member list of Users” on that site manually or via plugin as well.

    In a network, a logged in user is logged in to every site/subdomain created in the network. Membership status is handled at the site level. Login status handled at the main network level. It will not be possible in a network to keep a user “logged in” to one site, and somehow “unlogged in” when visiting a second site on the network in the same browser/cookie session.

    So, I offer that using the function “is_user_member_of_blog” will offer some creativity as you look into coding your own plugin, or cobbling together broken/unsupported code/plugins you have found for your project already.

    @dsader So if I understand your explanation, it is not possible in the WordPress Multisite network for a site2 (for example) visitor to register on site2, and after activating then receiving their login credentials, have automatic access only to site2 without being manually assigned to other sites by site admin or super admin?

    Sorry for the extra long sentence. I put some commas in there for you to take a couple of breaths.

    Thank you.

    – Steve D.

    @dsader @simonjonharding,

    have a look at Network Subsite User Registration which was released to solve the issue of subsite only registration.

    1. The plugin will make a new user “is_user_member_of_blog”. The user will get a role on the subsite. That part of the original post can be resolved.

    2. However, every user will always be “is_user_logged_in” on every other site in the network. In a WP network users need only be “logged in” to be able to comment, right? In a single WP instance, a user must exist as a subscriber role to be able to be logged in. In a network, a user can be logged in without having a subscriber role. The OP wants “access only to site2”, but in a network, no user can both be logged into one subsite and not logged into the rest. That part of the original post cannot be resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multisite User Registration & Access’ is closed to new replies.