PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Bug: MS 3.0 Subscriptions dont work for unregistered users

s2Member Plugin. A Membership plugin for WordPress®.

Bug: MS 3.0 Subscriptions dont work for unregistered users

Postby jannesh » June 30th, 2010, 10:23 am

Hi

I discovered a problem with the new s2Member and WPMS/BuddyPress. I dont know if it is specific to MS. My configuration use WP 3.0 with MS enabled, BuddyPress 1.2.5 and s2Member 3.1.2.

This is for a new guest that does not have a subscription yet. If I browse the blog and try to access a page with restricted access, I get redirected to the Subscriptions page, great!. However after I have subscribed (been to PayPal and all) and I have filled in my new user info and I want to view the page I get the Subscription page again. Turns out the previous subscription did not work. I was subscribed to the blog but my role is 'Subscriber' not 's2Member Level 1' as it should be. Note, the money did go of my PayPal account...

Turns out the 'registration' part where I put in my username and other details, overwrite the 'subscription' details already recorded by s2Member.

I hacked away at the s2Member code and got it to work. Basically after I have identified that the page is indeed restricted, I dont do a straight redirect to the 'subscribe' page. I first check if the user is logged in at all, if not go to a register page, else if the user does not have sufficient level, go to subscribe, else (the user has sufficient level) display the page.

My code in 'page-level-access.inc.php' looks like this:
Code: Select all
else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"] &&
         in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/",
                   $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])) &&
         ws_plugin__s2member_nocache_constants (true) !== "nill") {
  if (!$current_user) {
    if (wp_redirect(add_query_arg ("s2member_level_req", "1",get_page_link(14)))
                                                                                                      !== "nill") {
      exit();
    }
  }
  else if (!current_user_can ("access_s2member_level1")) {
    if (wp_redirect(add_query_arg("s2member_level_req", "1",
                    get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]
                                  ["o"]["membership_options_page"]))) !== "nill") {
      exit ();
    }
  }
}


The page ID 14 in there is the hard-coded page number for the register page I use to give the user an option to either login or register.

JannesH
User avatar
jannesh
Experienced User
Experienced User
 
Posts: 12
Joined: May 19, 2010

Re: Bug: MS 3.0 Subscriptions dont work for unregistered use

Postby Jason Caldwell » June 30th, 2010, 5:10 pm

Hi JannesH. Thanks for these code samples. Much appreciated.

s2Member ( as of v3.1.2 ), is NOT yet compatible with Multisite Networking in WP 3.0. We are working on this, and you can expect to see full ( improved ) support for Multisite Networking in a future release. I suspect somewhere around 3.1.5 or so.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Bug: MS 3.0 Subscriptions dont work for unregistered use

Postby mercure80 » July 3rd, 2010, 1:58 pm

Hello!
I am experiencing the same issue, running BP + WP 3.0 with 4 community blogs.
I look forward to WP MS support shortly.
Great work and great plugin!
Marc-O.
mercure80
Guest User
Guest User
 

Re: Bug: MS 3.0 Subscriptions dont work for unregistered use

Postby Jason Caldwell » July 7th, 2010, 6:13 pm

Thanks Marc-O.
Absolutely. ~This is high on our priority list.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron