Page 1 of 1

Using s2Member with WPMU

PostPosted: May 19th, 2010, 9:43 am
by jannesh
Hi

I am busy developing a plugin for a WPMU site and I want to use the s2Member plugin to limit access to certain features, however I am having a few problems.

Basically the WPMU site will have two types of users, free users and paid users. Both of these user types will be able to publish blogs, but I want certain options for my new plugin to be disabled for free users.

The problem is, when I am logged in as a non-site-admin user onto the WPMU site, the s2Member API does not work.

I inserted the following code into the admin page for my plugin:
Code: Select all
   echo "user_login:"; print_r($user_login); echo "<br>";
   echo "S2MEMBER_VERSION:".S2MEMBER_VERSION."<br>";
   echo "S2MEMBER_CURRENT_USER_ACCESS_LEVEL:".S2MEMBER_CURRENT_USER_ACCESS_LEVEL."<br>";
   echo "access_s2member_level3:".current_user_can ("access_s2member_level3")."<br>";


If I refresh the plugin's option page on a normal (non-MU) site I get the following:
Code: Select all
user_login:admin
S2MEMBER_VERSION:3.0
S2MEMBER_CURRENT_USER_ACCESS_LEVEL:4
access_s2member_level3:1

Which is what I would expect.

If I refresh the plugin's option page on a WPMU site, while logged in as site-admin, I get the following:
Code: Select all
user_login:admin
S2MEMBER_VERSION:S2MEMBER_VERSION
S2MEMBER_CURRENT_USER_ACCESS_LEVEL:4
access_s2member_level3:1

Notice that the S2MEMBER_CURRENT_USER_ACCESS_LEVEL is still 4 (all admin account are 4) and access_s2member_level3 is true, but S2MEMBER_VERSION is not defined anymore.

If I refresh the plugin's option page on a WPMU site, while logged in as a user, I get the following:
Code: Select all
user_login:test
S2MEMBER_VERSION:S2MEMBER_VERSION
S2MEMBER_CURRENT_USER_ACCESS_LEVEL:S2MEMBER_CURRENT_USER_ACCESS_LEVEL
access_s2member_level3:

Now S2MEMBER_CURRENT_USER_ACCESS_LEVEL is also not defined and access_s2member_level3 is false. This is even the case if I change the role of the 'test' user to 's2Member Level 3'.

So, the question is: "Is it possible to get the s2Member level of a WPMU user on the user-blog level, and if so, how?"

I am using:
Wordpress 2.9.2
Wordpress MU 2.9.2
s2Member 2.9.3
Budypress 1.2.3

I am prepared to go dig about for code, so all help will be appreciated.

Thanks
JannesH

Re: Using s2Member with WPMU

PostPosted: May 25th, 2010, 3:48 am
by jannesh
Hi

Still looking for a solution here, or is it not possible?

JannesH

Re: Using s2Member with WPMU

PostPosted: June 24th, 2010, 12:27 am
by Jason Caldwell
Hi JannesH. Very sorry for my extremely delayed reponse.
No, you are correct. This is NOT possible with s2Member, not yet.
We were awaiting the release of WP 3.0 with Multisite support before we spent too much time on this.
Now that's it's out, work is already underway on compatiblity with WP 3.0 /w Multisite networking enabled.
s2Member is already compatible with WP 3.0, but not with Multisite networking enabled, not yet.