A pioneer? Really not sure if that is a good thing .....
Ok, here is the solution, or at least it is working for me.....
1. Place include to SSI.php as the first line in the Modx index.php file as follows:
<?php include_once(’forum/SSI.php’); ?> (assuming you have the SMF forum in a ’forum’ folder in your site root).
2. Replace all instances of $_SESSION[’login_url’] with $_SESSION[’smf_login_url’] in the following SMF files:
SSI.php
LogInOut.php
Security.php
SubsAuth.php
3. Create the following snippet called SMFlogin:
<?php
if ($ssi == ’ssi_login’){
return $ssi($_SERVER[’REQUEST_URL’]);
} else if ($ssi == ’ssi_logout’){
return $ssi(’
http://www.mydomainname.com/mylogoutpage.php’);
} else {
return $ssi();
?>
4. Place the snippet in the template using [!SMFlogin? &ssi=ssi_function!]
ssi_function being whichever ssi you want, such as ssi_login, ssi_welcome, etc. Revised this to allow multiple selections for flexibility - coded to specify a defined url on logout and to return user to current page on login - logout part works within the forum as well as from Modx pages.
I am not a coder, so no doubt this could be done better, but the above appears to work without problems: login from Modx pages that redirects the user to the page the user was on when logged in and a logout redirection to a page that I specify, which could be a ’goodbye user’ type of thing.
Hopefully the changes in the session will not cause any problems with SMF, but that should stop anything impacting upon Modx. Next I guess is to create a user in Modx when a user is created using the SMF registration sytem, including updating passwords etc.... Not sure if I am up to doing that.
Does the above make sense and can you see any potential problems? Seems to work if the goal is simply to use SMF for user management and to use ssi includes outside of the SMF forum.