Extension:Phpbb Single Sign-On

This is a single sign-on extension for MediaWiki and phpBB3. It does not use any funny tricks like curl or anything like that. It actually uses the phpBB sessions to do it all. When a user logs into the forum, they will be logged into the wiki. If a user logs out of the forum, they are logged out of the wiki.

The extension also replaces the wiki login and logout links with the ones from the forum.

This plugin is a hacked version of Extension:Auth_remoteuser. It was used as the base for this, I just replaced all needed code to be specific to phpBB.

This is very beta - Please make any edits to this code to make it better. I probably will not keep the code current, so please take control.

Its not working in version 1.27+. Check it here: Extension talk:Phpbb Single Sign-On

For version 1.27+ see the phpBB Auth Extension on Github.

How it works
So... This little guy, what he does is: When a user comes to the wiki, it checks to see if the user is currently logged into the forum. If not, nothing happens. If so, he then looks to see if the user is logged into the wiki. If the user is, then everything is good. If the user is not, he takes the session data from phpbb and logs the user in automatically to the wiki. If there is no such user on the wiki, he creates the user.

In &lt;wiki directory&gt;/LocalSettings.php
Place the following lines in your LocalSettings.php file:

The default for $wgPhpBBForumLocation (./../forum/) works if your site is setup like so:
 * example.com/forum
 * example.com/wiki

Be sure to change it if needed.

New Files
Create a folder in your MediaWiki extensions folder called phpBBSSO and save the following three files in there as phpBBSSO.php, phpBBUser.php and AuthRemoteUser.php.

Cookies
If the user has cookies turned off, they will probably find themselves in an endless redirection loop.

Backups
If your backups don't work, try setting the REMOTE_USER environment variable manually: