Translations of this page?:

« MySQL Authentification Backend

Authorization with Simple Machines Forum

Basic auth module

You can use simple auth module to login to your DokuWiki with SMF database. Just download one of smf.class.php files below (for you SMF version) and put it into inc/auth/ directory of you DokuWiki installation and then select smf as authtype in DokuWiki settings manager.

Features:

  • Full support of usernames with non-ASCII symbols (if you use utf8 encoding in your SMF database)
  • Allow to login by email (like in SMF)
  • Full support of user's groups
  • Support of getting user's list at Doku admin page with simple filter
  • Doesn't support any operations, which modify SMF database

Requirements:

  • SMF 1.x or SMF 2.x
  • UTF-8 database in SMF (may be it will work with other encodings if you change appropriate line in module, but I can not guarantee it)

This module simply authenticate DokuWiki users in SMF database and it doesn't allow to modify or add users and groups.

For SMF 1.x:

For SMF 2.x:

Coming soon…

MalamutMalamut

2010/10/16 11:57

Old method

:!: You can't use non-ASCII logins with this method and this method doesn't consider additional user groups.

User authentication with Simple Machines Forum.

Tested with SMF 1.1.4 and DokuWiki version 2007-06-26b.

This assumes that all user accounts will be created and maintained by SMF. For user groups it selects only the first user group.

For admin account add the memberName from your *_members table in conf/local.php:

$conf['superuser']='%smfadmin_memberName'

Or (I found this easier) simply tell DokuWiki that you want people in the SMF Administrator group to be DokuWiki 'superusers' instead. — Chris Rowson 2008-02-16 00:35

$conf['superuser'] = '@Administrator';

Also change the table prefix in the queries below (here it is smfforum). If you don't have a table prefix omit everything up to and including the underscore.

$conf['auth']['mysql']['checkPass']   = "SELECT passwd
                                         FROM smfforum_members
                                         WHERE memberName = '%{user}'
                                         AND passwd = SHA1(concat(LOWER('%{user}'), '%{pass}'))";
 
$conf['auth']['mysql']['getUserInfo'] = "SELECT passwd AS pass, realName AS name, emailAddress AS mail
                                         FROM smfforum_members
                                         WHERE memberName = '%{user}'";
 
$conf['auth']['mysql']['getGroups']   = "SELECT groupName as `group`
                                        FROM smfforum_membergroups g, smfforum_members u
                                        WHERE u.memberName = '%{user}'
                                        AND u.ID_GROUP = g.ID_GROUP";
 
$conf['auth']['mysql']['getUsers']    = "SELECT DISTINCT memberName AS user
                                        FROM smfforum_members AS u
                                        LEFT JOIN smfforum_membergroups AS g ON u.ID_GROUP=g.ID_GROUP";
$conf['auth']['mysql']['FilterLogin'] = "u.memberName LIKE '%{user}'";
$conf['auth']['mysql']['FilterName']  = "u.realName LIKE '%{name}'";
$conf['auth']['mysql']['FilterEmail'] = "u.emailAddress LIKE '%{email}'";
$conf['auth']['mysql']['FilterGroup'] = "g.groupName LIKE '%{group}'";
$conf['auth']['mysql']['SortOrder']   = "ORDER BY u.memberName";

Mykhaylo Sorochan 2007-12-08 22:35

Old community auth Module

:!: You can't use non-ASCII logins with this module (at least in 0.3 version)

A community-developed Auth module for SMF and Dokuwiki integration, see this thread for download/discussion.

/**
 * SMF authentication backend for Dokuwiki v 2009-07-17
 *
 * @license    Creative Commons BY
 * @author     David Frank <bitinn@gmail.com>
 * @version    0.3
 * @base       for Dokuwiki 2009-02-14 + SMF 1.1.10
 *
 * Provide as an alternative to smf.class.php
 * Does not introduce new trustExternal() to verify user,
 * merely extends a few funtions from mysql.class.php
 *
 * Pros:
 *  allow user registration within dokuwiki
 *  allow full user managerment within dokuwiki
 *  dokuwiki handles login, avoid old smf_api
 *  (which causes extensive amount of frustration)
 *
 * Cons:
 *  one-click login integration will be difficult
 *  (currently users have to login wiki/forum seperately)
 *  user deletion within dokuwiki is not complete
 *  (see additional comment on delUserRefs)
 */
auth/mysql_smf.txt · Last modified: 2011/03/22 17:33 by Aleksandr
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate