DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

auth:mysql_nuked-klan

« MySQL Authentification Backend

Nuked Klan

Use this basic SQL statements in your mysql.conf.php

/***********************************************************************/
/*       Basic SQL statements for user authentication (required)       */
/***********************************************************************/
 
/* This statement is used to grant or deny access to the wiki. The result
 * should be a table with exact one line containing at least the password
 * of the user. If the result table is empty or contains more than one
 * row, access will be denied.
 *
 * The module access the password as 'pass' so a alias might be necessary.
 *
 * Following patters will be replaced:
 *   %{user}	user name
 *   %{pass}	encrypted or clear text password (depends on 'encryptPass')
 *   %{dgroup}	default group name 
 */
$conf['auth']['mysql']['checkPass']   = "SELECT pass
                                         FROM nk_users AS u
                                         WHERE pseudo='%{user}'";
 
/* This statement should return a table with exact one row containing
 * information about one user. The field needed are:
 * 'pass'  containing the encrypted or clear text password
 * 'name'  the user's full name
 * 'mail'  the user's email address
 *
 * Keep in mind that DokuWiki will access this information through the
 * names listed above so aliases might be necessary.
 *
 * Following patters will be replaced:
 *   %{user}	user name
 */
$conf['auth']['mysql']['getUserInfo'] = "SELECT pass, pseudo AS name, mail
                                         FROM nk_users
                                         WHERE pseudo='%{user}'";
 
/* This statement is used to get all groups a user is member of. The
 * result should be a table containing all groups the given user is
 * member of. The module access the group name as 'group' so a alias
 * might be necessary.
 *
 * Following patters will be replaced:
 *   %{user}	user name
 */
$conf['auth']['mysql']['getGroups']   = "SELECT niveau as `group`
                                         FROM nk_users
                                         WHERE pseudo='%{user}'";

remind to replace the table prefix (here nk_) with yours.

a local.php for example

$conf['title'] = 'Documentation Nuked-Klan';
$conf['start'] = 'accueil';
$conf['lang'] = 'fr';
$conf['baseurl'] = 'http://docs.nuked-klan.org/';
$conf['dformat'] = 'd/m/Y H:i';
$conf['useacl'] = 1;
$conf['authtype'] = 'mysql';
$conf['passcrypt'] = 'md5';
$conf['superuser'] = '@9'; //admin level 9 in nuked-klan are super users in DokuWiki
$conf['manager'] = '@2'; //admin level 2 in nuked-klan are managers in DokuWiki
$conf['openregister'] = '0';
 
@include(DOKU_CONF.'local.protected.php');
 
require_once('mysql.conf.php');

note the 2 lines relative to the admin level

auth/mysql_nuked-klan.txt · Last modified: 2011-03-22 17:31 by Aleksandr