DokuWiki and WordPress 3.x Authentication Integration

This is version 2.0 of the DokuWiki and WordPress integration. The folks over at wordpress like to break things with their updates, so the old code to use DokuWiki and WordPress together no longer works. If you have wordpress 2.x, use the old code. If you have wordpress 3.x, read on.

First and foremost, this is a hack, and an ugly one at that. Instead of loading wordpress politely like in version 1.0, version 2.0 has it’s own hacked up wp-settings.php it calls to get what it needs and leaves the rest high and dry. It appears to work, but I haven’t tested it beyond simple logging in and posting on a vanilla install.

You really can’t get away with this one without the included files, so download the package and check out the readme. As always, if it stops working (or if you have an elegant solution instead of my horrible hack) leave a comment.

Download:
DokuWiki Wordpress Integration (442)

Leave a comment ?

10 Comments.

  1. Hi,

    I’m using wordpress 3.04 and the last stable version dokuwiki. With this version of the plugin I still get a error “Database connection error”.
    If I modify the wp-doku-setting.conf at line 97 and comment “wp_not_installed();”, I don’t hav the error but the sso doesn’t work.

    any idea ?
    Thanks

  2. > As always, if it stops working (or if you have an elegant solution instead of my horrible hack) leave a comment.

    This might become an interesting plugin for the WordPress and Dokuwiki community. Have you presented it at the WordPress forums ?

  3. This also works with WordPress 3.1 / DokuWiki 2010-11-07a if you change the following in wp-doku-settings.php:

    If you comment out/remove
    require( ABSPATH . WPINC . ‘/classes.php’ );
    as the file doesnt exist in WP3.1

    Then add:
    require( ABSPATH . WPINC . ‘/class-wp.php’ );
    require( ABSPATH . WPINC . ‘/class-wp-error.php’ );

    Things appear to work with no issues.

  4. WordpressDokuWiki Integration - pingback on March 28, 2011 at 12:39 pm
  5. Wordpress + DokuWiki Auth Integration - pingback on March 28, 2011 at 12:41 pm
  6. dave, I’ll try that, thanks !

  7. First of all, thank you for the new version of your dokuwiki integration :-)

    For those, who have problems with escaped quotes and stuff, I would recommend to comment out the following line in wp-doku-settings.php:

    wp_magic_quotes()

    But I stil lhave the problem that images aren’t shown in dokuwiki. If I disable the authentication via wordpress, the images are, where they are supposed to be, but with it, I only see the alternate text. Also, if I follow the link, I only get a blank page

  8. Hi yup I strongly recommand to comment out
    wp_magic_quotes();

    For your images problem did you check the access right ?
    For me everything work well.

    Thanks for this small hack ;-)

  9. Thanks for this great hack!

    With dave’s changes, it works with wordpress 3.3 and dokuwiki-2011-05-25a.

    I couldn’t find a license in the downloaded archive, are you ok to put the code+dave’s changes publicly on github?

    • @alexef: I’m definitely open to the code being available. I’m not sure what the license requirements would have to be since it is mostly existing wordpress and dokuwiki code. I’ll send you an email and we can figure it out.

Leave a Comment

Trackbacks and Pingbacks: