Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:/* Include Vanilla's People. Dokuwiki will overwrite these variables.
* NOTE: this must be the first line in the file */
@include(DOKU_CONF.'local.protected.php');
$conf['useacl'] = 1;
$conf['authtype'] = 'vanilla';
/* Grab DB info from Vanilla's conf */
$conf['auth']['mysql']['server'] = $Configuration['DATABASE_HOST'];
$conf['auth']['mysql']['user'] = $Configuration['DATABASE_NAME'];
$conf['auth']['mysql']['password'] = $Configuration['DATABASE_PASSWORD'];
$conf['auth']['mysql']['database'] = $Configuration['DATABASE_NAME'];
<?php
/* Integrating w/vanilla give all sorts inconsequential errors. For
* debugging purposes, comment out the next two lines */
error_reporting(0);
ini_set("display_errors", 0);
if(!defined('VANILLA_ROOT')) define('VANILLA_ROOT', '/path/to/your/vanilla/install');
require_once VANILLA_ROOT.'appg/settings.php';
require_once VANILLA_ROOT.'appg/init_people.php';
?>php<?php
/* allows all users to view wiki pages */
* @ALL 1
/* grant admin user all rights */
* @Administrator 16
/* grant member create & edit rights */
* @Member 8
?><?php
/**
* Vanilla Backend
*
* Adapted from Andreas Gohr's <andi@splitbrain.org> PunBB backend
* by Brent Shultz <bshultz@gmail.com>
*/
require_once DOKU_INC.'inc/auth/mysql.class.php';
class auth_vanilla extends auth_mysql {
/**
* Constructor.
*
* Sets additional capabilities and config strings
*/
function auth_vanilla(){
global $Configuration;
$this->cando['external'] = true;
$conf['passcrypt'] = 'md5';
$conf['auth']['mysql']['checkPass'] = "SELECT u.Password AS pass
FROM ${db_prefix}User AS u, ${db_prefix}Role AS g
WHERE u.RoleID = g.RoleID
AND u.Name = '%{user}'
AND g.Name = ('Member' OR 'Moderator' OR 'Administrator')";
$conf['auth']['mysql']['getUserInfo'] = "SELECT Password AS pass, u.Name AS name, Email AS mail,
UserID as id, g.Name as group
FROM ${db_prefix}User AS u, ${db_prefix}Role AS g
WHERE u.RoleID = g.RoleID
AND u.Name = '%{user}'";
$conf['auth']['mysql']['getGroups'] = "SELECT g.Name as `group`
FROM ${db_prefix}User AS u, ${db_prefix}Role AS g
WHERE u.RoleID = g.RoleID
AND u.Name = '%{user}'";
$conf['auth']['mysql']['getUsers'] = "SELECT DISTINCT u.Name AS user
FROM ${db_prefix}User AS u, ${db_prefix}Role AS g
WHERE u.RoleID = g.RoleID";
$conf['auth']['mysql']['FilterLogin'] = "u.Name LIKE '%{user}'";
$conf['auth']['mysql']['FilterName'] = "u.Name LIKE '%{name}'";
$conf['auth']['mysql']['FilterEmail'] = "u.Email LIKE '%{email}'";
$conf['auth']['mysql']['FilterGroup'] = "g.Name LIKE '%{group}'";
$conf['auth']['mysql']['SortOrder'] = "ORDER BY u.Name";
$conf['auth']['mysql']['getGroupID'] = "SELECT RoleID AS id FROM ${db_prefix}Role WHERE Name='%{group}'";
$conf['auth']['mysql']['TablesToLock']= array("${db_prefix}User", "${db_prefix}User AS u",
"${db_prefix}Role", "${db_prefix}Role AS g");
$conf['auth']['mysql']['debug'] = 0;
// call mysql constructor
$this->auth_mysql();
}
function trustExternal($user,$pass,$sticky=false){
global $Configuration;
global $Context;
global $USERINFO;
global $conf;
global $lang;
$sticky ? $sticky = true : $sticky = false; //sanity check
if ($Context->Session->UserID > 0) {
mysql_connect($Configuration['DATABASE_HOST'], $Configuration['DATABASE_USER'], $Configuration['DATABASE_PASSWORD']);
if ($CookieUserID == '') $CookieUserID = $Context->Session->UserID;
mysql_select_db($Configuration['DATABASE_NAME']);
$result = mysql_query('SELECT u.Name as Name, u.Password as Password, u.Email as Email, u.RoleID, g.RoleID, g.Name as GroupName FROM LUM_User as u, LUM_Role as g WHERE UserID='.$CookieUserID.' AND u.RoleID = g.RoleID');
while ($row = mysql_fetch_object($result)) {
$USERINFO['pass'] = $row->Password;
$USERINFO['name'] = $row->Name;
$USERINFO['mail'] = $row->Email;
$USERINFO['grps'] = array($row->GroupName);
$_SERVER['REMOTE_USER'] = $row->Name;
$_SESSION[DOKU_COOKIE]['auth']['user'] = $row->Name;
$_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;
}
mysql_free_result($result);
return true;
}
// to be sure
auth_logoff();
return false;
}
}
?>if(!defined('VANILLA_ROOT')) define('VANILLA_ROOT', '/path/to/your/vanilla/install');$conf['useacl'] = 1;<?php
/* allows all users to view wiki pages */
* @ALL 1
/* grant admin user all rights */
* @Administrator 16
/* grant member create & edit rights */
* @Member 8
?>$CookieUserID = @$_COOKIE[$Configuration['COOKIE_USER_KEY']];
$VerificationKey = @$_COOKIE[$Configuration['COOKIE_VERIFICATION_KEY']];if (($CookieUserID != '' && $VerificationKey != '')||($Context->Session->UserID > 0)) {if ($Context->Session->UserID > 0) {define('NOSESSION', true)error_reporting(0);$conf['superuser'] = '@Administrator';
$conf['disableactions'] = 'register,resendpwd,profile,login,logout';$conf['defaultgroup']= 'user'; //Default groups new Users are added to
$conf['superuser'] = '!!not set!!'; //The admin can be user or @group
$conf['manager'] = '@Moderatoren'; //The manager can be user or @group
/* Vanilla */
/* Mandatory */
define('NOSESSION', true);
$conf['authtype'] = 'vanilla';
/* Optional */
define('VANILLA_ROOT', '/home/orgaohnenamen_de/www/forum/'); /* This is the default */
$conf['acl'] = 1; /* You probably have this set already */
$conf['disableactions'] = 'login,logout,profile,register,resendpwd'; /* Now handled by Vanilla */
$conf['passcrypt'] = 'md5'; /* Not really necessary, set automatically by the authentication backend */php_flag magic_quotes_gpc Off
php_flag display_errors 0All default values are stored in a file called conf/dokuwiki.php. If you want to modify a setting you should do this in a file called conf/local.php – this makes sure your special configs are not overwritten by a later upgrade. The config manager will use this file as well.
-- taken from http://wiki.splitbrain.org/wiki:config