tips:integrate_with_phpbb
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
tips:integrate_with_phpbb [2017-12-05 16:24] – 92.217.159.60 | tips:integrate_with_phpbb [2017-12-05 18:38] – old revision restored (2013-05-24 15:32) LarsDW223 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Integrate with phpBB ====== | ||
+ | |||
+ | This is a description of how to integrate the user authentication and group facilities in phpBB with dokuWiki. | ||
+ | |||
+ | For integration with PHPBB3, please see [[integrate_with_phpbb3|this page.]] | ||
+ | |||
+ | > Information regarding this topic could also be found in [[auth: | ||
+ | |||
+ | > **A new authentication class** has been added to the end of this document which should work with phpbb' | ||
+ | |||
===== Requirements ===== | ===== Requirements ===== | ||
Line 25: | Line 35: | ||
The code below is best placed in **conf/ | The code below is best placed in **conf/ | ||
- | We use phpBBs '' | + | We use phpBBs '' |
- | <code php> | + | <code php> |
$conf[' | $conf[' | ||
Line 34: | Line 44: | ||
$conf[' | $conf[' | ||
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
FROM phpbb_users | FROM phpbb_users | ||
WHERE username=' | WHERE username=' | ||
- | AND user_password=MD5(' | + | AND user_password=MD5(' |
- | $conf[' | + | $conf[' |
FROM phpbb_users | FROM phpbb_users | ||
- | WHERE username=' | + | WHERE username=' |
- | $conf[' | + | $conf[' |
FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | ||
WHERE b.user_id = c.user_id | WHERE b.user_id = c.user_id | ||
AND a.group_id = c.group_id | AND a.group_id = c.group_id | ||
- | AND b.username=' | + | AND b.username=' |
- | </code> | + | </code> |
:!: This does not work with the new MySQL Backend! | :!: This does not work with the new MySQL Backend! | ||
Line 59: | Line 69: | ||
To work with the new Backend the following appears to work: | To work with the new Backend the following appears to work: | ||
- | <code php> | + | <code php> |
$conf[' | $conf[' | ||
Line 66: | Line 76: | ||
$conf[' | $conf[' | ||
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
$conf[' | $conf[' | ||
- | $conf[' | + | $conf[' |
FROM phpbb_users | FROM phpbb_users | ||
WHERE username=' | WHERE username=' | ||
- | AND user_password=MD5(' | + | AND user_password=MD5(' |
- | $conf[' | + | $conf[' |
FROM phpbb_users | FROM phpbb_users | ||
- | WHERE username=' | + | WHERE username=' |
- | $conf[' | + | $conf[' |
FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | ||
WHERE b.user_id = c.user_id | WHERE b.user_id = c.user_id | ||
AND a.group_id = c.group_id | AND a.group_id = c.group_id | ||
- | AND b.username=' | + | AND b.username=' |
- | </code> | + | </code> |
:!: This does not work with phpBB 3! | :!: This does not work with phpBB 3! | ||
Line 99: | Line 109: | ||
:!: Warning the group names should be made lowercase as the ACL script is translating the group names to lowercase as well... | :!: Warning the group names should be made lowercase as the ACL script is translating the group names to lowercase as well... | ||
- | ==== Add all forum users to a group "Users& | + | ==== Add all forum users to a group "Users" |
- | I have nearly 1000 Users on my Forum, and i want that only Users are able to edit a page. Because I won't add every User to a Group "Users& | + | I have nearly 1000 Users on my Forum, and i want that only Users are able to edit a page. Because I won't add every User to a Group "Users" |
- | <code php> | + | <code php> |
- | $conf[' | + | $conf[' |
FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | ||
WHERE b.user_id = c.user_id AND a.group_id = c.group_id | WHERE b.user_id = c.user_id AND a.group_id = c.group_id | ||
Line 112: | Line 122: | ||
WHERE b.user_id = c.user_id | WHERE b.user_id = c.user_id | ||
AND a.group_id = c.group_id | AND a.group_id = c.group_id | ||
- | AND b.username=' | + | AND b.username=' |
- | </code> | + | </code> |
I know its a little big, but I have my own server and a good performance (running on Gentoo *scnr* - the Querry do 0.12sec) so I do better this than adding all Users to Group Users and patch the login.php to add all new users to Users. \\ | I know its a little big, but I have my own server and a good performance (running on Gentoo *scnr* - the Querry do 0.12sec) so I do better this than adding all Users to Group Users and patch the login.php to add all new users to Users. \\ | ||
Line 119: | Line 129: | ||
=== For the new MySQL backend === | === For the new MySQL backend === | ||
- | <code php> | + | <code php> |
- | $conf[' | + | $conf[' |
FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | ||
WHERE b.user_id = c.user_id | WHERE b.user_id = c.user_id | ||
Line 126: | Line 136: | ||
AND b.username=' | AND b.username=' | ||
| | ||
- | | + | |
FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | FROM phpbb_groups a, phpbb_users b, phpbb_user_group c | ||
WHERE b.user_id = c.user_id | WHERE b.user_id = c.user_id | ||
AND a.group_id = c.group_id | AND a.group_id = c.group_id | ||
- | AND b.username=' | + | AND b.username=' |
- | </code> | + | </code> |
Line 142: | Line 152: | ||
I don't understand anything of mySQL, so I thought I'd better not touch that query, but instead modified '' | I don't understand anything of mySQL, so I thought I'd better not touch that query, but instead modified '' | ||
- | <code php>$info[' | + | <code php>$info[' |
Each registered user in your phpBB forum is added to the default group defined in your conf-files. | Each registered user in your phpBB forum is added to the default group defined in your conf-files. | ||
- | & | + | > Nice, thanks. This solution is much elegant than the MySQL-Query :-) --- //[[|]] defel 2005-03-30 00:30// |
- | & | + | >>It would be better to add the default group outside the foreach loop as right now you are adding it for every group the user is in. |
- | & | + | >>So keep the foreach loop the way it is, and add the following code on the line before the loop: |
- | & | + | >>< |
How to adapt this to the new mysql backend? | How to adapt this to the new mysql backend? | ||
- | Well, like above. To add the // | + | Well, like above. To add the // |
- | <code php& | + | <code php> |
$groups = array(); | $groups = array(); | ||
- | if($this->dbcon) { | + | if($this->dbcon) { |
- | $sql = str_replace(' | + | $sql = str_replace(' |
- | $result = $this->_queryDB($sql); | + | $result = $this->_queryDB($sql); |
if(count($result)) { | if(count($result)) { | ||
Line 166: | Line 176: | ||
$groups[] = $row[' | $groups[] = $row[' | ||
} | } | ||
- | $groups[] = $this->defaultgroup; | + | $groups[] = $this->defaultgroup; |
return $groups; | return $groups; | ||
} | } | ||
return false; | return false; | ||
- | </code> | + | </code> |
===== Configure acl.auth ===== | ===== Configure acl.auth ===== | ||
Line 184: | Line 194: | ||
I don't want to publish the email addresses of my privacy concerned users, so I've decided to have their signatures point to their user profiles, which they can configure as they like through phpBB. | I don't want to publish the email addresses of my privacy concerned users, so I've decided to have their signatures point to their user profiles, which they can configure as they like through phpBB. | ||
- | I've used the "mail& | + | I've used the "mail" |
- | <code php> | + | <code php> |
- | $conf[' | + | $conf[' |
FROM phpbb_users | FROM phpbb_users | ||
- | WHERE username=' | + | WHERE username=' |
- | </code> | + | </code> |
Then I've set the signature template to: | Then I've set the signature template to: | ||
- | <code php> | + | <code php> |
- | $conf[' | + | $conf[' |
- | </code> | + | </code> |
(both modifications go into local.php, see [[: | (both modifications go into local.php, see [[: | ||
Line 202: | Line 212: | ||
The signature is now an [[: | The signature is now an [[: | ||
- | <code> | + | <code> |
- | user / | + | user / |
- | </code> | + | </code> |
(put this line in your interwiki.conf) | (put this line in your interwiki.conf) | ||
Line 215: | Line 225: | ||
Add these lines to your local.php file. | Add these lines to your local.php file. | ||
- | <code php> | + | <code php> |
- | $conf[' | + | $conf[' |
FROM phpbb_users | FROM phpbb_users | ||
- | WHERE username=' | + | WHERE username=' |
- | $conf[' | + | $conf[' |
- | </code> | + | </code> |
If you followed the instructions to integrate with phpBB above you already have lines like this. | If you followed the instructions to integrate with phpBB above you already have lines like this. | ||
- | <code php> | + | <code php> |
- | $conf[' | + | $conf[' |
FROM phpbb_users | FROM phpbb_users | ||
- | WHERE username=' | + | WHERE username=' |
- | </code> | + | </code> |
I commented that line out so that it looked like this. | I commented that line out so that it looked like this. | ||
- | <code php> | + | <code php> |
- | // | + | // |
// FROM phpbb_users | // FROM phpbb_users | ||
- | // WHERE username=' | + | // WHERE username=' |
- | </code> | + | </code> |
Then I added this line to the interwiki.conf file at the bottom. | Then I added this line to the interwiki.conf file at the bottom. | ||
- | <code> | + | <code> |
- | user / | + | user / |
- | </code> | + | </code> |
Save your files and that's it. Now when you add your signature it points back to the profile page in phpBB. This worked for phpBB version 2.0.20. | Save your files and that's it. Now when you add your signature it points back to the profile page in phpBB. This worked for phpBB version 2.0.20. | ||
Line 252: | Line 262: | ||
I changed PUNBB.CLASS.PHP to be compable with PHPBB, | I changed PUNBB.CLASS.PHP to be compable with PHPBB, | ||
- | here is the ,it is not compable with PHPBB too much ,especially the cookie & session functions, | + | here is the ,it is not compable with PHPBB too much ,especially the cookie & session functions, |
but it work for me ! Anybody can rechange it more and deeply | but it work for me ! Anybody can rechange it more and deeply | ||
- | <code php> | + | <code php> |
- | <?php | + | <?php |
/** | /** | ||
* phpbb auth backend | * phpbb auth backend | ||
Line 264: | Line 274: | ||
* user cookie. phpbb' | * user cookie. phpbb' | ||
* | * | ||
- | * @author | + | * @author |
- | * @hacked | + | * @hacked |
*/ | */ | ||
Line 271: | Line 281: | ||
if(get_magic_quotes_gpc()){ | if(get_magic_quotes_gpc()){ | ||
nice_die(' | nice_die(' | ||
- | | + | |
to be disabled for proper operation. Either setup your PHP install accordingly or | to be disabled for proper operation. Either setup your PHP install accordingly or | ||
choose a different auth backend.' | choose a different auth backend.' | ||
Line 291: | Line 301: | ||
function auth_phpbb(){ | function auth_phpbb(){ | ||
global $conf; | global $conf; | ||
- | $this->cando[' | + | $this->cando[' |
- | $this->cando[' | + | $this->cando[' |
// make sure we use a crypt understood by phpbb | // make sure we use a crypt understood by phpbb | ||
Line 317: | Line 327: | ||
$conf[' | $conf[' | ||
- | $conf[' | + | $conf[' |
FROM ${table_prefix}users AS u | FROM ${table_prefix}users AS u | ||
WHERE u.username=' | WHERE u.username=' | ||
- | AND u.user_password=MD5(' | + | AND u.user_password=MD5(' |
- | // | + | // |
// FROM ${table_prefix}users AS u | // FROM ${table_prefix}users AS u | ||
- | // WHERE u.username=' | + | // WHERE u.username=' |
- | $conf[' | + | $conf[' |
FROM ${table_prefix}users AS u | FROM ${table_prefix}users AS u | ||
- | WHERE u.username=' | + | WHERE u.username=' |
- | // | + | // |
// FROM ${table_prefix}groups AS g, ${table_prefix}users AS u, ${table_prefix}user_group c | // FROM ${table_prefix}groups AS g, ${table_prefix}users AS u, ${table_prefix}user_group c | ||
// WHERE u.user_id = c.user_id | // WHERE u.user_id = c.user_id | ||
// AND g.group_id = c.group_id | // AND g.group_id = c.group_id | ||
- | // AND u.username=' | + | // AND u.username=' |
- | $conf[' | + | $conf[' |
FROM ${table_prefix}groups AS g, ${table_prefix}users AS u, ${table_prefix}user_group c | FROM ${table_prefix}groups AS g, ${table_prefix}users AS u, ${table_prefix}user_group c | ||
WHERE u.user_id = c.user_id | WHERE u.user_id = c.user_id | ||
Line 340: | Line 350: | ||
AND u.username=' | AND u.username=' | ||
UNION | UNION | ||
- | SELECT '& | + | SELECT '" |
FROM ${table_prefix}groups AS g, ${table_prefix}users AS u, ${table_prefix}user_group c | FROM ${table_prefix}groups AS g, ${table_prefix}users AS u, ${table_prefix}user_group c | ||
WHERE u.user_id = c.user_id | WHERE u.user_id = c.user_id | ||
AND g.group_id = c.group_id | AND g.group_id = c.group_id | ||
- | AND u.username=' | + | AND u.username=' |
- | $conf[' | + | $conf[' |
- | FROM ${table_prefix}users AS u"; | + | FROM ${table_prefix}users AS u"; |
| | ||
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | // | + | // |
// (username, user_password, | // (username, user_password, | ||
- | // | + | // |
- | // | + | // |
- | // | + | // |
// SET group_id=%{gid} | // SET group_id=%{gid} | ||
- | // WHERE id=' | + | // WHERE id=' |
- | // | + | // |
- | // | + | // |
- | // | + | // |
- | // | + | // |
- | // | + | // |
- | // | + | // |
- | // | + | // |
- | // | + | // |
- | // | + | // |
- | $conf[' | + | $conf[' |
- | // | + | // |
- | // | + | // |
//end see http:// | //end see http:// | ||
/* | /* | ||
- | $conf[' | + | $conf[' |
FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | ||
WHERE u.group_id = g.g_id | WHERE u.group_id = g.g_id | ||
AND u.username = ' | AND u.username = ' | ||
- | AND g.g_title | + | AND g.g_title |
- | $conf[' | + | $conf[' |
id, g_title as `group` | id, g_title as `group` | ||
FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | ||
WHERE u.group_id = g.g_id | WHERE u.group_id = g.g_id | ||
- | AND u.username = ' | + | AND u.username = ' |
- | $conf[' | + | $conf[' |
FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | ||
WHERE u.group_id = g.g_id | WHERE u.group_id = g.g_id | ||
- | AND u.username = ' | + | AND u.username = ' |
| | ||
- | $conf[' | + | $conf[' |
FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | ||
- | WHERE u.group_id = g.g_id"; | + | WHERE u.group_id = g.g_id"; |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
(username, password, email, realname) | (username, password, email, realname) | ||
- | | + | |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
SET group_id=%{gid} | SET group_id=%{gid} | ||
- | WHERE id=' | + | WHERE id=' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | $conf[' | + | $conf[' |
- | | + | |
*/ | */ | ||
$conf[' | $conf[' | ||
// call mysql constructor | // call mysql constructor | ||
- | $this->auth_mysql(); | + | $this->auth_mysql(); |
} | } | ||
Line 442: | Line 452: | ||
// someone used the login form | // someone used the login form | ||
if(isset($user)){ | if(isset($user)){ | ||
- | if($this->checkPass($user, | + | if($this->checkPass($user, |
$expire = ($sticky) ? time() + 31536000 : 0; | $expire = ($sticky) ? time() + 31536000 : 0; | ||
- | $uinfo | + | $uinfo |
// | // | ||
setcookie($uinfo[' | setcookie($uinfo[' | ||
Line 461: | Line 471: | ||
} | } | ||
- | if(isset($pun_user) && !$pun_user[' | + | if(isset($pun_user) && !$pun_user[' |
// okay we're logged in - set the globals | // okay we're logged in - set the globals | ||
$USERINFO[' | $USERINFO[' | ||
Line 491: | Line 501: | ||
//Setup VIM: ex: et ts=2 enc=utf-8 : | //Setup VIM: ex: et ts=2 enc=utf-8 : | ||
- | </code> | + | </code> |
--- // | --- // | ||
Line 513: | Line 523: | ||
You should just be able to drop this into your int/auth folder, edit $phpbb_root_path, | You should just be able to drop this into your int/auth folder, edit $phpbb_root_path, | ||
- | :!: It appears to me that "int/auth& | + | :!: It appears to me that "int/auth" |
//- Bill// | //- Bill// | ||
- | :!: My mistake...the folder inc/auth does exist, but my File Manager GUI for my domain would not let me see it...I had to open a DOS FTP session (I assume this is part of the mystery of UNIX). I was able to upload and use inc/ | + | :!: My mistake...the folder inc/auth does exist, but my File Manager GUI for my domain would not let me see it...I had to open a DOS FTP session (I assume this is part of the mystery of UNIX). I was able to upload and use inc/ |
//- Bill// | //- Bill// | ||
It shouldent be too hard to get group support working, but I did not have a chance to get to it yet. | It shouldent be too hard to get group support working, but I did not have a chance to get to it yet. | ||
- | <code php> | + | <code php> |
- | <?php | + | <?php |
/** | /** | ||
* PHPBB authentication backend | * PHPBB authentication backend | ||
Line 532: | Line 542: | ||
- | define("IN_LOGIN", true); | + | define("IN_LOGIN", true); |
define(' | define(' | ||
$phpbb_root_path = $location.' | $phpbb_root_path = $location.' | ||
Line 559: | Line 569: | ||
function auth_phpbb() { | function auth_phpbb() { | ||
global $user_ip; | global $user_ip; | ||
- | $this->success = true; | + | $this->success = true; |
- | $this->cando[' | + | $this->cando[' |
- | //$this->cando[' | + | //$this->cando[' |
- | $this->cando[' | + | $this->cando[' |
// | // | ||
// Set page ID for session management | // Set page ID for session management | ||
// | // | ||
- | $this->userdata = session_pagestart($user_ip, | + | $this->userdata = session_pagestart($user_ip, |
- | init_userprefs($this->userdata); | + | init_userprefs($this->userdata); |
// | // | ||
// End session management | // End session management | ||
Line 575: | Line 585: | ||
function trustExternal($user, | function trustExternal($user, | ||
$sticky ? $sticky = true : $sticky = false; | $sticky ? $sticky = true : $sticky = false; | ||
- | if($this->userdata[' | + | if($this->userdata[' |
// | // | ||
} else { | } else { | ||
- | if(!$this->checkPass2($user, | + | if(!$this->checkPass2($user, |
return; | return; | ||
} | } | ||
} | } | ||
global $USERINFO; | global $USERINFO; | ||
- | $USERINFO = $this->getUserData($this->userdata[' | + | $USERINFO = $this->getUserData($this->userdata[' |
- | $_SERVER[' | + | $_SERVER[' |
- | $_SESSION[$conf[' | + | $_SESSION[$conf[' |
- | $_SESSION[$conf[' | + | $_SESSION[$conf[' |
$_SESSION[$conf[' | $_SESSION[$conf[' | ||
$_SESSION[$conf[' | $_SESSION[$conf[' | ||
/ | / | ||
- | die("fff");*/ | + | die("fff");*/ |
} | } | ||
function checkPass($user, | function checkPass($user, | ||
- | return($this->checkPass2($user, | + | return($this->checkPass2($user, |
} | } | ||
function checkPass2($user, | function checkPass2($user, | ||
Line 601: | Line 611: | ||
global $db; | global $db; | ||
- | $sql = "SELECT user_id, username, user_password, | + | $sql = "SELECT user_id, username, user_password, |
- | FROM | + | FROM |
- | WHERE username = '& | + | WHERE username = '" |
- | if ( !($result = $db->sql_query($sql)) ) | + | if ( !($result = $db->sql_query($sql)) ) |
{ | { | ||
message_die(GENERAL_ERROR, | message_die(GENERAL_ERROR, | ||
} | } | ||
- | if( $row = $db->sql_fetchrow($result) ) | + | if( $row = $db->sql_fetchrow($result) ) |
{ | { | ||
- | if( md5($pass) == $row[' | + | if( md5($pass) == $row[' |
- | $this->userdata = session_begin($row[' | + | $this->userdata = session_begin($row[' |
- | if( !$this->userdata ) | + | if( !$this->userdata ) |
{ | { | ||
- | message_die(CRITICAL_ERROR, | + | message_die(CRITICAL_ERROR, |
} | } | ||
return(true); | return(true); | ||
Line 639: | Line 649: | ||
function getUserData($user){ | function getUserData($user){ | ||
global $conf; | global $conf; | ||
- | if($this->userdata[' | + | if($this->userdata[' |
global $db; | global $db; | ||
//ok, figure out what groups they are in | //ok, figure out what groups they are in | ||
- | $sql = "SELECT g.group_name, | + | $sql = "SELECT g.group_name, |
- | FROM | + | FROM |
- | WHERE ug.user_id = & | + | WHERE ug.user_id = " |
AND ug.group_id = g.group_id | AND ug.group_id = g.group_id | ||
- | AND g.group_single_user | + | AND g.group_single_user |
- | ORDER BY g.group_name, | + | ORDER BY g.group_name, |
- | if ( !($result = $db->sql_query($sql)) ) | + | if ( !($result = $db->sql_query($sql)) ) |
{ | { | ||
message_die(GENERAL_ERROR, | message_die(GENERAL_ERROR, | ||
} | } | ||
$groups = array($conf[' | $groups = array($conf[' | ||
- | while( $row = $db->sql_fetchrow($result) ) { | + | while( $row = $db->sql_fetchrow($result) ) { |
if(!$row[' | if(!$row[' | ||
$groups[] = $row[' | $groups[] = $row[' | ||
} | } | ||
- | return(array(' | + | return(array(' |
- | ' | + | ' |
- | ' | + | ' |
) | ) | ||
); | ); | ||
Line 668: | Line 678: | ||
function logOff(){ | function logOff(){ | ||
- | if( $this->userdata[' | + | if( $this->userdata[' |
{ | { | ||
- | session_end($this->userdata[' | + | session_end($this->userdata[' |
} | } | ||
} | } | ||
Line 677: | Line 687: | ||
I didnt get this working... | I didnt get this working... | ||
function retrieveGroups($start=0, | function retrieveGroups($start=0, | ||
- | die("hi g"); | + | die("hi g"); |
- | $sql = "SELECT g.group_name | + | $sql = "SELECT g.group_name |
- | FROM | + | FROM |
- | AND g.group_single_user | + | AND g.group_single_user |
if($limit != 0) | if($limit != 0) | ||
- | $sql = $sql . & | + | $sql = $sql . " |
- | if ( !($result = $db->sql_query($sql)) ) | + | if ( !($result = $db->sql_query($sql)) ) |
{ | { | ||
message_die(GENERAL_ERROR, | message_die(GENERAL_ERROR, | ||
} | } | ||
- | $groups = array("User"); | + | $groups = array("User"); |
- | while( $row = $db->sql_fetchrow($result) ) { | + | while( $row = $db->sql_fetchrow($result) ) { |
$groups[] = $row[' | $groups[] = $row[' | ||
} | } | ||
Line 695: | Line 705: | ||
} | } | ||
- | </code> | + | </code> |
--- // | --- // | ||
Now, you must edit the files in '' | Now, you must edit the files in '' | ||
- | <code php>$location = ' | + | <code php>$location = ' |
This is important to find the phpBB path. | This is important to find the phpBB path. | ||
Line 706: | Line 716: | ||
Why not change the code to this? | Why not change the code to this? | ||
- | <code php> | + | <code php> |
$location = DOKU_AUTH.'/ | $location = DOKU_AUTH.'/ | ||
$phpbb_root_path = $location.$conf[' | $phpbb_root_path = $location.$conf[' | ||
- | </code> | + | </code> |
Then set in dokuwiki.php | Then set in dokuwiki.php | ||
- | <code php> | + | <code php> |
$conf[' | $conf[' | ||
- | </code> | + | </code> |
\\ | \\ | ||
Line 722: | Line 732: | ||
**Be careful!**\\ | **Be careful!**\\ | ||
Make sure, that '' | Make sure, that '' | ||
- | <code>php_flag register_globals off</code> | + | <code>php_flag register_globals off</code> |
Otherwise it can cause problems with automatically updating the searchindex!\\ | Otherwise it can cause problems with automatically updating the searchindex!\\ | ||
See [[http:// | See [[http:// | ||
Line 731: | Line 741: | ||
===== Register and resend password links ===== | ===== Register and resend password links ===== | ||
Change the links in the inc/ | Change the links in the inc/ | ||
- | <code php> | + | <code php> |
- | <?php | + | <?php |
- | if($auth->canDo(' | + | if($auth->canDo(' |
- | print '<p>'; | + | print '<p>'; |
print $lang[' | print $lang[' | ||
- | print ': | + | print ': |
- | print '</p>'; | + | print '</p>'; |
} | } | ||
- | if ($auth->canDo(' | + | if ($auth->canDo(' |
- | print '<p>'; | + | print '<p>'; |
print $lang[' | print $lang[' | ||
- | print ': | + | print ': |
- | print '</p>'; | + | print '</p>'; |
} | } | ||
- | ?> | + | ?> |
- | </code> | + | </code> |
Line 757: | Line 767: | ||
Add the following setting to conf/ | Add the following setting to conf/ | ||
- | <code php>$conf[' | + | <code php>$conf[' |
The important changes to mysql.conf.php are: | The important changes to mysql.conf.php are: | ||
- | <code php> | + | <code php> |
$conf[' | $conf[' | ||
- | $conf[' | + | $conf[' |
FROM phpbb_users | FROM phpbb_users | ||
- | WHERE username=' | + | WHERE username=' |
- | </code> | + | </code> |
You then need to add some code to 2 functions in inc/ | You then need to add some code to 2 functions in inc/ | ||
Line 772: | Line 782: | ||
In the **auth_verifyPassword** function, add the following check. | In the **auth_verifyPassword** function, add the following check. | ||
- | <code php> | + | <code php> |
}elseif (substr($crypt, | }elseif (substr($crypt, | ||
| | ||
$salt = $crypt; | $salt = $crypt; | ||
- | </code> | + | </code> |
Then in the **auth_cryptPassword** function, add this case: | Then in the **auth_cryptPassword** function, add this case: | ||
- | <code php> | + | <code php> |
case ' | case ' | ||
$phpbb_path = ' | $phpbb_path = ' | ||
Line 786: | Line 796: | ||
$itoa64 = ' | $itoa64 = ' | ||
return _hash_crypt_private($clear, | return _hash_crypt_private($clear, | ||
- | </code> | + | </code> |
Be sure to change the $phpbb_path variable to your phpBB install directory! | Be sure to change the $phpbb_path variable to your phpBB install directory! | ||
Line 817: | Line 827: | ||
$conf[' | $conf[' | ||
$conf[' | $conf[' | ||
- | $conf[' | + | $conf[' |
$conf[' | $conf[' | ||
$conf[' | $conf[' | ||
Line 833: | Line 843: | ||
After all a little right adjustment should be done via the config tool / rights management. My users (Group: User like the usergroup in phpBB) have the right to write in the namespace where the info files are stored and the board admins rights to manage every page. \\ | After all a little right adjustment should be done via the config tool / rights management. My users (Group: User like the usergroup in phpBB) have the right to write in the namespace where the info files are stored and the board admins rights to manage every page. \\ | ||
I created that on my local XAMPP installation and after successful testing I copied the changed files to the installation on my webspace. Now it runs like a charm. \\ | I created that on my local XAMPP installation and after successful testing I copied the changed files to the installation on my webspace. Now it runs like a charm. \\ | ||
- | Please drop a note if you got this to work. If not, too. ;-) And a big "THANK YOU& | + | Please drop a note if you got this to work. If not, too. ;-) And a big "THANK YOU" |
- | **@gonzo99 It worked! (phpBB 2.0.22 & DokuWiki 2007-06-26b)**\\ | + | **@gonzo99 It worked! (phpBB 2.0.22 & DokuWiki 2007-06-26b)**\\ |
But I discovered one Problem yet:\\ | But I discovered one Problem yet:\\ | ||
- | When editing a page, if I try to use "insert signature", there' | + | When editing a page, if I try to use "insert signature", there' |
But: **Many thanks to gonzo99!**\\ | But: **Many thanks to gonzo99!**\\ | ||
--- **berlindave** 2007-12-15 21:45 | --- **berlindave** 2007-12-15 21:45 |