You are not logged in.
- Topics: Active | Unanswered
#1 2008-05-08 16:41:12
- Connor
- Former Developer
- Registered: 2008-04-27
- Posts: 1,127
FluxBB Wiki
Hi all,
We have a wiki, which is currently lacking in content, if anyone wants to help out and add any missing pages (or improve current ones), that would be great ![]()
Offline
#2 2008-05-08 17:15:55
- jmp
- Member
- Registered: 2008-05-03
- Posts: 85
Re: FluxBB Wiki
Oh, it uses the FluxBB user database? Sweet. ![]()
Offline
#3 2008-05-08 18:31:45
- hcgtv
- Member

- From: Charlotte, NC
- Registered: 2008-05-07
- Posts: 419
- Website
Re: FluxBB Wiki
Connor,
Did you have to do something to Doku's PunBB authentication layer to work with the 1.3 code?
Bert Garcia - When all you have is a keyboard
Offline
#4 2008-05-08 18:39:32
- Connor
- Former Developer
- Registered: 2008-04-27
- Posts: 1,127
Re: FluxBB Wiki
Yeh, but Smartys did it not me, I assume he used http://punbb.informer.com/forums/viewto … 53#p113853 but I don't know, I'm sure he'll give details when he reads this ![]()
Offline
#5 2008-05-08 21:31:31
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
Exactly what I did, although I called the auth scheme fluxbb rather than punbb to avoid any issues when upgrading. I also went through and made the punbb -> fluxbb variable name, etc changes.
I'll post up the code if anyone is interested: however, I think it can certainly be written much more cleanly (as I mentioned in that post).
Offline
#6 2008-05-08 22:54:49
- hcgtv
- Member

- From: Charlotte, NC
- Registered: 2008-05-07
- Posts: 419
- Website
Re: FluxBB Wiki
Smartys,
Yes, if you could post the code somewhere, here or the wiki, then I could point Andi of DokuWiki towards it.
Thanks.
Bert Garcia - When all you have is a keyboard
Offline
#7 2008-05-08 23:34:52
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
Sweet, thanks ![]()
I called it fluxbb.class.php (and as I said, I think I removed the dependency on auth_mysql, I just didn't know enough about dokuwiki to actually touch anything other than the FluxBB code).
<?php
/**
* FluxBB auth backend
*
* Uses external Trust mechanism to check against FluxBB's
* user cookie. FluxBB's FORUM_ROOT must be defined correctly.
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
if(!defined('FORUM_ROOT')) define('FORUM_ROOT', DOKU_INC.'../forums/');
define('FORUM_DISABLE_CSRF_CONFIRM', 1);
require_once FORUM_ROOT.'include/common.php';
require_once DOKU_INC.'inc/auth/mysql.class.php';
#dbg($GLOBALS);
#dbg($forum_user);
class auth_fluxbb extends auth_mysql {
/**
* Constructor.
*
* Sets additional capabilities and config strings
*/
function auth_fluxbb(){
global $conf;
$this->cando['external'] = true;
$this->cando['logoff'] = true;
$conf['passcrypt'] = 'sha1';
// get global vars from fluxbb config
global $db_host;
global $db_name;
global $db_username;
global $db_password;
global $db_prefix;
// now set up the mysql config strings
$conf['auth']['mysql']['server'] = $db_host;
$conf['auth']['mysql']['user'] = $db_username;
$conf['auth']['mysql']['password'] = $db_password;
$conf['auth']['mysql']['database'] = $db_name;
$conf['auth']['mysql']['checkPass'] = "SELECT u.password AS pass
FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
WHERE u.group_id = g.g_id
AND u.username = '%{user}'
AND g.g_title != 'Guest'";
$conf['auth']['mysql']['getUserInfo'] = "SELECT password AS pass, realname AS name, email AS mail,
id, g_title as `group`
FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
WHERE u.group_id = g.g_id
AND u.username = '%{user}'";
$conf['auth']['mysql']['getGroups'] = "SELECT g.g_title as `group`
FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
WHERE u.group_id = g.g_id
AND u.username = '%{user}'";
$conf['auth']['mysql']['getUsers'] = "SELECT DISTINCT u.username AS user
FROM ${db_prefix}users AS u, ${db_prefix}groups AS g
WHERE u.group_id = g.g_id";
$conf['auth']['mysql']['FilterLogin'] = "u.username LIKE '%{user}'";
$conf['auth']['mysql']['FilterName'] = "u.realname LIKE '%{name}'";
$conf['auth']['mysql']['FilterEmail'] = "u.email LIKE '%{email}'";
$conf['auth']['mysql']['FilterGroup'] = "g.g_title LIKE '%{group}'";
$conf['auth']['mysql']['SortOrder'] = "ORDER BY u.username";
$conf['auth']['mysql']['addUser'] = "INSERT INTO ${db_prefix}users
(username, password, email, realname)
VALUES ('%{user}', '%{pass}', '%{email}', '%{name}')";
$conf['auth']['mysql']['addGroup'] = "INSERT INTO ${db_prefix}groups (g_title) VALUES ('%{group}')";
$conf['auth']['mysql']['addUserGroup']= "UPDATE ${db_prefix}users
SET group_id=%{gid}
WHERE id='%{uid}'";
$conf['auth']['mysql']['delGroup'] = "DELETE FROM ${db_prefix}groups WHERE g_id='%{gid}'";
$conf['auth']['mysql']['getUserID'] = "SELECT id FROM ${db_prefix}users WHERE username='%{user}'";
$conf['auth']['mysql']['updateUser'] = "UPDATE ${db_prefix}users SET";
$conf['auth']['mysql']['UpdateLogin'] = "username='%{user}'";
$conf['auth']['mysql']['UpdatePass'] = "password='%{pass}'";
$conf['auth']['mysql']['UpdateEmail'] = "email='%{email}'";
$conf['auth']['mysql']['UpdateName'] = "realname='%{name}'";
$conf['auth']['mysql']['UpdateTarget']= "WHERE id=%{uid}";
$conf['auth']['mysql']['delUserGroup']= "UPDATE ${db_prefix}users SET g_id=4 WHERE id=%{uid}";
$conf['auth']['mysql']['getGroupID'] = "SELECT g_id AS id FROM ${db_prefix}groups WHERE g_title='%{group}'";
$conf['auth']['mysql']['TablesToLock']= array("${db_prefix}users", "${db_prefix}users AS u",
"${db_prefix}groups", "${db_prefix}groups AS g");
$conf['auth']['mysql']['debug'] = 1;
// call mysql constructor
$this->auth_mysql();
}
/**
* Just checks against the $forum_user variable
*/
function trustExternal($user,$pass,$sticky=false){
global $USERINFO;
global $conf;
global $lang;
global $forum_user;
global $forum_config;
global $cookie_name;
$sticky ? $sticky = true : $sticky = false; //sanity check
// someone used the login form
if(!empty($user)){
authenticate_user($user, $pass);
if (!$forum_user['is_guest']){
$expire = ($forum_user['save_pass'] == '1') ? time() + 31536000 : 0;
forum_setcookie($cookie_name, base64_encode($forum_user['id'].'|'.$forum_user['password']), $expire);
}else{
//invalid credentials - log off
msg($lang['badlogin'],-1);
auth_logoff();
return false;
}
}
if(isset($forum_user) && !$forum_user['is_guest']){
// okay we're logged in - set the globals
$USERINFO['pass'] = $forum_user['password'];
$USERINFO['name'] = $forum_user['realname'];
$USERINFO['mail'] = $forum_user['email'];
$USERINFO['grps'] = array($forum_user['g_title']);
if ($forum_user['g_id'] == FORUM_ADMIN)
$USERINFO['grps'][] = 'admin';
$_SERVER['REMOTE_USER'] = $forum_user['username'];
$_SESSION[DOKU_COOKIE]['auth']['user'] = $forum_user['username'];
$_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;
return true;
}
// to be sure
auth_logoff();
return false;
}
/**
* remove fluxbb cookie on logout
*/
function logOff(){
global $forum_user;
global $cookie_name;
$forum_user = array();
$forum_user['is_guest'] = true;
forum_setcookie($cookie_name, base64_encode('1|'.random_key(8, true)), time() + 31536000);
}
}
//Setup VIM: ex: et ts=2 enc=utf-8 :Offline
#8 2008-05-09 00:01:07
- hcgtv
- Member

- From: Charlotte, NC
- Registered: 2008-05-07
- Posts: 419
- Website
Re: FluxBB Wiki
Sweet, thanks
When FluxBB is officially announced, I'll contact Andi.
Thanks.
Bert Garcia - When all you have is a keyboard
Offline
#9 2008-05-09 01:28:45
- Adam
- Member

- Registered: 2008-04-30
- Posts: 36
Re: FluxBB Wiki
Trac has a built-in wiki. Why not use that?
I'm posting on FORUMS!
Offline
#10 2008-05-09 02:20:48
- hcgtv
- Member

- From: Charlotte, NC
- Registered: 2008-05-07
- Posts: 419
- Website
Re: FluxBB Wiki
This is a really nice template for Doku:
Bert Garcia - When all you have is a keyboard
Offline
#11 2008-05-09 03:05:42
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
Trac has a built-in wiki. Why not use that?
Because integration is a huge hassle.
Offline
#12 2008-05-09 04:57:53
- Jérémie
- Member

- From: Paris, France
- Registered: 2008-04-30
- Posts: 627
- Website
Re: FluxBB Wiki
I'm not an expert on Doku, but it doesn't seem to handle internationalization. That could be an issue.
If a separate wiki is installed for each locale support sub-site, does it support transwiki link like MediaWiki does?
Offline
#13 2008-05-09 10:13:06
- Connor
- Former Developer
- Registered: 2008-04-27
- Posts: 1,127
Re: FluxBB Wiki
I'm not an expert on Doku, but it doesn't seem to handle internationalization. That could be an issue.
If a separate wiki is installed for each locale support sub-site, does it support transwiki link like MediaWiki does?
Theres a translation plugin, i think it uses namespaces for the different languages see http://wiki.splitbrain.org/wiki:translation
Offline
#14 2008-05-09 10:42:40
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
Connor: Good idea, I'll install that plugin now
Offline
#15 2008-05-09 10:54:47
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
And done, you'll need to do a hard refresh (Ctrl-F5) to reload the stylesheets though. Otherwise, it looks odd.
If anyone has a language they would like to add, please suggest it here: we need to manually add languages to the selector. I've taken the liberty of adding French to start with. ![]()
Offline
#16 2008-05-09 10:56:26
- Paul
- Developer
- From: Wales, UK
- Registered: 2008-04-27
- Posts: 1,623
Re: FluxBB Wiki
Swedish which will keep Kristoffer busy.
The only thing worse than finding a bug is knowing I created it in the first place.
Offline
#17 2008-05-09 10:59:34
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
Added as well
Offline
#18 2008-05-09 10:59:50
- jmp
- Member
- Registered: 2008-05-03
- Posts: 85
Re: FluxBB Wiki
Finnish, I'll be handling that.
Offline
#19 2008-05-09 11:16:49
- Connor
- Former Developer
- Registered: 2008-04-27
- Posts: 1,127
Re: FluxBB Wiki
btw, the french is in french, but the swedish strings are still english :S
Offline
#20 2008-05-09 13:55:07
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
Because Swedish is apparently sv, not se. Google lied to me. ![]()
Offline
#21 2008-05-09 13:56:48
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
Fixed, and added Finnish
Offline
#22 2008-05-09 15:05:44
- elbekko
- Former Developer

- From: Leuven, Belgium
- Registered: 2008-04-30
- Posts: 1,131
- Website
Re: FluxBB Wiki
I can do Dutch if needed.
Ben
SVN repository for my extensions - The thread
Quickmarks 0.5
“Question: How does a large software project get to be one year late? Answer: One day at a time!” - Fred Brooks
Offline
#23 2008-05-09 16:37:41
- Mark
- Member
- From: Southport, Uk
- Registered: 2008-05-03
- Posts: 394
Re: FluxBB Wiki
Because Swedish is apparently sv, not se. Google lied to me.
Thats because Swedish people say it like "Svedan" ![]()
Offline
#24 2008-05-09 16:42:50
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
Dutch added
And bah, Google was wrong, I thought it was SV ![]()
Offline
#25 2008-05-09 17:19:39
- Smartys
- Former Developer
- Registered: 2008-04-27
- Posts: 3,114
- Website
Re: FluxBB Wiki
Oh, and please make sure your links are correct. For example:
start
becomes
nl:start
fr:start
etc
and links to v1.2:installation become
nl:v1.2:installation
fr:v1.2:installation
etc
Offline
