In the past few years I've set up and used MediaWikis for various open source related activities, for instance linux.conf.au 2008 and Linux Users of Victoria. Both of these would be prime targets for wikispam if anyone could anonymously edit pages on them, so edit privileges are limited to registered users only.
Normally a wiki would allow anyone to create an account, but because LCA has a registration system and LUV has an existing website with user info, there is existing authentication information we could use to limit access to these wikis.
Luckily MediaWiki allows you to use external authentication providers. It comes with the skeleton file include/AuthPlugin.php, which you can modify, rename and then use. For LUV, I hacked it up a bit so it can be used as a generic Drupal one; AuthPluginDrupal.php.
If you want to use it, download it and save it to the extensions directory in your MediaWiki installation. You'll need to change the MySQL authentication settings at the top of the class definition, so that it can access your Drupal users table.
Next, tell your wiki to use it by adding it to LocalSettings.php:
require_once('extensions/AuthPluginDrupal.php'); $wgAuth = new AuthPluginDrupal();
Now any active Drupal user can login to your wiki. The email address that's set in Drupal is automatically transposed, so even the wiki mail functions work fine.
Attachment | Size |
---|---|
AuthPluginDrupal.php.txt | 7.96 KB |
Comments
Just wondering, did you know
Just wondering, did you know of http://www.mediawiki.org/wiki/Extension:AuthDrupal ? Or did it not work for you?
Re: Just wondering, did you know
Hmm, no... I had no idea. That looks even more helpful :-)
Unfortunately, as stated "Not
Unfortunately, as stated "Not yet tested with MediaWiki 1.12 or Drupal 6".
I did find a Media wiki drupal module though, which I found through the MediaWiki discussion of that plugin. It's fairly recent and I'm going to give it a shot.
http://drupal.org/project/mediawikiauth
wow, thanks
Thank you for posting this extension. I needed to do a Mediawiki -> Drupal integration, and this saved me a LOT of time. Nicely done!
Re: mediawiki with drupal authentication
Thanks a lot, that help me to port the extension to mybb forum!!
Add new comment