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™

restrictions not working at all :(

s2Member Plugin. A Membership plugin for WordPress®.

restrictions not working at all :(

Postby Paulo » August 9th, 2011, 4:25 pm

Hi there,

First of all, thank you for the great plugin. I think once I resolve this problem, the plugin will be tremendously useful for my project.

I am using WP 3.2.1 + Buddypress 1.2.9
S2Member Version 110731 (as displayed in WP plugin page)
Running on Apache Windows Test Server

Problem:
None of the restrictions seem to be working. As a basic test. I specified 'all' posts to require level 04 membership. However, the post is still visible to a non logged-in member.

Discovery:
After hours of digging, I think I may have discovered the culprit.

The plugin seems to check for five conditions to determine if post is restricted in posts.inc.php:

1. ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]
2. ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false"))
3. preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"])
4. c_ws_plugin__s2member_no_cache::no_cache_constants (true) !== "nill"
5. (!$user || !current_user_can ("access_s2member_level0")))

I found that 'login_redirection_uri' is '/^\/login-welcome-page\/$/'
and $_SERVER["REQUEST_URI"] is '<my_post_permalink>'

hence, condition 3 failed to match the two strings.

What is the correct behaviour? What should the values be supposedly?

Please help.

Thanks in advance!

-Paul
User avatar
Paulo
Registered User
Registered User
 
Posts: 5
Joined: August 9, 2011

Re: restrictions not working at all :(

Postby Bruce C » August 9th, 2011, 9:31 pm

I tested on my wamp server, it appears to be working alright for me.

Maybe try deleting and reinstalling? Perhaps a setting got messed up somewhere.
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011

Re: restrictions not working at all :(

Postby Paulo » August 9th, 2011, 11:57 pm

Thanks for your reply. Tried deleting it and reinstalled, still no go :(

Would anyone be so kind as to tell me what values of '$login_redirection_uri' and '$_SERVER["REQUEST_URI"]' that you are getting within /includes/classes/posts.inc.php? Then I can try to see what went wrong.
User avatar
Paulo
Registered User
Registered User
 
Posts: 5
Joined: August 9, 2011

Re: restrictions not working at all :(

Postby Cristián Lávaque » August 10th, 2011, 12:02 pm

Hi Paulo.

Watch this video and tell me if it helps with your problem: http://www.s2member.com/content-restric ... ble-video/

And because you mentioned the Login Welcome Page, here's a video in case you're having trouble with that too: http://www.s2member.com/login-welcome-p ... cts-video/

Let me know if that helps.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: restrictions not working at all :(

Postby Paulo » August 10th, 2011, 12:28 pm

Thanks for your reply. I have seen the videos before, and unfortunately do not address the same issues. In particular, the restrictions do not seem to apply at all, not even for visitors (people who are not logged in) so the Login Member Page redirect issue is rather a separate issue.

Could this be a legitimate problem with s2member + buddypress?
User avatar
Paulo
Registered User
Registered User
 
Posts: 5
Joined: August 9, 2011

Re: restrictions not working at all :(

Postby Cristián Lávaque » August 10th, 2011, 1:40 pm

OK.

Could you create a test account at Level 0 (subscriber) and give me the login details? Also the URL to a post restricted at Level 1 and another at Level 2, please.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: restrictions not working at all :(

Postby Paulo » August 11th, 2011, 12:09 pm

Hi, I am on a testing local server with no domain name and external access blocked. I could provide those details in the near future once it is at a stage to be put on a live server.

Thanks again for your help.
User avatar
Paulo
Registered User
Registered User
 
Posts: 5
Joined: August 9, 2011

Re: restrictions not working at all :(

Postby Cristián Lávaque » August 11th, 2011, 12:34 pm

Got it.

By the way, regarding the local server, here's a tip that may help:

Jason Caldwell wrote:Try adding this line to your /wp-config.php file.
Code: Select all
define("LOCALHOST"true);  
s2Member has a special routine, which we refer to as the Systematics Routine. It sees your IP address is the same as the server's IP; which is sometimes an issue on a WAMP/MAMP installation. It's fine so long as your domain is http://localhost/. However, if it's something other than that, you'll need to add that line in your /wp-config.php file so s2Member realizes it's running on a localhost installation.


I hope that helps.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: restrictions not working at all :(

Postby Paulo » August 16th, 2011, 3:06 pm

That's it!! Thanks so much!
User avatar
Paulo
Registered User
Registered User
 
Posts: 5
Joined: August 9, 2011

Re: restrictions not working at all :(

Postby Cristián Lávaque » August 17th, 2011, 3:19 am

:)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot] and 0 guests

cron