Page 1 of 2

Login Redirect Not Working - Need Help Fast

PostPosted: March 9th, 2011, 9:57 pm
by Vinnyo
Hey Everyone,

I am running the latest WP update along with the latest S2member plugin. All work before I did the upgrades and now everything is out of wack.

Here is the deal. I was using Peters Login Redirect and that stopped working after the most recent update. I actually talked to Peter and he said that I should deactivate S2member to confirm that S2memeber was the cause. It seems that the s2member overrides the wp-login hook which would make sense because S2member offers a login redirect.

But here is the thing....the login redirect is not redirecting to the page I have selected. Instead it is going to the WP-admin dashboard. I need to change this to go to an actual page I have set up for the user after login.

Need help and quick...any advise as I am listening.

Thanks
Vince

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 9th, 2011, 11:53 pm
by Cristián Lávaque
Could you share what the URL you're using to redirect after login is? (You can remove the domain name if you prefer it.)

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 10th, 2011, 8:20 am
by Vinnyo
so when a user logs in I want the to go to http://www.mysite.com/admin-dashboard

but since the upgrade they now go to http://www.mysite.com/wp-admin


I dont want users to be redirected to the second url only the first

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 10th, 2011, 12:32 pm
by Cristián Lávaque
So you added the first URL to WP Admin -> s2Member -> Login Welcome Page -> Special Redirection URL and it's not working? Is that a URL that users can normally get access to?

Well, one possible reason for redirection not working may be a hidden redirect in the login form. This just came up yesterday with someone else. Here, take a look at this:

viewtopic.php?f=4&t=2631&p=7635#p7633
viewtopic.php?f=4&t=2631&p=7635#p7635

Hope that helps.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 14th, 2011, 4:09 pm
by Vinnyo
Hey Cristian,

Maybe you can check out my site...Linkamotion.com.

The S2memeber redirect is not working. I did find a hidden form in the wp-login.php file on like 648 or something like that. I removed it and nothing happened so I put it back. I think it belongs to the WP files.

I was using Peters Login Redirect before the update and actually spoke with Peter himself. He said to deactivate all the plugins until his worked. S2memeber was the reason why Peters Login Redirect is not working. Makes sense because S2memeber requires that field but I removed Peters Login Redirect and still nothing is working. It did work before the latest S2member update but doesnt now.

Not really sure what to do.
Thanks
Vince

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 14th, 2011, 5:49 pm
by Cristián Lávaque
If you deactivate Peter's Login Redirect, does s2Member's still not work?

I see this hidden field in your login page:
Code: Select all
<input type="hidden" name="redirect_to" value="http://linkamotion.com/wp-admin/" />
Is that the one you had removed?

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 14th, 2011, 5:55 pm
by Vinnyo
This is the code I was talking about. Its located on in the wp-login php file. This is what I am looking at

Code: Select all
<?php do_action('login_form'); ?>
   <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90"<?php checked( $rememberme ); ?> /> <?php esc_attr_e('Remember Me'); ?></label></p>
   <p class="submit">
      <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" />
<?php   if ( $interim_login ) { ?>
      <input type="hidden" name="interim-login" value="1" />
<?php   } else { ?>
      <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
<?php    } ?>
      <input type="hidden" name="testcookie" value="1" />
   </p>
</form>



I removed this part
Code: Select all
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />


and nothing happened. Nothing happened and Peters Login redirect has been removed. Is that above code the right code? Or am I missing something

Thanks
Vince

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 14th, 2011, 6:09 pm
by Cristián Lávaque
OK. Yeah, that's the one I'd have tried removing myself.

With that line still in wp-login.php, but having deactivated the other plugin, did s2Members redirection not work or you still haven't tried that? (Sorry if that's what you meant and I didn't understand.)

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 14th, 2011, 6:22 pm
by Vinnyo
No the s2member login redirect is not working when I save the page I have as the WELCOME PAGE.

Not sure where to go from here.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 14th, 2011, 8:17 pm
by Cristián Lávaque
OK, I'm not sure why you'd have the problem.

Could you try installing a new WordPress blog in a test directory and s2Member only, no other plugin or theme.

Do the basic configuration with the Login Welcome and Membership Options pages, and then try the Special Redirection URL for the login page, too.

Do you have another hosting account where you could try this as well? Just in case there's a problem with your server's configuration.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 14th, 2011, 11:10 pm
by Vinnyo
Hmmm...not really what I want to do because that wont solve the current problem.

I was using the Peters Login Redirect and it worked just fine prior to the most recent WP update and more importantly the S2member update. So something change in the S2member update to override the Peters Login Redirect plugin.

I just got a response back from Peter of Peters Login Redirects. Talking to him he said that my best option would be talk to S2member creators to help me solve this. But also mentioned that the S2member hooks are ultimately interfering with Peters Login Redirect.

So my question is if the S2member login redirect is not working then what hooks or code can I remove so that the Peters Login Redirect will work. As it seems that the S2member code is overriding that other plugin.

Also...my site was attacked a few weeks ago and I did use a clean backup but zipped filed two files that I did not know what they were about. I have listed them below

login_check.php
php.ini.


do any of these files have anything to do with the S2member login redirect. Currently these are in zip files because again...I was not sure what they were for and the coding did not look familiar.

Let me know when you can

Thanks
Vince

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 15th, 2011, 12:47 am
by Jason Caldwell
Hi there. Please give this a shot.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php

Inside the file, add this code:
Code: Select all
<?php
add_action 
("plugins_loaded", "allow_s2_redirection_overrides");
function allow_s2_redirection_overrides ()
    {
        remove_action ("init", "c_ws_plugin__s2member_login_redirects_r::remove_login_redirect_filters", 11);
    }
?>

* s2Member was updated in the latest release to prevent redirection overrides, because s2Member provides comprehensive options for this under: `s2Member -> General Options -> Login Welcome Page`. Many site owners were experiencing issues with login redirection, particularly in BuddyPress. These problems were associated with login redirection being overwritten by other themes/plugins. Therefore, as of s2Member v3.5+, if you actually *want* to allow overrides by other plugins, you will need to remove s2Member's protection against this, by implementing the code I've given above.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 15th, 2011, 2:02 pm
by Vinnyo
Hey Jason,

I would love to use the `s2Member -> General Options -> Login Welcome Page`. option but this does not work for me for some reason????? I have the right information and even tried to other option and the login welcome page does not work for me.

I tried the above code but when I tried to login in I got a 404 error.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 15th, 2011, 2:19 pm
by Vinnyo
I guess a better thing then trying to overwrite other plugins is why is the S2memeber redirect not working when I have no other redirect plugins?


Thanks
Vince

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 15th, 2011, 2:33 pm
by Jason Caldwell
As of s2Member v3.5+, the only way to override s2Member's Login Welcome Page redirection is through the application of a hidden input field with the name: redirect_to ( a WordPress standard ). Some login widgets will use the special redirect_to variable ( passing its value to your /wp-login.php handler ). s2Member must always obey that parameter when it is passed through.

So it sounds to me like you might be using a theme or plugin that is passing the redirect_to variable, and thereby forcing a redirection to a pre-determined URL on your site. Either that, or you may have a plugin that is attempting to compete with s2Member in some way that is ultimately creating a conflict.

I would start by attempting to log into your site as a Level #1 Member, from the default location:
Code: Select all
http://www.yoursite.com/wp-login.php

If that does NOT redirect you to the Login Welcome Page, try disabling other plugins until it does. This will help you find the culprit. If you find the culprit, please try to report back so we can have a closer look. It might be something we can help you with; making it possible for the two plugins to co-exist.

If disabling all plugins does not work, try using the default Twenty Ten theme.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 15th, 2011, 2:49 pm
by Jason Caldwell
I have also posted some additional detail here:
viewtopic.php?f=36&t=2697

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 18th, 2011, 5:47 pm
by Vinnyo
Hey Jason,

So have attempted everything to try to get the S2memeber redirect but it seems nothing I have done is working.

I have thought that maybe downgrading to a lower WP version would be a good idea but it is my worst fear to have my site attacked since all users rely on my service to work.

I tried what you suggested with the hack code but got script errors. Maybe I did it wrong.

Would it be possible to have you look at my c-panel and see if you see something. You know S2memeber the best versus myself who has spent countless hours trying anything to get a redirect to work.

Let me know if this is something you can do.

Thanks
Vince

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 18th, 2011, 11:15 pm
by Jason Caldwell
Vinnyo wrote:Would it be possible to have you look at my c-panel and see if you see something. You know S2memeber the best versus myself who has spent countless hours trying anything to get a redirect to work.
Yes, please send me a Dashboard login and FTP access through this form.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 19th, 2011, 12:18 am
by Vinnyo
Thanks Jason,

Info sent

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 23rd, 2011, 1:15 am
by Jason Caldwell
Thank you. Investigating now.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 24th, 2011, 4:22 pm
by Vinnyo
Hey Jason,

Have you had a chance to see what the issue is with that redirect. Just checking.

Thanks
Vince

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 24th, 2011, 4:51 pm
by Jason Caldwell
Vinnyo wrote:Hey Jason,

Have you had a chance to see what the issue is with that redirect. Just checking.

Thanks
Vince

Hi Vince. Thanks for the reply.

I've tried to email you a few times, but I think we have some barrier between us regarding email. Whenever I went to investigate this, I was unable to locate the email that you said you sent over. I've emailed you a couple times regarding this, but I suspect they are not making it back to you. Please try again using our contact form; possibly from a different email address. Once the email is sent, please update this thread so I'm aware of any additional conflicts that may arise.

Thanks in advance for your patience.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 25th, 2011, 2:38 pm
by Vinnyo
Jason,
I posted that info again for you.
I thought I made another post yesterday here but for some reason it did not take.

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 27th, 2011, 5:04 am
by Jason Caldwell
Hi Vince. Thanks for getting back with me again.
~ I received your email this time!

Video
OK, I've done a quick video covering the way you can fix this problem.
http://www.s2member.com/login-welcome-p ... cts-video/

Re: Login Redirect Not Working - Need Help Fast

PostPosted: March 28th, 2011, 5:29 pm
by Vinnyo
Hey Jason,

Thanks for the video. However this still did not fix my problem????? I sent you another email with the bulletarticles@gmail.com email.

Let me know if you got it. I have placed some questions in there.

Thanks
Vince

Thanks Vince. I got your email. I just took another look at your site. That hidden redirect_to variable is still in your site. You might take another look at your theme files and make sure you've removed all occurrences of that variable. Also, be sure that you reset any WordPress® caching plugins after making those changes. For instance, if you're running Super Cache or Quick Cache, please clear your cache after making theme changes.