Extension:SMF AutoAuthenticate

Version Infomation

 * Extension: SMF Auto Authenticate
 * Forum: SMF (http://www.simplemachines.org/)
 * Version: 1.1
 * Released: 1/12/2007
 * SMF Version: 1.1.1
 * MW Version: 1.9.0

What this is
This causes users who are logged in to SMF to be (created if necessary and) logged in to the wiki. When the session expires or they logout via SMF, they will no longer be logged in to the wiki.

This is ideal for my situation since I desire tight user integration between SMF and MediaWiki, and I require users to be logged in to edit pages. My set of wiki users will be an exact subset of my SMF users, and the admin username is the same.

Requirements
- Working SMF that includes SSI.php (i.e. not the 1.0.x branch) - Working MediaWiki (I'm using 1.9.0 as of writing this)

Installation
1. Save Extension:SMF AutoAuthenticate/AutoAuthenticate SMFphp as AutoAuthenticate_SMF.php.

2. Put it into the MediaWiki "./extensions" dir

3. In LocalSettings.php add:

4. To suppress the wiki login/logout links, in main.css add:

Bugs

 * I'm not sure if the SMF idle timer resets correctly when looking at wiki pages.
 * If the session expires and the user is trying to do something on the wiki that requires authentication, MediaWiki will probably pop up the login page. I am not modifying that page right now, but I should be.  Ideally it should forward to the smf login page with the correct return URL.  I really don't know enough about MW yet to understand whether there's going to be "lost work" in this scenario.  I plan to test it out.
 * I ripped off some of the "user mapping" code from SMF Auth Lite Integration but didn't test it. In particular, my administrator names for SMF and MW are the same so I don't need to do remapping.  It's possible that my remap rip isn't working right at the moment.
 * Probably lots more. I am a newbie at both SMF and MW, so it's unlikely that I will have thought of all the contingencies.  I will try to shake them out in the future.

Fixes

 * AutoAuthenticate_SMF.php fixed by SpooK to support PHP5 (fixed object instance), confirmed to work on MW 1.9.0

Author contact
You can contact me at gbs-mw@10forward.com. If you make this better, or know of a better approach, please do me a favor and let me know!