Page 1 of 1

Trouble configuring login and member options pages

PostPosted: June 23rd, 2011, 4:39 am
by jb510
I'm using s2member to protect a single parent page called "Gallery" and a dozen child pages. Visitors can NOT register, they all use the same login called "guest" to access the private area (hi-res image galleries for potential clients only). So just to be clear, no registration, no payment, just fancy password protection.

So.. I created a page called "Login" which is nothing but a standard page with a shortcode the calls the sidebar login plugin's template tag, this makes it easy to customize what shows up before/after the login widget.

In s2Member > General Options > Membership Options Page I set the "Membership Options Page" to this login page. This works fine, when someone tries to access the restricted area the are prompted to login.

In s2Member > General Options > Login Welcome Page I set the "Login Welcome Page" to the protected "Gallery" page, this wasn't working until I figured out that the sidebar login plugin was controlling the redirect here, once I set the redirect in the plugin nearly everything is working great...

Now I just have one remaining problem. When a guest logs out (via the WP3.1 admin menu) they get redirected to the WordPress standard login window… yuk, this is what I'm trying to hide. Does s2m have an option I'm missing to set a page to redirect s2member defined user to? I want logged out guests to go back to the custom login page, not the default wordpress login page.

Re: Trouble configuring login and member options pages

PostPosted: June 23rd, 2011, 12:56 pm
by Cristián Lávaque
You could use wp_logout_url in the link to logout. https://codex.wordpress.org/Function_Re ... logout_url

Or you could have a redirection in .htaccess that takes those who landon /wp-login.php?loggedout=true to the page you want.

Or search in Google how others solved it http://www.google.com/search?q=wordpres ... ter+logout

I hope that helps. :)

Re: Trouble configuring login and member options pages

PostPosted: June 23rd, 2011, 1:40 pm
by Cristián Lávaque
Just came across this plugin that could help you too https://wordpress.org/extend/plugins/login-with-ajax/

# Redirect users to custom URLs on Login and Logout


Haven't tried it, though, so I don't know how well it works with s2Member.

Re: Trouble configuring login and member options pages

PostPosted: June 23rd, 2011, 2:55 pm
by jb510
Thank you Cristián for the response. I am familiar with redirecting all users upon logout, but I was wondering if there was a way to target ONLY those with s2member roles to their own logout page, but still have regular admin/editor/contributor/author roles get sent to the default login page.

Ultimately, this isn't critical, I can just send everyone to the home page and tell admins/etc to click the login link, but as I said my preference would be that only the s2members got redirected on logout to the home page.

Re: Trouble configuring login and member options pages

PostPosted: June 23rd, 2011, 6:24 pm
by Cristián Lávaque
Well, you could use a conditional to check the role and determine the URL to use with wp_logout_url when you create the logout link.