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™

Login Redirect not working

s2Member Plugin. A Membership plugin for WordPress®.

Login Redirect not working

Unread postby denvert » October 12th, 2011, 9:46 pm

I'm using a login redirect with this shortcode in the form "login_redirect" => "%%previous%%", and it is not working. If I use "login_redirect" => "www.example.com", this works, however the previous shortcode does not.

I'm using pro plugin on a multisite and just updated to latest version of wordpress and the pro plugin. My login was also not working for a few hours and just start working all of a sudden. Seems like there might be some bugs with multisite and latest updates.

Please advise, need this up and working asap.
Last edited by denvert on October 13th, 2011, 9:22 am, edited 1 time in total.
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby denvert » October 12th, 2011, 9:48 pm

Last edited by Cristián Lávaque on October 31st, 2011, 11:45 pm, edited 1 time in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby denvert » October 13th, 2011, 2:33 am

Login re-direct issue is happening still.

If i'm on this page, /wp-login.php and click the register link it re-directs to the home site's login page which gives an error message stating registration is turned off. This all worked before.

Just tried reverting back to an old version, no luck.

Just to note I manually changed all the pages that you need to change for multiste, get error message when try to change automatically.
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby denvert » October 13th, 2011, 9:45 am

I'm adding more details after researching forums more, this ticket, viewtopic.php?f=4&t=14373&p=30196&hilit=Registration+has+been+disabled.#p30196 talks about sub-domain vs. sub directory installations, i am in a sub-domain install, however, everything was working until I did the recent upgrades.

This post talks about creating new installation to test, viewtopic.php?f=4&t=15431&p=44898&hilit=Registration+has+been+disabled.#p44898 which i really don't have the time to do, plus wouldn't really help because as noted in the post the problem would still re-appear when exporting database.

Registration does work with registration form embedded in a page, however when logging out from back end the page re-directs to default wordpress login and if i hit register link there it takes me to the registration is disabled error.
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby denvert » October 17th, 2011, 12:08 pm

Hi,

Can someone please help. I was able to resolve the issue with logins but re-direct is either not working or i don't understand what it's supposed to do.

If i go to a page that is protected by s2 member and then am redirected to a login page and then login does it take me to the page that originally re-directed me with %%previous%%" as the shortcode. If not is there a way to have this set up.

Thanks
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby Jason Caldwell » October 17th, 2011, 7:10 pm

Thanks for your patience.
Investigating now.
~ 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 ( comes in handy ). Then Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirect not working

Unread postby denvert » October 18th, 2011, 12:54 pm

ok, let me know.
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby denvert » October 19th, 2011, 11:07 pm

Hi Jason, were you able to look into this?
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby denvert » October 20th, 2011, 3:34 pm

There is another recent thread that had a response, viewtopic.php?f=4&t=2717&hilit=redirect+to+last+page, it says

"That's why I pointed you to the Membership Options Page Variables, because they tell you what the person tried to view that got him sent to the Membership Options Page. You can use these variables to create a redirection URL to send the person to after login.

You can point the person to the login page with the redirection value at the end, like http://example.com/wp-login.php?redirec ... tectedpage"

I wasn't able to understand the options variables. It seems an example of how to set up would be very appreciated by a good amount of people. I think it is basic user experience in a lot of memberships sites that when you are re-directed to a page to login you are then returned to the page that you were originally directed from.

Please respond, even if it is just to say that you are not going look into this for me.
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby Jason Caldwell » October 20th, 2011, 3:37 pm

~ 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 ( comes in handy ). Then Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirect not working

Unread postby denvert » October 20th, 2011, 3:53 pm

Jason,

2nd part was another issue which has since been resolved, was a problem with re-writing multi-site files after wordpress upgrade.

Here is scenario, I have a video page with nothing on it but a video (no sidebar etc.), user is sent to re-directed to login page that has code generated from the document you give link to, specifically,

<?php
$options = array(
"title" => "",
"signup_url" => "http://xxx.xxxxxx.org/register/",
"login_redirect" => "%%previous%%",
"profile_title" => "",
"display_gravatar" => "0",
"link_gravatar" => "0",
"display_name" => "0",
"logged_in_code" => "",
"logout_redirect" => "http://xxx.xxxxxx.org",
"my_account_url" => "0",
"my_profile_url" => "0"
);
$args = array (
"before_widget" => "<div class=\"member_login_widget\">",
"after_widget" => "</div>",
"before_title" => "<h5>",
"after_title" => "</h5>"
);
echo s2member_pro_login_widget($options, $args);
?>

It does not, however re-direct to page that sent them there but re-directs to home page.

Am i misunderstanding something?
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby Jason Caldwell » October 20th, 2011, 4:05 pm

~ 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 ( comes in handy ). Then Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirect not working

Unread postby denvert » October 20th, 2011, 4:17 pm

Sorry just re-read your question, login page from the page they are initially being re-directed to is a login page (set as membership options page).
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby Jason Caldwell » October 20th, 2011, 4:32 pm

~ 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 ( comes in handy ). Then Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirect not working

Unread postby denvert » October 20th, 2011, 4:49 pm

Sorry to be just a pain,

if i replace, "login_redirect" => "%%previous%%",
with

"login_redirect" => $_SERVER["HTTP_REFERER"]

just shows a blank white page.


also this doesn't make sense

"This is the intended behavior, in this one special scenario, because returning a logged-in User to a set of Membership Options is not intuitive."

I'm not trying to return them to the page they logged in from but the page that directed them to the page they logged in from. Does that make sense?
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby Jason Caldwell » October 20th, 2011, 4:55 pm

~ 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 ( comes in handy ). Then Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirect not working

Unread postby denvert » October 20th, 2011, 5:01 pm

Wasn't a blank white page, the part that was getting embedded is not showing up but the header, sidebar etc are.
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby denvert » October 20th, 2011, 5:04 pm

User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby Jason Caldwell » October 20th, 2011, 5:06 pm

~ 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 ( comes in handy ). Then Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirect not working

Unread postby denvert » October 20th, 2011, 5:11 pm

sorry, "login_redirect" => $_SERVER["HTTP_REFERER"], this shows login form again but still just re-directing to home page.
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby Jason Caldwell » October 20th, 2011, 5:18 pm

~ 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 ( comes in handy ). Then Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirect not working

Unread postby denvert » October 20th, 2011, 5:28 pm

Sorry i don't understand how this would could implemented in the widget replacement code, the re-direction is being created by the membership options page?

Does it help to take a step back and re-evaluate what i'm trying to do?

I try to enter a page that is protected by S2, it re-directs to a page with a link to the register page or the attached login form below. When the person logs in they are logged in to the page that they were initially trying to access before being "re-directed" or sent (whatever we should be call it) by s2.

The client's experience was they sent out an e-mail to protected page, e-mail recipient is then re-directed to login page, they then land on a seperate page then the one they were initially trying to access but another page which they then had to go back to e-mail to copy the url and re-enter it.
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby Jason Caldwell » October 20th, 2011, 7:01 pm

Thanks. I understand.
Before I add another reply, can you please clarify the following for me?

Are you handling the redirection yourself through a script that you've written?
Or, are you depending on the redirection that s2Member does ( i.e. to your Membership Options Page ) when a visitor attempts to access protected content without being logged-in?
~ 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 ( comes in handy ). Then Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Login Redirect not working

Unread postby denvert » October 20th, 2011, 10:29 pm

I'm depending on the re-direction that s2member does.
User avatar
denvert
Registered User
Registered User
 
Posts: 57
Joined: March 25, 2011

Re: Login Redirect not working

Unread postby Jason Caldwell » October 21st, 2011, 1:37 pm

~ 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 ( comes in handy ). Then Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Next

Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 2 guests