« MySQL Authentification Backend

e107

User authentication with e107.

Tested on

This assumes that all user accounts will be created and maintained through e107.

Remember: First configure DokuWiki to use MySQL as "authtype" with password encryption "passcrypt" set to “mysql” or “my411” (depending on the version of your MySQL DB). You can do this either by editing local.cfg or via the configuration manager of DokuWiki.

Optionally, change the table prefix in the queries below (I have used the e107 default “e107_”).

$conf['auth']['mysql']['TablesToLock']= 
      array("e107_user", "e107_user AS u", "e107_userclass_classes");
 
$conf['auth']['mysql']['checkPass']   = 
     "SELECT user_password AS pass
      FROM e107_user
      WHERE user_loginname='%{user}'";
 
$conf['auth']['mysql']['getUserInfo'] = 
     "SELECT user_password AS pass, user_name AS name, user_email AS mail
      FROM e107_user
      WHERE user_loginname='%{user}'";
 
$conf['auth']['mysql']['getGroups']   = 
     "SELECT userclass_name as `group`
      FROM e107_user, e107_userclass_classes
      WHERE FIND_IN_SET(e107_userclass_classes.userclass_id, e107_user.user_class) <> 0
      AND e107_user.user_loginname='%{user}'
      UNION
      SELECT 'admin' AS  `group`
      FROM e107_user AS u
      WHERE user_admin <> 0
      AND user_loginname='%{user}'
      UNION
      SELECT 'user' AS `group`";

Notes

Geert Janssens 2008/10/05 14:53