latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

level 0 URI restrictions stopped working

Home Forums Community Forum level 0 URI restrictions stopped working

This topic contains 9 replies, has 4 voices. Last updated by  Cristián Lávaque 3 years, 8 months ago.

Topic Author Topic
Posted: Wednesday Apr 10th, 2013 at 10:55 pm #47144

Hello,
Everything was working nicely on my site but after moving to a new server, now my level 0 restrictions are not working. level 1 is fine. But anything I have in the level 0 when a level 0 user is logged in, redirects them to the member sign up page.

any ideas? I’ve read through all the forum posts and tried everything (with and without trailing /’s etc)

Thanks
Lori

List Of Topic Replies

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
Posted: Thursday Apr 11th, 2013 at 9:07 am #47188

What do the variables at the end of the Membership Options page URL say regarding the restriction applied when this happens? [hilite path]Dashboard -› s2Member® -› API / Scripting -› Membership Options Page Variables (MOP Vars)[/hilite]

Posted: Friday Apr 12th, 2013 at 10:33 am #47309
Posted: Friday Apr 12th, 2013 at 11:03 am #47311

Hi,

Sorry to barge in on your thread but this has happened twice for me as well.
I have set pages to “no membership level” i.e. the blank option in the drop list.
It has, by it self, changed it to Membership Level #1 on two occasions now…
I hope this will help both Lori and me. :)

Thanks, Micael

Here’s what I have at Dashboard -› s2Member® -› API / Scripting -› Membership Options Page/Variables:

Membership Options Page Variables (some scripting required)

At the core of s2Member, is it’s ability to protect content (i.e. Posts, Pages, Tags, Categories, URI word fragments, etc). Whenever a public User, or even an existing Member attempts to access an area of your site that is unavailable to them; either because they are not logged-in, not a paying Member at all; or maybe they are logged-in, but they don’t have access to content you’ve protected at a higher Membership Level; s2Member will always redirect these unauthenticated requests to your Membership Options Page.

So your Membership Options Page is a key element of your site. It serves as the focal point of your s2Member installation. Understanding this, you can see it becomes important for s2Member to provide information about what the User/Member was attempting to access (e.g. before they were redirected to the Membership Options Page). This is where s2Member’s MOP Vars come in (i.e. Membership Options Page Variables). Whenever s2Member redirects a User/Member to your Membership Options Page, it will include these important MOP Variables in the query string of the URL. These Variables can be used to provide more informative messages; or even to provide a different set of Membership Options (i.e. Payment Buttons), based on what a User/Member was attempting to access.

TIP: In addition to this documentation, you may also want to have a look at the s2Member Codex.
See Also: s2Member Codex -› API Constants, and s2Member Codex -› API Functions.

———————————————————————————————————–
Example redirection links, including many of the possible MOP Variable variations.
———————————————————————————————————–

…/membership-options-page/?_s2member_seeking[post]=369&_s2member_req[sp]=369
…/membership-options-page/?_s2member_seeking[page]=559&_s2member_req[sp]=559
…/membership-options-page/?_s2member_seeking[page]=587&_s2member_req[level]=1
…/membership-options-page/?_s2member_seeking[post]=545&_s2member_req[level]=2
…/membership-options-page/?_s2member_seeking[catg]=698&_s2member_req[level]=4
…/membership-options-page/?_s2member_seeking[ptag]=447&_s2member_req[level]=3
…/membership-options-page/?_s2member_seeking[page]=887&_s2member_req[ccap]=music
…/membership-options-page/?_s2member_seeking[post]=871&_s2member_req[ccap]=videos
…/membership-options-page/?_s2member_seeking[file]=example.zip&_s2member_req[level]=1
…/membership-options-page/?_s2member_seeking[ruri]=aHR0cDov…&_s2member_req[level]=1

———————————————————————————————————–

Here is a breakdown on each of these Variables:

* `_s2member_seeking[post|page|catg|ptag|file|ruri]` = (Post ID, Page ID, Category ID, Tag ID, File, URI)
Tip: `_s2member_seeking[file]` = (File path, relative to /s2member-files/, or your Amazon® S3 Bucket)
Tip: `_s2member_seeking[ruri]` = (A base 64 encoded URI; only applies w/ Membership URI Restrictions)
Tip: These array elements are mutually exclusive: [post|page|catg|ptag|file|ruri].
Only ONE of these array elements (i.e. Content Types) will be specified.

* `_s2member_req[level]` = a Membership Level # required for access (only applies to Membership Level Access)
* `_s2member_req[ccap]` = a Custom Capability required for access (only applies to Custom Capability Restrictions)
* `_s2member_req[sp]` = a Specific Post/Page ID required (only applies to Specific Post/Page Access Restrictions)
Tip: `_s2member_req[level|ccap|sp]` are mutually exclusive Requirement Types.
Only ONE of these three elements will be passed in combination with:
`_s2member_seeking[post|page|catg|ptag|file|ruri]`.

———————————————————————————————————–

Additional Variables that might be useful to developers:

* `_s2member_seeking[_uri]` = (A base 64 encoded URI; the URI they were originally seeking)
Tip: this is ALWAYS passed through, regardless of which Content Type was protected.

* `_s2member_seeking[type]` = (A string. One of: post|page|catg|ptag|file|ruri)
Tip: this is ALWAYS passed through, regardless of which Content Type was protected.

* `_s2member_req[type]` = (A string. One of: level|ccap|sp)
Tip: this Requirement Type Variable is ALWAYS passed through.

* `_s2member_res[type]` = (A string. One of: post|page|catg|ptag|file|ruri|ccap|sp|sys)
Tip: Actual Restriction Type that’s preventing access; may differ from `_s2member_seeking[type]`.
Tip: Restriction Type `sys` Systematic (i.e. something s2Member protects automatically)
Tip: Restriction Type `ccap` represents Custom Capability Restrictions by s2Member.
Tip: Restriction Type `sp` represents Specific Post/Page Access Restrictions.
Tip: this Restriction Type Variable is ALWAYS passed through.

———————————————————————————————————–

* The use of MOP Vars is 100% completely optional (for advanced site owners).

Code Samples: This may give you some ideas [ click here ].

Backward compatibility: The structure of s2Member’s MOP Vars changed a bit in Nov, 2011. However, s2Member still provides the same MOP Vars that it used in previous versions, for backward compatibility. These old MOP Variables were more difficult to use; they are now deprecated (i.e. they WILL eventually be removed). Going foward, please go by the new documentation above.

Posted: Friday Apr 12th, 2013 at 11:10 am #47312

actually. level 1 isn’t working either. Only full admin access is getting to anything. Here is what is listed in my URIs: (and I’ve tried it with and without / at the end)

level 0
/groups/fire-wife-community
/activity-streams

level 1
/groups/team-fire-wife
/groups/wife-of-the-chief
/groups/new-fire-wife
/groups/fit-fire-wife
/groups/book-club
/groups/fire-wifes-kitchen
/groups/central-ohio-fire-wives
/groups/volunteers-wife
/friends
/messages

Posted: Saturday Apr 13th, 2013 at 8:22 am #47416

Thanks Lori.

I see, the MOP vars do indicate a Level 0 access being required, as if the user weren’t logged in when trying to access those pages… Could you please read this article and make sure that isn’t the case? Knowledge Base » Logged In, But Am I?

If that doesn’t work, please do some general troubleshooting following the tips here: Knowledge Base » Common Troubleshooting Tips.

If you are using caching, please make sure database and object caching aren’t enabled, they are known to cause trouble. Not sure how it’d cause what you’re experiencing, but it’s worth making sure.

Micael, you try the above too, please.

Posted: Monday Apr 15th, 2013 at 7:54 am #47483

Cristián,

Before I start Troubleshooting…
I’m using Quick Cache from PriMoThemes.com / WebSharks, Inc.
I haven’t even thought about that not working since it’s both WebSharks… Would Quick Cache cause a problem?

BR,
Micael

Posted: Monday Apr 15th, 2013 at 7:52 pm #47552
Bruce
Username: Bruce
Staff Member

Would Quick Cache cause a problem?

It’s unlikely that Quick Cache is causing an issue here, as it’s fully integrated with s2Member. You might try disabling it just to be sure, though. :-)

Posted: Tuesday Apr 16th, 2013 at 7:31 am #47602

I was able to update the S2 plug in and everything started working (as far as I can tell right now)

Posted: Wednesday Apr 17th, 2013 at 7:44 am #47655

I was able to update the S2 plug in and everything started working

Great! Thanks for the update. :)

Would Quick Cache cause a problem?

Quick Cache doesn’t do object or database caching.

Viewing 9 replies - 1 through 9 (of 9 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.