DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:authmysql:fudforum

FUDforum

Configuration for authMySQL Auth plugin for authentication with FUDforum, which let's do:

  • Only basic authentication
  • No user modification/adding. This assumes that all user accounts will be created and maintained through FUDforum.

Tested on FUDforum version 2.7.6.

Configuration

Use the Config Manager or add it to the conf/local.protected.php to store the config protected.

Newer FUDforum Versions uses fud26 as table prefix.

conf/local.protected.php
<?php
/**
 * FUDforum database configuration for MySQL Auth Plugin
 * http://fudforum.org/
 * See https://www.dokuwiki.org/plugin:authmysql:fudforum for details and explanation
 */
 
/**
 * Activate MySQL auth plugin
 */
$conf['authtype'] = "mysql";
 
/**
 * Set the signature for all users
 *
 * This signature will link to the user's FUDforum profile. To make this work
 * correctly, add the following line to the conf/interwiki.conf file. Be sure
 * to replace "forum.example.org" with the hostname for your FUDforum 
 * installation. You may need to modify the path to index.php if you installed
 * FUDforum in a directory other than root. This also assumes you have 
 * PATH_INFO style URLs turned on in FUDforum.
 *
 *   user      http://forum.example.org/index.php/u/{PATH}/
 *
 * If you are not using PATH_INFO style URLs in FUDforum, use the following 
 * format in interwiki.conf:
 *
 *   user      http://forum.example.org/index.php?t=usrinfo&id={URL}
 *
 * Note that this relies on the getUserInfo query below that stores the user
 * id in the `mail` field instead of the actual e-mail address.
 */
$conf['signature'] = '//[[user>@MAIL@|@NAME@]] @DATE@//';
 
/**
 * Database connection parameters; change these for your environment
 */
$conf['plugin']['authmysql']['server']   = '';
$conf['plugin']['authmysql']['user']     = '';
$conf['plugin']['authmysql']['password'] = '';
$conf['plugin']['authmysql']['database'] = '';
 
/**
 * Send password in clear text to database
 */
$conf['plugin']['authmysql']['forwardClearPass'] = 1;
 
/**
 * Authenticate user by checking password
 */
$conf['plugin']['authmysql']['checkPass']= "SELECT passwd as `pass`
                                            FROM fud_users
                                            WHERE login='%{user}' 
                                            AND passwd=MD5('%{pass}')";
 
/**
 * Get user info
 *
 * Note the use of "id AS `mail`". Instead of retrieving the user's email
 * address, I'm getting the ID for use with the user's DokuWiki signature
 * (see note on $conf['signature'] above). If you do not wish to use this
 * signature and would rather get the e-mail address, use "email" instead of
 * "id" in the query below.
 */
$conf['plugin']['authmysql']['getUserInfo'] = "SELECT passwd AS `pass`, login AS `name`, id AS `mail`
                                               FROM fud_users
                                               WHERE login='%{user}'";
 
/**
 * Get groups to which user belongs
 *
 * Note the use of the UNION. This allows all registered users to be a member
 * of the default group (as defined in $conf['defaultgroup']) without the 
 * need to create a new group in FUDforum. Other groups may be created in 
 * FUDforum for "admin," etc.
 */
$conf['plugin']['authmysql']['getGroups'] = "SELECT fud_groups.name AS 'group'
                                             FROM fud_groups, fud_users, fud_group_members
                                             WHERE fud_users.id = fud_group_members.user_id
                                               AND fud_groups.id = fud_group_members.group_id
                                               AND fud_users.login='%{user}'
                                             UNION 
                                             SELECT '" . $conf['defaultgroup'] . "' as `group`";
?>

Ben Ramsey 2007-03-12 16:39

plugin/authmysql/fudforum.txt · Last modified: 2013-02-10 00:54 by Klap-in