Invitation Code for Subsite (subdomain) Access

I've been banging my head against the wall trying to implement what I need with membership. I've found tons of help out of your support system, but I think it's too much plugin for what I need.

Basically, I want a subsite on a subdomain to only be accessible to people who enter an invitation code. These people do not necessarily need to login to the main buddypress site.

I think it will be a lot easier for me to just make a custom form and check for a cookie. I would appreciate it very much if someone could tell me where to start looking for the place to throw a conditional block to implement this. I know how to code but it's been several years and I'm not familiar with wordpress process flows.

You will literally save my holiday season! Thanks

  • DavidM
    • DEV MAN’s Mascot

    Hi bhusema,

    If you're just referring to a single sub-domain site, you could activate Membership on that site and setup the Simple Invite add-on at Membership > Add-ons, then specify an invite code at Membership > Options (be sure to tick the option to require the invite).

    From there, registrations would require an invite code to be entered.

    You'd then likely want to follow a setup like this:

    1. Go to Membership > Access Levels and create an Access Level and leave it with no rules in place, then Activate this level.
    2. Go to Membership > Subscription Plans and create a Subscription Plan and drag that Access Level on to it with an infinite duration then Activate this level and Make it Public.
    3. Activate the Free gateway at Membership > Add-ons.
    4. Go to Membership > Payment Gateways and Activate that gateway.
    5. Create a registration page and include the [subscriptionform] shortcode.
    6. Go to Membership > Options and set the Stranger setting to "None", and specify the registration page to be used for when logged out visitors visit the site.

    I think that'd do it, roughly. How would that work for ya?

    -David

  • bhusema
    • WPMU DEV Initiate

    Wow, thanks a ton for getting back to me! I feel super stupid now, especially because I had that set up last night and now I've spent most of the past 24 hours screaming at my screen trying to get membership to work with global tables. There was a lot more I wanted to add to the process, but I've lowered my expectations quite a bit since then.

    I'll try this. Thanks again.

    Also, I had it set up and working well to restrict access with global tables, except the registered users, under an access level with no rules, couldn't see the subdomain I'd restricted only in the visitor access level either. Any ideas?

  • bhusema
    • WPMU DEV Initiate

    YES! I just got it working. Had to totally redo my install because member stopped saving anything I did after what I suppose was way too much mucking around in the database. Decided I'd set up multi-db and then learned that neither 256 databases nor sql DROP commands are allowed by my provider. Lots of clicking and waiting for pages to load, etc. Generally quite the day.

    It's working now though! I just needed to throw in a login form on the no-access page as well. So don't forget that or something like it if that excellent step-by-step guide goes into documentation somewhere. Is there any plugin-included way I might be missing to automatically log in a user after they register?

    Thanks a ton!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.