News:

Wondering if this will always be free?  See why free is better.

Main Menu

Login Redirect not working, SSI

Started by Noctys, April 22, 2008, 03:53:56 PM

Previous topic - Next topic

Noctys

I am using SMF 2.0-B3 as the login system and forums for the site I am building. Everything is working fine (including the logout redirect) except for the login redirect. I have seen this issue in several other posts but never a good solution. When someone logs in the always go back to SMF index.

Assuming that all my code is correct is there something else I could be missing? 

If not is there a place in the theme that may be overwriting it? I am using a copy of the default theme and only changed the CSS file.

Lastly is there someplace in the code for SSI or the forums where I can make my main sites index the default goto location.

Thanks...  Notes on what I have already tried below...






I have tried putting the redirect directly into the function call: ssi_login('hxxp:mywebsite.com/login.php'); [nonactive]

also: $_SESSION['login_url'] = 'hxxp:mywebsite.com/login.php'; [nonactive]

also edited the LogInOut.php from: redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);

to: if(!empty($_SESSION['login_url'])){
redirectexit($_SESSION['login_url']);
}
    else {
redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
}


and back again to make sure that didn't break something.

I have tried everything I can think of.

Noctys

Solved it myself.  Not sure if this is a bug or not but it seems to be.  In the LogInOut.php I changed:

// Beyond this point you are assumed to be a guest trying to login.
if (!$user_info['is_guest'])
redirectexit();


to:

// Beyond this point you are assumed to be a guest trying to login.
if (!$user_info['is_guest'])
redirectexit($_SESSION['login_url']);


Hope this helps other people running into the same issue.  Not sure if this is a good fix, but it works for me.

RichieEVG

Thank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank youThank you thank you thank you

Advertisement: