I am trying to setup a login to an smf forum on pages outside of the forum. To do this I am using the smf ssi function ssi_login(). When I use the login form it creates, it sends me to the forum start page and logs me in. But I would like it to keep the user on the current page they are logging in from. In the ssi docs it says to pass in the link to have it redirect to where you want. So I created the following snippet to try and get this done:
include_once("forums/SSI.php");
$curId = $modx->documentIdentifier;
$currentPageLink = $modx->makeURL($curId);
if($user_info['is_guest']) {
ssi_login($currentPageLink);
} else {
//User info
ssi_welcome();
echo '<br /><br />';
ssi_logout($currentPageLink);
}
This still takes me straight to the main forum page after logging in though. I tried hard coding the page into the function call and that didn’t work either. The one thing I did find in the smf forum was to set $_SESSION[’login_url’] equal to the page link, but that did not work either. After looking some more around the smf forums I have not been able to find any clues on how to fix this and was wondering if anyone had this working with modx. I also get the following error when I click the logout link on my test page:
Session verification failed. Please try logging out and back in again, and then try again.
I have tried many of the other functions and they work, and the login works just not with the redirect. So I’m not sure if it may be a something in modx or in smf that is keeping me from using these.
I am going to try to find some more info over on the smf site but thought I would post it here incase anyone had a like experience.
Kyle
I am using modx .9.2.1 and smf 1.1RC2