I would really like to find some way to integrate my drupal users with those for mediawiki. Has anyone already accomplished this? I couldn't find anything in the forums. I do see that someone has found a way to do this with phpBB. Any takers on a port of something similar for drupal?

Here is more info about the phpBB integration work ...
http://217.160.138.71/development/index.php?title=Auth_phpBB

Comments

halr9000’s picture

I've been trying to work on something similar. I'd actually prefer to use Drupal for the wiki, but so far what I've seen of using drupal-as-wiki isn't exactly what I want. I do have a mediawiki installation, but I dread having another user database in the mix.

matt_paz’s picture

I'm guessing that I may have to bite the bullet and synch another round of username/passwords with another database, but it sure would be nice to use just one.

rport’s picture

I have recently posted an offer to donate to a MediaWiki module.

The offer still stands.

I would be happy to work with a keen developer to build a new Wiki node for Drupal.

Feel free to offer your suggestions.

Russ

Boris Mann’s picture

I believe the interwiki module uses the same DB table as MediaWiki.

And what is meant by "integration"? MediaWiki "nodes" with the same markup language? Shared user tables? etc. etc.

matt_paz’s picture

Personally, I would love to see shared user tables as a starting point.

Jason Thompson’s picture

I, too, would love shared user tables.

Souvent22’s picture

I think synced user tables would be better; By a shared user table, you're making drupal and mediawiki co-dependant instad of independant. Thus, one changes the structure of their user table, so much the other.

tazzytazzy’s picture

I was having this same issue. I spent about an hour today and wrote a MediWiki extension on how to do this. I posted it our Wiki for all.. Please see:

http://wiki.dccforall.com/DCCWikiPedia_AuthDrupal.php

This is a simple authentication extension which makes a call to a Drupal database to lookup a user.

Let me know if it works or not for you. Would like to hear back.

dgeilhufe@yahoo.com’s picture

The script works great and the instructions are good. Now how can I get drupal to do the mediawiki login when a user logins into drupal? ;)

David Geilhufe
Social Source Foundation
Try CiviCRM http://www.openngo.org/

tazzytazzy’s picture

Thanks! I'm glad it's working for you.

I took a quick peak at that tonight. The problem is, i have a subdomain for the wiki versus a sub directory.

I'll look into tweaking the cookie stuff. Using mouse jestures in firefox, i can quickly see the cookies set by the various sites. The drupal uses the top level (dccforall.com) i guess, while the sub site uses a seperate cookie subdomain. After I figure out how to tell mediawiki to use the dccforall domain instead of wiki.dccforall (.com), i'll work on this.

If you know how, let me know. :-) I need the mediwiki wiki to read the "PHPSESSID" cookie in another domain level... any ideas??? If you can tell me that....

tazzytazzy’s picture

Added a single (well, one LONG one split up) that makes a simple call to the drupal database that updates the timestamp for the last log in session.

You'll now need change access to the drupal site from the mediwiki users...u can restrict this to the user table if u wish for security reasons.

tazzytazzy’s picture

The old version (as of this morning) created new accounts for various user casing (uppercase/lower) etc. This is not good as user:Jeff is different from user:jEFF... This is now fixed, and uses the casing as set in drupal.

Also, i disabled the template stuff via the class, so you'll need to revert several changes back to stock (ya - makes updating mediawiki easier). Now, there is only ONE line to the core code that needs to be changed - comment out password changing capabilities. There are now more settings on the AuthDrupal.php.

I'm still working on the cookies/cross authentication. I have the cookie issue all figured out, but still working on where to access the session information.

Update: http://wiki.dccforall.com/DCCWikipedia_Authentication

Notice the instructions are MUCH shorter... (read: easier).

-Mitch
http://www.dccwiki.com/

dgeilhufe@yahoo.com’s picture

Tazzy-
Really appreciate the contribution. I wish my programming skills were better to help on the session issue.

There seems to be some references to it on the web:
http://www.gossamer-threads.com/lists/wiki/mediawiki/50219

David Geilhufe
Social Source Foundation
Try CiviCRM http://www.openngo.org/

tazzytazzy’s picture

http://wiki.dccforall.com/DCCWikipedia_Authentication

It should work with Drupal 4.6.6 as the drupal module is very simple.

The new version uses more MediaWiki hooks so there is is less mediawiki core code hacks, as compared to 1.5. MediaWiki offers more hooks. :-)

tazzytazzy’s picture

Just updated my drupal 4.6.6 and the mediawiki auth still works.

jase951’s picture

Does this module work with 4.6.0?
I tried it out but when I tried to login a mysql error appeared saying that there is a problem with AuthDupal.php.

Also, on http://wiki.dccforall.com/DCCWikipedia_Auth_-_Drupal.php at the end of the script there is <pre> is this supposed to be left out?

Anyone ideas?

Eliyahu’s picture

1. Does this work with with 4.7?
2. Its a real shame that drupal does not have wiki. Has there been any progress on this?

tazzytazzy’s picture

Looking at the changed between 4.6 and 4.7 for this module, it doesn't appear there will be anything to change. I'll try to upgrade to 4.7 tonight, I'll update the webpage (http://wiki.dccforall.com/DCCWikipedia_Authentication) with any changes.

As far as a wiki for drupal. There are a couple of simple ones, I don't think anything nearly as advanced at MediaWiki. If anything, there would be a module that integrates mediawiki more into drupal - much like the Menalto Gallery or my smugmug module does for smugmug.

I'll post again once I'm done with this.

simillibus’s picture

Has anyone modified the MediaWiki integration module to work with Drupal 4.7?
I've been playing with it, & cannot get it to work - there appears to be a database incompatability.
- will

thinkling’s picture

I started with tazzytazzy's code from his wiki, and with some code changes I've now got Drupal working as the sign-in front end for the wiki. User signs in to Drupal, and when they visit the wiki they're automagically signed in there. Creating new users seems to work.

I had to make a bunch of changes to the code to get it working, and am happy to share the result. I don't yet have a stable site to put it up on, and there may be more changes as I make progress and test, but feel free to contact me through my profile here if you'd like to get the files from me in the mean time.

Things I updated include:

Necessary:

  • fixing occurrences of hard-coded domain names in calls to setcookie()
  • code that sets the user table name (drupaluserstbl) didn't work for me. I made it so the db/table/etc can be set in LocalSettings.php and AuthDrupal constructor gets them out of $GLOBALS
  • code that creates new mediawiki user was broken; fixed it.

Optional

  • added support for having Drupal in a separate database from MW (just creates a different Database object, most of the code remains the same and remains portable)
  • removed explicit calls to $crypto->_destruct() that produced warnings from Drupal when signing in
  • function drupal_logit in Drupal.php is obsolete and can be removed
  • call to setcookie() in Drupal.php seems unnecessary & can be removed?

Cheers,
/Maarten.

thinkling’s picture

Hi folks,

I've reworked the code a fair bit and have the login integration working for MediaWiki 1.9.x and Drupal 4.7.x. I've arranged it so users have to sign in through Drupal and cannot sign in using MW's login form.

The code and documentation are both posted here:
http://www.mediawiki.org/wiki/AuthDrupal

Hope this works for you,
/Maarten.

tazzytazzy’s picture

I've no use for this module any more since I'm no longer using Drupal and MediaWiki - I'm using only MediaWiki now.

If anyone wants to maintain it, feel free - just leave my name as the original author is all I ask.

Looking at the API for 4.7 vs 4.6, the module should work fine with 4.7 as well.

BryanSD’s picture

It looks like I'm a day late in seeing how you worked Drupal in with MediaWiki. A group of IT members in my organization has been debating whether to use Drupal, mediaWiki, or both for an "IT Portal". We're hoping the IT portal to help with project/task management, software development, and documentation. I was just curious to where you felt MediaWiki fell short and why you needed Drupal as part of the equation?

Thanks,

Bryan
CMSReport

tazzytazzy’s picture

Primarily, because I wanted a forum to discuss the DCCWiki or whatnot. We've found that we don't need it and that the discussion pages within MediaWiki are sufficent for our needs.

Perhaps for you, if you have project management tools within Drupal, that may be better than having a free-for-all Wiki for assigning/tracking tasks. Also, there are free project management PHP tools out there if you can't find a Drupal module. I set one of these up for college for our project and worked great. Share files, message board, contact information, time lines, mile stones, etc.

For software developement, you might want to check out bugzilla (here's one running for mediawiki: http://bugzilla.wikimedia.org/). Perhaps your solution could be:

Main site: www.company.com - MediaWiki for documentation, notes, information, discussion
Bugzilla: bugzilla.company.com - Allow users or some method to take bug reports. Then track those bugs, etc.
Project Managemnet: pm.company.com - Milestones, time lines, etc.

I believe there is a bug tracker module for Drupal, not sure how indepth it is. Not sure about a project management solution within Drupal. If there is, then perhaps integrating the two would be a smart move. Perhaps there are other modules within Drupal that you could also take advantage of.

The other problem you are going to want to deal with is user management. Have three tables with usernames/passwords will be cause for headaches. Usually, you will have to write/modify code to make one system access the other systems user tables. Or some way keeping the tables in sync. I know it's possible for Drupal/MediaWiki at least.

Sorry, i cannot guide you any further. Just provide food for thought it all..

- Mitch Schwenk

BryanSD’s picture

Thanks for the reply Mitch. Some things to consider...

-Bryan

dan_aka_jack’s picture

Hi folks,

I was just wondering: have there been any updates? I'm keen to build a site which uses MediaWiki and Drupal (mostly for the forum). I'd like to use the most recent versions of the two applications.

Thanks,
Jack Kelly
UKfilm.org - Advice, Discussion and News for the UK filmmaker

jmdoren’s picture

I´m starting a projet on sourceforge to share users and password between different popular software system as mediawiki ans phpbb

please visit ( and join ) it in mrPassMan

lonelytrail’s picture

I have Drupal and multiple MediaWikis setup as a work communications portal doing News, Forums, etc. (Drupal) and LessonsLearned, DevelopersCoops, etc (mediawiki) and they all authenticate via a single mechanism... LDAP.
Both have LDAP authentication modules/extensions and both work well enough.

LDAP is a commonly used tool that is free.
I guess, this just implies you have sufficient priviledges to create/use an LDAP directory.

Drupal: http://drupal.org/project/ldap_integration
MediaWiki: http://meta.wikimedia.org/wiki/LDAP

Also, MediaWiki now has a module that allows it authenticate against a Drupal 4.6/4.7 site.
http://meta.wikimedia.org/wiki/Emu

As a third option, a Drupal module offers http authentication. That allows the use of kerberos to authenticate to a foreign database as another alternative. I'm not sure how mediawiki would satisfy using http for authentication requests.
http://drupal.org/project/httpauth

.htaccess
============
AuthType Kerberos
AuthName "MyDrupalSite: Authorized Users only"
KrbMethodNegotiate Off
KrbAuthRealms EXAMPLE.COM
KrbVerifyKDC off
Require user lonelytrail@EXAMPLE.COM
=======================

thinkling’s picture

Hi Lonelytrail,

To clarify, does the solution based on LDAP also provide for a single signin? i.e. once you sign into one of your apps (Drupal or wiki), are you signed in to all of them? Or does it integrate the user DB but require users to log in more than once?

Thanks.

Maarten.

cody.ray’s picture

I haven't tried it, but I don't believe single signon will work out of the box, as both mediawiki and drupal set their own cookies with differing names. Also, as one gentleman above reported, if your site has one of these applications on a subdomain (in, wiki.example.com), then you also have to cope with cross-domain cookie problems. However, with hooks, patches, etc into the various cookie handling subroutines, this should be (fairly) simple to accomplish.

Cody Ray

deepvoice’s picture

Now up and running on Drupal 6.1 and I am getting requests to integrate an existing MediaWiki site to the Drupal site (So users don't have to go two places).... anyone have a MediaWiki and Drupal 6 integration working?

-D

arhak’s picture

subscribing

Kasper Souren’s picture

I wrote a module for Drupal 6 that authenticates from a MediaWiki (1.9 and higher) database. It needs some work, though you can find it in cvs.
I also want to write a module that allows integration of content from MediaWiki into Drupal.

Of course, monetary incitements could speed up my work :)

vkr11’s picture

plastique’s picture

And looking to revive the topic.

Where can I get that Drupal 6 code you've mentioned before?

kobnim’s picture

subscribing

singalen’s picture

I believe you can use AuthDrupal, if you want Drupal to act as a login master;
6.x version here.

Or DrupalIntegration - and have MediaWiki as a login master.

guignonv’s picture

Hi there! If people are still looking for a solution, you might have a look to mine:
http://groups.drupal.org/node/1596#comment-87257

Instead of integrating MediaWiki into Drupal, I did some scripts to import the content of a MediaWiki inside a Drupal 6.
Basically, you export your MediaWiki in XML and you import it under Drupal. If you want to keep the contributors of each page, there is a way to do it (if the same users have a login under Drupal). Once the importation is done, the contributors will use Drupal interface instead of the Wiki one but I don't think it's a big deal since they can keep using Wiki tags.

Valentin Guignon, Bioversity International