tips:integrate_with_phpbb
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tips:integrate_with_phpbb [2010-09-02 06:42] – 85.110.82.112 | tips:integrate_with_phpbb [2017-12-05 16:24] – 92.217.159.60 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | hacked | + | ===== Requirements ===== |
+ | |||
+ | * A working installation of phpBB | ||
+ | * A working installation of dokuWiki | ||
+ | * Some patience | ||
+ | |||
+ | Facts | ||
+ | |||
+ | * This method of integrating relies on the use of groups in phpBB. | ||
+ | |||
+ | For the less knowledgeable...\\ | ||
+ | With the setup below, DokuWiki assumes that the table prefix in your forum' | ||
+ | I'm sure there is some way of altering the DokuWiki code to account for any changes to the prefix that is made but I don't know the first thing about php or mySQL so I can't tell you what to change. I made the mistake of changing my phpBB table prefix and in the end I went back to my forum database, manually changed all the table names (which is very tedious) and then edited the / | ||
+ | |||
+ | |||
+ | ===== Steps ===== | ||
+ | |||
+ | - [[# | ||
+ | - [[# | ||
+ | - [[# | ||
+ | - [[# | ||
+ | |||
+ | ===== Configure auth_mysql ===== | ||
+ | |||
+ | The code below is best placed in **conf/ | ||
+ | |||
+ | We use phpBBs '' | ||
+ | |||
+ | & | ||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | AND user_password=MD5(' | ||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | $conf[' | ||
+ | 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 | ||
+ | AND b.username=' | ||
+ | & | ||
+ | |||
+ | :!: This does not work with the new MySQL Backend! | ||
+ | |||
+ | ---- | ||
+ | |||
+ | To work with the new Backend the following appears to work: | ||
+ | |||
+ | & | ||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | AND user_password=MD5(' | ||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | $conf[' | ||
+ | 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 | ||
+ | AND b.username=' | ||
+ | & | ||
+ | |||
+ | :!: This does not work with phpBB 3! | ||
+ | |||
+ | |||
+ | ===== Create groups in phpBB ===== | ||
+ | |||
+ | ==== Use existing phpBB groups only ==== | ||
+ | |||
+ | The details of how you create groups are described in a very good [[http:// | ||
+ | |||
+ | There is basically one thing that you have to keep in mind when you name the groups. __**Group names with whitespaces do not work**__. | ||
+ | |||
+ | :!: 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 & | ||
+ | |||
+ | 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 & | ||
+ | & | ||
+ | $conf[' | ||
+ | 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 | ||
+ | AND b.username=' | ||
+ | UNION | ||
+ | | ||
+ | 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 | ||
+ | AND b.username=' | ||
+ | & | ||
+ | |||
+ | 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. \\ | ||
+ | |||
+ | === For the new MySQL backend === | ||
+ | |||
+ | & | ||
+ | $conf[' | ||
+ | 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 | ||
+ | AND b.username=' | ||
+ | UNION | ||
+ | | ||
+ | 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 | ||
+ | AND b.username=' | ||
+ | & | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Add all forum users to the default group with a script modification ==== | ||
+ | |||
+ | I don't understand anything of mySQL, so I thought I'd better not touch that query, but instead modified '' | ||
+ | |||
+ | & | ||
+ | |||
+ | 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// | ||
+ | |||
+ | & | ||
+ | & | ||
+ | & | ||
+ | |||
+ | How to adapt this to the new mysql backend? | ||
+ | |||
+ | Well, like above. To add the // | ||
+ | & | ||
+ | $groups = array(); | ||
+ | |||
+ | if($this-& | ||
+ | $sql = str_replace(' | ||
+ | $result = $this-& | ||
+ | |||
+ | if(count($result)) { | ||
+ | foreach($result as $row) | ||
+ | $groups[] = $row[' | ||
+ | } | ||
+ | $groups[] = $this-& | ||
+ | return $groups; | ||
+ | } | ||
+ | return false; | ||
+ | & | ||
+ | |||
+ | ===== Configure acl.auth ===== | ||
+ | |||
+ | How to configure the '' | ||
+ | |||
+ | ===== Other settings ===== | ||
+ | |||
+ | |||
+ | |||
+ | ==== Signature linking to phpBB user profile ==== | ||
+ | |||
+ | 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 & | ||
+ | |||
+ | & | ||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | & | ||
+ | |||
+ | Then I've set the signature template to: | ||
+ | |||
+ | & | ||
+ | $conf[' | ||
+ | & | ||
+ | |||
+ | (both modifications go into local.php, see [[: | ||
+ | |||
+ | The signature is now an [[: | ||
+ | |||
+ | & | ||
+ | user / | ||
+ | & | ||
+ | |||
+ | (put this line in your interwiki.conf) | ||
+ | --- // | ||
+ | |||
+ | ---- | ||
+ | |||
+ | The above was the basis for my phpbb signature mod. This is a more up to date version of above. | ||
+ | |||
+ | Add these lines to your local.php file. | ||
+ | |||
+ | & | ||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | |||
+ | $conf[' | ||
+ | & | ||
+ | |||
+ | If you followed the instructions to integrate with phpBB above you already have lines like this. | ||
+ | |||
+ | & | ||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | & | ||
+ | |||
+ | I commented that line out so that it looked like this. | ||
+ | |||
+ | & | ||
+ | // | ||
+ | // FROM phpbb_users | ||
+ | // WHERE username=' | ||
+ | & | ||
+ | |||
+ | Then I added this line to the interwiki.conf file at the bottom. | ||
+ | |||
+ | & | ||
+ | user / | ||
+ | & | ||
+ | |||
+ | 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. | ||
+ | |||
+ | --- //[Clint] 2007-07-09// | ||
+ | |||
+ | ===== phpBB.CLASS.PHP ===== | ||
+ | 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, | ||
+ | |||
+ | but it work for me ! Anybody can rechange it more and deeply | ||
+ | |||
+ | & | ||
+ | & | ||
+ | /** | ||
+ | * phpbb auth backend | ||
+ | * | ||
+ | * Uses external Trust mechanism to check against phpbb' | ||
+ | * user cookie. phpbb' | ||
+ | * | ||
+ | * @author | ||
+ | * @hacked | ||
+ | */ | ||
+ | |||
+ | if(!defined(' | ||
+ | if(get_magic_quotes_gpc()){ | ||
+ | nice_die(' | ||
+ | <a href=& | ||
+ | to be disabled for proper operation. Either setup your PHP install accordingly or | ||
+ | choose a different auth backend.' | ||
+ | } | ||
+ | |||
+ | require_once PHPBB_ROOT.'/ | ||
+ | require_once DOKU_INC.' | ||
+ | |||
+ | # | ||
+ | # | ||
+ | |||
+ | class auth_phpbb extends auth_mysql { | ||
+ | |||
+ | /** | ||
+ | * Constructor. | ||
+ | * | ||
+ | * Sets additional capabilities and config strings | ||
+ | */ | ||
+ | function auth_phpbb(){ | ||
+ | global $conf; | ||
+ | $this-& | ||
+ | $this-& | ||
+ | |||
+ | // make sure we use a crypt understood by phpbb | ||
+ | if(function_exists(' | ||
+ | $conf[' | ||
+ | }else{ | ||
+ | $conf[' | ||
+ | } | ||
+ | |||
+ | // get global vars from phpbb config | ||
+ | global $dbhost; | ||
+ | global $dbname; | ||
+ | global $dbuser; | ||
+ | global $dbpasswd; | ||
+ | global $table_prefix; | ||
+ | |||
+ | // now set up the mysql config strings | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | |||
+ | //see http:// | ||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | FROM ${table_prefix}users AS u | ||
+ | WHERE u.username=' | ||
+ | AND u.user_password=MD5(' | ||
+ | |||
+ | // | ||
+ | // FROM ${table_prefix}users AS u | ||
+ | // WHERE u.username=' | ||
+ | $conf[' | ||
+ | FROM ${table_prefix}users AS u | ||
+ | WHERE u.username=' | ||
+ | |||
+ | // | ||
+ | // FROM ${table_prefix}groups AS g, ${table_prefix}users AS u, ${table_prefix}user_group c | ||
+ | // WHERE u.user_id = c.user_id | ||
+ | // AND g.group_id = c.group_id | ||
+ | // AND u.username=' | ||
+ | $conf[' | ||
+ | FROM ${table_prefix}groups AS g, ${table_prefix}users AS u, ${table_prefix}user_group c | ||
+ | WHERE u.user_id = c.user_id | ||
+ | AND g.group_id = c.group_id | ||
+ | AND u.username=' | ||
+ | UNION | ||
+ | SELECT '& | ||
+ | FROM ${table_prefix}groups AS g, ${table_prefix}users AS u, ${table_prefix}user_group c | ||
+ | WHERE u.user_id = c.user_id | ||
+ | AND g.group_id = c.group_id | ||
+ | AND u.username=' | ||
+ | $conf[' | ||
+ | FROM ${table_prefix}users AS u& | ||
+ | |||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | |||
+ | // | ||
+ | // (username, user_password, | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // SET group_id=%{gid} | ||
+ | // WHERE id=' | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | $conf[' | ||
+ | |||
+ | // | ||
+ | // & | ||
+ | |||
+ | //end see http:// | ||
+ | |||
+ | /* | ||
+ | $conf[' | ||
+ | FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | ||
+ | WHERE u.group_id = g.g_id | ||
+ | AND u.username = ' | ||
+ | AND g.g_title | ||
+ | $conf[' | ||
+ | id, g_title as `group` | ||
+ | FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | ||
+ | WHERE u.group_id = g.g_id | ||
+ | AND u.username = ' | ||
+ | $conf[' | ||
+ | FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | ||
+ | WHERE u.group_id = g.g_id | ||
+ | AND u.username = ' | ||
+ | |||
+ | $conf[' | ||
+ | FROM ${table_prefix}users AS u, ${table_prefix}groups AS g | ||
+ | WHERE u.group_id = g.g_id& | ||
+ | |||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | (username, password, email, realname) | ||
+ | | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | SET group_id=%{gid} | ||
+ | WHERE id=' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | & | ||
+ | */ | ||
+ | |||
+ | $conf[' | ||
+ | // call mysql constructor | ||
+ | $this-& | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Just checks against the $pun_user variable | ||
+ | */ | ||
+ | function trustExternal($user, | ||
+ | global $USERINFO; | ||
+ | global $conf; | ||
+ | global $lang; | ||
+ | global $pun_user; | ||
+ | global $pun_config; | ||
+ | $sticky ? $sticky = true : $sticky = false; //sanity check | ||
+ | |||
+ | // someone used the login form | ||
+ | if(isset($user)){ | ||
+ | if($this-& | ||
+ | $expire = ($sticky) ? time() + 31536000 : 0; | ||
+ | $uinfo | ||
+ | // | ||
+ | setcookie($uinfo[' | ||
+ | $pun_user = array(); | ||
+ | $pun_user[' | ||
+ | $pun_user[' | ||
+ | $pun_user[' | ||
+ | $pun_user[' | ||
+ | $pun_user[' | ||
+ | }else{ | ||
+ | //invalid credentials - log off | ||
+ | msg($lang[' | ||
+ | auth_logoff(); | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | if(isset($pun_user) & | ||
+ | // okay we're logged in - set the globals | ||
+ | $USERINFO[' | ||
+ | $USERINFO[' | ||
+ | $USERINFO[' | ||
+ | $USERINFO[' | ||
+ | |||
+ | $_SERVER[' | ||
+ | $_SESSION[$conf[' | ||
+ | $_SESSION[$conf[' | ||
+ | return true; | ||
+ | } | ||
+ | |||
+ | // to be sure | ||
+ | auth_logoff(); | ||
+ | return false; | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * remove phpbb cookie on logout | ||
+ | */ | ||
+ | function logOff(){ | ||
+ | global $pun_user; | ||
+ | $pun_user = array(); | ||
+ | // | ||
+ | setcookie(1, | ||
+ | } | ||
+ | } | ||
+ | //Setup VIM: ex: et ts=2 enc=utf-8 : | ||
+ | |||
+ | & | ||
+ | |||
+ | --- // | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | =====Another phpbb.class.php===== | ||
+ | I have developed this phpbb.class.php auth backend to be more tightly integrated with phpbb' | ||
+ | |||
+ | You should just be able to drop this into your int/auth folder, edit $phpbb_root_path, | ||
+ | |||
+ | :!: It appears to me that & | ||
+ | //- 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/ | ||
+ | //- Bill// | ||
+ | |||
+ | It shouldent be too hard to get group support working, but I did not have a chance to get to it yet. | ||
+ | & | ||
+ | & | ||
+ | /** | ||
+ | * PHPBB authentication backend | ||
+ | * | ||
+ | * @license | ||
+ | * @author FatherNitwit | ||
+ | */ | ||
+ | |||
+ | define(' | ||
+ | require_once(DOKU_AUTH.'/ | ||
+ | |||
+ | |||
+ | define(& | ||
+ | define(' | ||
+ | $phpbb_root_path = $location.' | ||
+ | $dlang = $lang; | ||
+ | include($phpbb_root_path . ' | ||
+ | include($phpbb_root_path . ' | ||
+ | $lang = $dlang; | ||
+ | |||
+ | |||
+ | // we only accept page ids for auth_plain | ||
+ | if(isset($_REQUEST[' | ||
+ | $_REQUEST[' | ||
+ | if(isset($_REQUEST[' | ||
+ | $_REQUEST[' | ||
+ | |||
+ | class auth_phpbb extends auth_basic { | ||
+ | var $userdata; | ||
+ | |||
+ | /** | ||
+ | * Constructor | ||
+ | * | ||
+ | * Carry out sanity checks to ensure the object is | ||
+ | * able to operate. Set capabilities. | ||
+ | * | ||
+ | */ | ||
+ | function auth_phpbb() { | ||
+ | global $user_ip; | ||
+ | $this-& | ||
+ | $this-& | ||
+ | // | ||
+ | $this-& | ||
+ | // | ||
+ | // Set page ID for session management | ||
+ | // | ||
+ | $this-& | ||
+ | init_userprefs($this-& | ||
+ | // | ||
+ | // End session management | ||
+ | // | ||
+ | } | ||
+ | |||
+ | function trustExternal($user, | ||
+ | $sticky ? $sticky = true : $sticky = false; | ||
+ | if($this-& | ||
+ | // | ||
+ | } else { | ||
+ | if(!$this-& | ||
+ | return; | ||
+ | } | ||
+ | } | ||
+ | global $USERINFO; | ||
+ | $USERINFO = $this-& | ||
+ | |||
+ | $_SERVER[' | ||
+ | $_SESSION[$conf[' | ||
+ | $_SESSION[$conf[' | ||
+ | $_SESSION[$conf[' | ||
+ | $_SESSION[$conf[' | ||
+ | / | ||
+ | die(& | ||
+ | } | ||
+ | |||
+ | function checkPass($user, | ||
+ | return($this-& | ||
+ | } | ||
+ | function checkPass2($user, | ||
+ | global $user_ip; | ||
+ | global $db; | ||
+ | |||
+ | $sql = & | ||
+ | FROM " . USERS_TABLE . & | ||
+ | WHERE username = '& | ||
+ | if ( !($result = $db-& | ||
+ | { | ||
+ | message_die(GENERAL_ERROR, | ||
+ | } | ||
+ | |||
+ | if( $row = $db-& | ||
+ | { | ||
+ | if( md5($pass) == $row[' | ||
+ | |||
+ | $this-& | ||
+ | |||
+ | if( !$this-& | ||
+ | { | ||
+ | message_die(CRITICAL_ERROR, | ||
+ | } | ||
+ | return(true); | ||
+ | } | ||
+ | } | ||
+ | msg($lang[' | ||
+ | return(false); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Return user info | ||
+ | * | ||
+ | * Returns info about the given user needs to contain | ||
+ | * at least these fields: | ||
+ | * | ||
+ | * name string | ||
+ | * mail string | ||
+ | * grps array list of groups the user is in | ||
+ | * | ||
+ | */ | ||
+ | function getUserData($user){ | ||
+ | global $conf; | ||
+ | if($this-& | ||
+ | global $db; | ||
+ | //ok, figure out what groups they are in | ||
+ | $sql = & | ||
+ | FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug | ||
+ | WHERE ug.user_id = " . $this-& | ||
+ | AND ug.group_id = g.group_id | ||
+ | AND g.group_single_user & | ||
+ | ORDER BY g.group_name, | ||
+ | if ( !($result = $db-& | ||
+ | { | ||
+ | message_die(GENERAL_ERROR, | ||
+ | } | ||
+ | $groups = array($conf[' | ||
+ | while( $row = $db-& | ||
+ | if(!$row[' | ||
+ | $groups[] = $row[' | ||
+ | } | ||
+ | |||
+ | return(array(' | ||
+ | ' | ||
+ | ' | ||
+ | ) | ||
+ | ); | ||
+ | } | ||
+ | return(false); | ||
+ | } | ||
+ | |||
+ | function logOff(){ | ||
+ | if( $this-& | ||
+ | { | ||
+ | session_end($this-& | ||
+ | } | ||
+ | } | ||
+ | |||
+ | /* | ||
+ | I didnt get this working... | ||
+ | function retrieveGroups($start=0, | ||
+ | die(& | ||
+ | $sql = & | ||
+ | FROM " . GROUPS_TABLE . " g | ||
+ | AND g.group_single_user & | ||
+ | if($limit != 0) | ||
+ | $sql = $sql . " LIMIT $start, | ||
+ | if ( !($result = $db-& | ||
+ | { | ||
+ | message_die(GENERAL_ERROR, | ||
+ | } | ||
+ | $groups = array(& | ||
+ | while( $row = $db-& | ||
+ | $groups[] = $row[' | ||
+ | } | ||
+ | return $groups; | ||
+ | }*/ | ||
+ | |||
+ | } | ||
+ | & | ||
+ | --- // | ||
+ | |||
+ | Now, you must edit the files in '' | ||
+ | & | ||
+ | This is important to find the phpBB path. | ||
+ | |||
+ | |||
+ | --- //DevO 2007-06-14// | ||
+ | |||
+ | Why not change the code to this? | ||
+ | & | ||
+ | $location = DOKU_AUTH.'/ | ||
+ | $phpbb_root_path = $location.$conf[' | ||
+ | & | ||
+ | |||
+ | Then set in dokuwiki.php | ||
+ | |||
+ | & | ||
+ | $conf[' | ||
+ | & | ||
+ | |||
+ | \\ | ||
+ | \\ | ||
+ | ---- | ||
+ | **Be careful!**\\ | ||
+ | Make sure, that '' | ||
+ | & | ||
+ | Otherwise it can cause problems with automatically updating the searchindex!\\ | ||
+ | See [[http:// | ||
+ | See [[http:// | ||
+ | --- // | ||
+ | ---- | ||
+ | |||
+ | ===== Register and resend password links ===== | ||
+ | Change the links in the inc/ | ||
+ | & | ||
+ | & | ||
+ | if($auth-& | ||
+ | print '& | ||
+ | print $lang[' | ||
+ | print ': <a href=& | ||
+ | |||
+ | print '& | ||
+ | } | ||
+ | |||
+ | if ($auth-& | ||
+ | print '& | ||
+ | print $lang[' | ||
+ | print ': <a href=& | ||
+ | print '& | ||
+ | } | ||
+ | ?> | ||
+ | & | ||
+ | |||
+ | |||
+ | |||
+ | ===== phpBB 3 integration ===== | ||
+ | |||
+ | phpBB changed the password hashing method in the RC7 version. I hacked together a solution for making it work with auth_mysql. Nothing fancy but it works for me. | ||
+ | |||
+ | Add the following setting to conf/ | ||
+ | & | ||
+ | |||
+ | The important changes to mysql.conf.php are: | ||
+ | & | ||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | & | ||
+ | |||
+ | You then need to add some code to 2 functions in inc/ | ||
+ | |||
+ | In the **auth_verifyPassword** function, add the following check. | ||
+ | |||
+ | & | ||
+ | }elseif (substr($crypt, | ||
+ | | ||
+ | $salt = $crypt; | ||
+ | & | ||
+ | |||
+ | Then in the **auth_cryptPassword** function, add this case: | ||
+ | & | ||
+ | case ' | ||
+ | $phpbb_path = ' | ||
+ | define(' | ||
+ | include_once(DOKU_INC . $phpbb_path . ' | ||
+ | $itoa64 = ' | ||
+ | return _hash_crypt_private($clear, | ||
+ | & | ||
+ | Be sure to change the $phpbb_path variable to your phpBB install directory! | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Comments ==== | ||
+ | |||
+ | Just to say thanks - many (perhaps most) of my phpBB forum users use cookie authentication so to integrate this with DokuWiki is very useful. | ||
+ | |||
+ | Thanks for this plugin first of all... Do have any sample or demo site that has used this setup? Thnx.... [[andotyjazz@gmail.com|Andrew Abogado]] | ||
+ | |||
+ | Ok, I'm terribly sorry but I don't completely understand what all I should be doing to integrate these two things. Is there any way someone could make this a little clearer about which files are being edited where, which of it is mysql, which of the files should be created. That sort of thing. | ||
+ | |||
+ | This is written so poorly. | ||
+ | |||
+ | Very useful idea, but this doesn' | ||
+ | |||
+ | I agree written extremely poorly I am still trying to fix the problems and I've been working on it for 4 hours now! | ||
+ | |||
+ | **A try to explain how to do integration - 26.11.2007** | ||
+ | |||
+ | After hours (And days, believe me) of struggling with all those changes in local.conf and SQL commands I found out that it is so easy.... \\ | ||
+ | Well....there is a lot of stuff mentioned above which is not needed to integrate Dokuwiki in a phpBB board. You need these changes: \\ \\ | ||
+ | |||
+ | Changes to conf/ | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | |||
+ | $conf[' | ||
+ | |||
+ | Then follow the instructions behind **Another phpbb.class.php** \\ | ||
+ | That means: Copy the code completely to a plain text file named phpbb.class.php and store it in inc/auth. \\ | ||
+ | Change the path ($phpbb_root_path = $location.' | ||
+ | Next, do the changes below the code window: \\ \\ | ||
+ | Now, you must edit the files in dokuwiki/ | ||
+ | $location = ' | ||
+ | Do it word by word. Exactly in the way how it is described. \\ | ||
+ | Now you should be done. The users have to be registered with the forum and if they open the wiki accordingly, | ||
+ | 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. \\ | ||
+ | Please drop a note if you got this to work. If not, too. ;-) And a big & | ||
+ | |||
+ | **@gonzo99 It worked! (phpBB 2.0.22 & DokuWiki 2007-06-26b)**\\ | ||
+ | But I discovered one Problem yet:\\ | ||
+ | When editing a page, if I try to use & | ||
+ | But: **Many thanks to gonzo99!**\\ | ||
+ | --- **berlindave** 2007-12-15 21:45 | ||
+ | |||
+ | I just wrote a new [[integrate with phpbb3|phpBB 3 integration guide]]. I hope it's useful for someone. :-)\\ | ||
+ | P.S.: This page should really be splitted in several ones. | ||
+ | --- // |