SMF and MediaWiki Bridge
After testing out both bridges currently available for SMF and MediaWiki I decided to write my own. Let me first go through what I liked and didn’t like about the existing bridges.
This bridge allows for auto authentication by using the smf_api.php. Due to the number of files required I did not test this bridge. I didn’t want to deal with the hassle when upgrading software down the road. Especially because SMF 2.0 database tables are different and I wasn’t sure if the smf_api.php would be updated.
From looking at the code if a user is demoted from the administrator position it does not remove him from the wiki sysop group. It is also lacking the ability to declare an SMF group that is only allowed to edit the wiki.
This bridge does not do anything with auto authentication. It does allow you to specify a SMF group that is allowed to edit the wiki. Another plus is that it is a single file. The downside is the configuration does not use the values from SMF’s Settings.php. You have to specify the database tables and permissions. It also doesn’t set wiki sysop privileges for SMF administrators.
I did test this one out and found a small issue where they did not disable the change password option in the wiki. This only requires a change of true to false, which must have been an oversight. Neither of these two bridges check to make sure the users are activated and not banned before logging them in.
The SMF and MediaWiki integration I built only requires one file placed in the wiki extensions directory. To get started you only need to configure the relative path to your SMF forum and the forum’s version. The version will either be 1.1 or 2.0 (which only applies to charter members as 2.0 has not been released). In the default configuration the wiki login is separate from the forum. It will assign and remove sysop privileges to SMF administrators and allow you to lock down editing to an SMF group. You can even supply additional groups to be granted wiki sysop privileges.
For the auto authentication I have decided not to use the smf_api.php file for the above reasons. When you click login / logout the wiki redirects you to the SMF page and then back to the wiki. A couple of gotchas are that you must be using SMF database sessions (default setting). You also need to configure SMF to make sure local storage of cookies are disabled. You might not need to do this if your wiki is inside your forum folder.
There are two known issues. The first involves the wiki’s limitation with user names containing an underscore. The wiki converts underscores to spaces. For example john_doe would become John doe. The workaround I implemented was to look for both the user name with spaces and underscores. The first registered SMF user name is used. If you happen to have a conflict you’ll need to change the later registered user name.
The second is when wgSMFLogin is disabled. If you register a new account from the wiki you will not be redirected back to the wiki as SMF does not have support for this in their code.
You can download the bridge from http://wgnrs.dynalias.com/smf/Auth_SMF.php