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