Integrate Dokuwiki with SMF

1.09.2009

I recently needed an integration of Dokuwiki with SMF (Simple Machines Forum). After some research i managed to get it done. Inspired by this thread.

I tested this with SMF 2.0 RC1.2 and DokuWiki 2009-02-14b.

  1. Download and install both SMF and Dokuwiki. I separated them using a /forum and a /wiki directory.
  2. Get the file smfauth.class.php (version 0.3) from here and put it inside your wiki/inc/auth/ directory
  3. Do the following changes in your smfauth.class.php file:
    find all instances of memberName and change to member_name
    find all instances of realName and change to real_name
    find all instances of emailAddress and change to email_address
    find all instances of groupName and change to group_name
    find all instances of additionalGroups and change to additional_groups
    find all instances of dateRegistered and change to date_registered
    find all instances of posterEmail and change to poster_email
    find all instances of ID_GROUP and change to id_group
    find all instances of ID_MEMBER and change to id_member
  4. Edit the line in your smfauth.class.php file where it says “MODIFICATION REQUIRED” (Line 32), and include the absolute path to your forum/Settings.php file
  5. Edit the file wiki/conf/local.php and change the setting for $conf['authtype'] to ‘smfauth’
  6. Edit line 78 in smfauth.class.php and do the following change:
    change
    AND (concat(',',u.additionalGroups,',') LIKE concat('%,',g.id_group,',%') OR u.id_group = g.id_group)";
    to
    AND (concat(',',u.additional_groups,',') LIKE concat('%,',g.id_group,',%') OR u.id_group = g.id_group OR u.id_post_group = g.id_group)";
  7. Edit the file wiki/conf/local.php and change the setting for $conf['superuser'] to the name of the superuser group in SMF (@Administrator in german, i’d guess it’d be @Admin in the english version)
  8. Add the following line to your wiki/conf/local.php file:
    $conf['auth']['mysql']['charset'] = 'utf8';
  9. You should now be able to log in using your SMF superuser. Now add correct permissions for the group ‘Newbie’ (case sensitive) in your Dokuwiki access control

I think that’s it, i hope i didn’t forget anything. If you have any questions, feel free to comment.

Kommentare

In 6th task you should consider the change from “u.additionalGroups” to “u.additional_groups”…

what about private group wiki pages? will this work? does dokuwiki know about smf membergroups? Thanks!!!

@Matjaz: Thanks for the hint, sorry – I somehow overlooked your comment.

@Snaky: Sorry for the late answer. Yes, Dokuwiki does seem to know about private SMF membergroups. But I don’t think it applies any permissions (as that wouldn’t make sense anyways ;) ).

Do you maintain this any longer?
I’m trying to get this to work with dokuwiki-2009-12-25c.tgz & SMF 2.0 RC3. It always says username or password are wrong. :-(

@fuuuuuuuuu: I updated step 6: I had some things wrong with capitalization that should be fixed now, but I don’t know whether that will fix your issue. Make sure that you did every step as described in here.

If that won’t fix your issue, consider downgrading to the versions I used, or asking the author of the smfauth class (link) whether he knows any solution.

Ok, I got it. It works but only for users who don’t have Umlauts in their username. I have members with ü, ö, ä in their name, they can not login….

@fuuuuuuuuu: Ah. This probably has to do with encoding, as SMF uses the latin1 charset and Dokuwiki uses UTF8 by default.

I tried messing with utf8_decode in the Dokuwiki auth.php, but didn’t manage to get the problem solved yet. And I currently don’t really have time to take a deeper look at this :) You might contact the author of the smfauth class, or maybe the related thread in the smf forums can help you. http://forum.dokuwiki.org/thread/2161

Cheers

Thx for your help.
I’m doing a more pragmatic approach: rename the users, so they don’t have any more Umlauts in their name. :-D This is a small and private Wiki with only a few users, so no problem.

That’s also a solution ;)

Hinterlasse einen Kommentar

Dein Kommentar:

XHTML: Sie dürfen folgende Tags verwenden: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Kategorien