can membership restrict access to sub-blogs in multisite?

Can the membership plugin restrict access to sub-blogs on a multisite network? Where do I activate that, if so? Thanks!

  • DavidM

    Hi cmccb,

    It can, though there's a number of things to consider with that. To begin with, you'll need to enable the global table option in Membership, mentioned in \membership\membershipincludes\includes\membership-config.php as follows:
    if(!defined('MEMBERSHIP_GLOBAL_TABLES')) define( 'MEMBERSHIP_GLOBAL_TABLES', false);

    You can set that to true or simply define that global variable in wp-config.php as follows:
    define( 'MEMBERSHIP_GLOBAL_TABLES', true);

    However, if you've activated Membership before on your network, you'll need to basically remove all traces of it's options, such as the m_installed option in wp-options in the database. Basically all m_ and membership_ prefixed options.

    You could try executing the following to get all the entries:
    SELECT * FROM wp_options WHERE option_name LIKE 'M!_%' escape '!';

    With that, you could then use URL Groups to restrict access to entire sub-blogs and domains.

    Another thing to consider though, since post and category ids won't necessarily carry from site to site, post and category rules likely will take some serious adjustment to make work with that. Similarly, other rules may take some work to get working the way you'd like them to.

    Ultimately, it's not really advised as an option unless you're comfortable with your database and possibly some complex setup concerns. But that can be used to restrict access to sub-blogs and domains on your network.

    -David

  • cmccb

    Hiya David,

    Thanks for the quick reply.

    I have not installed Membership on my main blog site yet. I do not need to restrict access to categories/pages on my main blog, but I need to assign/limit access to my sub-blogs according to membership level. My issue is that I need to have one login to access multiple sub-blogs (while the main blog has no restricted content).

    Is Membership still the right plugin, or is there a different plug-in to use?

    CMCCB

  • Barry

    In that case - if you make the settings David suggested above - *before* network activating it on your system, then it will be setup to use global tables across all of your network sub-blogs.

    After that, have a look at using URL groups and the rules to limit access to either all (or some) of your sub-blogs by url / address as that is the easiest / most powerful method and will cover all pages, posts, etc on them.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.