DokuWiki

It's better when it's simple

User Tools

Site Tools


auth:mysql_nuked-klan

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
wiki:auth:mysql_nuked-klan [2007-08-02 02:28] 82.237.148.2auth:mysql_nuked-klan [2008-12-09 20:39] 70.103.232.219
Line 1: Line 1:
 +Use this basic SQL statements in your mysql.conf.php
  
 +<code 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}'";
 +</code>
 +remind to replace the table prefix (here nk_) with yours.
 +
 +
 +a local.php for example
 +<code php>
 +$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');
 +</code>
 +note the 2 lines relative to the admin level

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki