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™

Automatic logout of users?

s2Member Plugin. A Membership plugin for WordPress®.

Automatic logout of users?

Postby dapike » November 26th, 2011, 7:32 am

Is there a PHP function or something similar that I can embed into a webpage to automatically logout a user who views that page?

- David.
User avatar
dapike
Registered User
Registered User
 
Posts: 9
Joined: October 5, 2010

Re: Automatic logout of users?

Postby Cristián Lávaque » November 28th, 2011, 2:03 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

Re: Automatic logout of users?

Postby dapike » November 28th, 2011, 7:50 am

Thanks for the tip, but it doesn't seem to want to work on my site. I'm trying to block bogus/spam registrations that are somehow by-passing the s2member registration form and successfully registering without entering data in the mandatory registration fields. I can't seem to block these registrations directly, so I figured that I could at least try to not let them login, by embedding some PHP into the s2member Login Welcome Page that would check whether a required registration field is blank and if so then immediately perform a logout. What is actually happening when I do this is that several warnings are generated, complaining about headers that have already been sent (by the weaver theme it appears). I wouldn't much care about these warnings since they would only be seen by spammers, except that the user remains logged in.

- David.
- David.
User avatar
dapike
Registered User
Registered User
 
Posts: 9
Joined: October 5, 2010

Re: Automatic logout of users?

Postby Cristián Lávaque » November 29th, 2011, 2:33 am

Ah, I see your problem.

You could use the wp hook to check much earlier in the script, before headers were sent. http://adambrown.info/p/wp_hooks/hook/wp

I hope it 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


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest

cron