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™

s2Member doesn't redirect protected pages

s2Member Plugin. A Membership plugin for WordPress®.

s2Member doesn't redirect protected pages

Postby aendrew » August 30th, 2010, 9:48 pm

Hi there,

I'm using the latest WP, BuddyPress and s2Member, with Suffusion as the theme (Suffusion child theme, actually).

Currently, the pages I set to be protected are not. I have a category that is supposed to be protected that I still can get to when logged out, plus all the URIs for BuddyPress I've supplied aren't protected in a similar manner.

I'm supposing this is due to the fact Suffusion uses a bunch of calls to format content and whatnot; just below get_header(); is a function, suffusion_query_posts();. Would this be what is causing the issue above?

If not, any idea what I might be doing wrong?

Thank you!
User avatar
aendrew
Registered User
Registered User
 
Posts: 2
Joined: August 30, 2010

Re: s2Member doesn't redirect protected pages

Postby Elizabeth » August 31st, 2010, 10:44 am

Hi aendrew,

In order to investigate this further, please send us a Dashboard login, I'll be happy to have a look for you.
Send it here for privacy:
http://www.s2member.com/contact/
User avatar
Elizabeth
Moderator
Moderator
 
Posts: 160
Joined: May 12, 2010

Re: s2Member doesn't redirect protected pages

Postby Liz Ness » August 31st, 2010, 2:30 pm

I am having this issue, as well, with my installation of s2Member 3.2.3.

The system isn't redirecting the login to the Welcome page. This is true for both options on the setting via General Options -> Login Welcome Page (e.g., a redirected URL as well as selecting the page via the drop down menu).

However, the Members Options page (a redirect for non-logged in members) does seem to function as expected.

UPDATE: Actually, this only happens when I log in as the admin -- so, I'm okay with this.
User avatar
Liz Ness
Registered User
Registered User
 
Posts: 9
Joined: August 31, 2010

Re: s2Member doesn't redirect protected pages

Postby Jason Caldwell » August 31st, 2010, 6:18 pm

Hi Liz. Are you running BuddyPress?

If so, please upgrade to s2Member v3.2.4
-- BuddyPress ( bug ). A bug that was first introduced in s2Member v3.2.3 with Hook priority on `template_redirect` was causing compatiblity issues with BuddyPress. This has been corrected in s2Member v3.2.4+.
~ 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: s2Member doesn't redirect protected pages

Postby Liz Ness » August 31st, 2010, 8:45 pm

AWESOME! (Yes on the buddypress and thanks for the fix in 3.2.4+!)

You rock Jason!

Thanks again,

Liz Ness
User avatar
Liz Ness
Registered User
Registered User
 
Posts: 9
Joined: August 31, 2010

Re: s2Member doesn't redirect protected pages

Postby aendrew » September 3rd, 2010, 3:40 pm

Hi again!
@Elizabeth -- I'm currently moving my local copy of WP to a testing server; will send dashboard login once done.

@Jason -- I tried upgrading to 3.2.4, same issue persists.
User avatar
aendrew
Registered User
Registered User
 
Posts: 2
Joined: August 30, 2010

Re: s2Member doesn't redirect protected pages

Postby Jason Caldwell » September 7th, 2010, 5:12 pm

Thanks for the update.
Please feel free to post the Dashboard login and I'll have a look for you.

Yes, it sounds like this *could* be the problem ( i.e. suffusion_query_posts() ), but in our tests with Suffusion, I was unable to reproduce the issue. If you're PHP savvy, you may want to have a look at s2Member v3.2.4+, inside this file: /s2member/includes/functions/security-gate.inc.php

Otherwise, yep. Just send over a Dashboard login and we'll take a peak.
~ 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: s2Member doesn't redirect protected pages

Postby s2pabs » March 23rd, 2011, 10:59 pm

Hey Guys,

I wonder if someone could help me with something? I've just installed s2member into a site on my local pc WAMP server. I'm just wondering how the page protection works? I've set it up as per the video's / documentation and according to the set up it should be protecting 3 pages.

Then I logged out of my admin area and even tried closing my browser, but on this pc it doesn't protect the pages that are supposed to be protected? I can see them by just clicking on them. The only page that it's protecting is my "Login Welcome Page" - which redirects to the Membership Options Pages. The other "protected" pages are visible when I'm logged out.

I then tried a few different browsers to see if a cookie had been set, but s2member isn't protecting these pages on any of the browsers on my pc... I thought I'd be able to test it locally before launching it live.

Is this normal behaviour? I mean does it use an IP address to protect the pages? I would have thought it was a login rather than an ip address?

I can't test it easily elsewhere because like I said, it's on my WAMP server on my pc.

Does anyone have any ideas about this? Why wouldn't s2member be protecting the pages even though I'm logged out?

Thanks in advance,

Pabs
User avatar
s2pabs
Registered User
Registered User
 
Posts: 2
Joined: March 23, 2011

Re: s2Member doesn't redirect protected pages

Postby Jason Caldwell » March 23rd, 2011, 11:40 pm

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.

Also, please be sure to read s2Member's section on Alternative View Protection. This can sometimes cause confusion; depending on your theme. You'll find this in your Dashboard under: s2Member -> General Options -> Alternative View Protection.
~ 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: s2Member doesn't redirect protected pages

Postby s2pabs » March 24th, 2011, 6:14 pm

Hey Jason,

Thanks for your quick response! Works like a treat!

I'm only just starting to look at this software, but it looks great so far..

Thanks again,

Pabs
User avatar
s2pabs
Registered User
Registered User
 
Posts: 2
Joined: March 23, 2011

Re: s2Member doesn't redirect protected pages

Postby msafi » August 30th, 2011, 2:34 pm

I just wanted to say s2Member is brilliant! Thanks a lot for it.

Now, I just wanna ask, isn't there a way for the script to know when it's being run on a localhost, whose domain is other than 'localhost' and notify the user about the required wp-config.php edits?

It wasn't easy landing on this thread and finding the solution that Jason posted.
User avatar
msafi
Registered User
Registered User
 
Posts: 6
Joined: August 30, 2011

Re: s2Member doesn't redirect protected pages

Postby Jason Caldwell » August 30th, 2011, 5:32 pm

Thanks for the follow-ups, and for the KUDOS!

msafi wrote:I just wanted to say s2Member is brilliant! Thanks a lot for it.

Now, I just wanna ask, isn't there a way for the script to know when it's being run on a localhost, whose domain is other than 'localhost' and notify the user about the required wp-config.php edits?

It wasn't easy landing on this thread and finding the solution that Jason posted.
That's a great question. There isn't one that I'm aware of, but if you are, please let me know! If anyone else reads this and has suggestions, I'd be appreciative. To my knowledge, HTTP_HOST is the only environment variable available for testing in this regard. s2Member currently scans for 127.0.0.1 at the beginning, and localhost anywhere in the HTTP_HOST environment variable, as it's only way of auto-detecting localhost installations. Anything else must be specified in the /wp-config.php file with define("LOCALHOST", true); in order for s2Member to know.
~ 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: s2Member doesn't redirect protected pages

Postby Cristián Lávaque » August 30th, 2011, 6:45 pm

Would SERVER_ADDR work?
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: s2Member doesn't redirect protected pages

Postby Jason Caldwell » August 30th, 2011, 9:26 pm

Cristián Lávaque wrote:Would SERVER_ADDR work?

Ideally, yes. However, I've seen live server configurations return 127.0.0.1 in this environment variable.
~ 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: s2Member doesn't redirect protected pages

Postby msafi » August 31st, 2011, 2:47 am

Maybe s2Member could test behaviors and characteristics of the server, like how a localhost environment usually cannot be reached from outside. Or s2Member could check whether the domain looks like a real internet domain. In the past I used domains like 'http://msafipc/website1/', 'http://msafipc/website2/'. More recently I been using 'http://website1.xom', 'http://website2.xom', etc, all of which are not proper internet domain names?
User avatar
msafi
Registered User
Registered User
 
Posts: 6
Joined: August 30, 2011

Re: s2Member doesn't redirect protected pages

Postby Cristián Lávaque » August 31st, 2011, 8:27 pm

That can get much more complicated, in my opinion.

Probably a simple option would be to have it as a setting at the top of General Options, like Deactivation Safeguards is, so that developers see that it's there, it exists and they need to set it when working in a local server.
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: s2Member doesn't redirect protected pages

Postby msafi » September 1st, 2011, 9:28 am

@Cristián, yeah. Implementing it like I suggested would probably cause unnecessary bloat.

Had something been said about this issue in the 'General Options' or even the 'Quick-Start Guide', I would've noticed it and not had to search for a solution.
User avatar
msafi
Registered User
Registered User
 
Posts: 6
Joined: August 30, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron