ja:tips:integrate_with_phpbb
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン | 最新のリビジョン両方とも次のリビジョン | ||
wiki:ja:tips:integrate_with_phpbb [2007-11-01 11:00] – gangan | wiki:ja:tips:integrate_with_phpbb [2007-11-01 11:02] – gangan | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== phpBBとの連携====== | ||
+ | **日本人のPHPBB使いの方、ここに情報を集めましょう **^_^ | ||
+ | |||
+ | この改造は、phpBBユーザーを、dokuWikiのユーザーとして利用します。dokuWikiに対する権限は、phpBBのグループをdokuWikiのアクセスコントロール>グループで登録することにより操作できます。 | ||
+ | phpBBユーザーの所属するグループと、dokuWikiのグループが一致しない場合 dokuWikiは グループ ALL として動作します | ||
+ | |||
+ | > Information regarding this topic could also be found in [[auth_mysql|Authenticationbackend: | ||
+ | |||
+ | > **A new authentication class** has been added to the end of this document which should work with phpbb' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Requirements ===== | ||
+ | |||
+ | * A working installation of phpBB | ||
+ | * A working installation of dokuWiki | ||
+ | * Some patience | ||
+ | |||
+ | Facts | ||
+ | |||
+ | *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 / | ||
+ | |||
+ | ===== 動作確認済みの作業流れ===== | ||
+ | 前提: | ||
+ | - dokuwiki の管理権限Gr(デフォルトグループ:admin) と、編集Gr(デフォルトグループ:user) の2つを確認。 | ||
+ | - phpbb側に グループ adminとuserを作成。 adminは隠れグループ。userは、オープングループまたはクローズドグループを推奨。 | ||
+ | - phpbb側のadminグループのモデレータはphpBBの管理者 phpbb側のuserグループには一般ユーザーを登録 | ||
+ | |||
+ | 編集Grを新たに作成する(追加する)場合、user のu より前のアルファベットでないと、グループが認識されないようだ.・・・vwxyzで始まるグループ名は使用しない。userグループは削除しないほうが無難(dokuwiki-2007-06-26b) | ||
+ | |||
+ | その後 | ||
+ | * conf/ | ||
+ | * inc/ | ||
+ | で、簡単に動作しました | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Steps ===== | ||
+ | |||
+ | - [[# | ||
+ | - [[# | ||
+ | - [[# | ||
+ | - [[# | ||
+ | |||
+ | 管理権限を持つadminグループと、編集可能なuserグループのみの単純な管理であれば、1と4のみ。 | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Configure auth_mysql ===== | ||
+ | |||
+ | :!: 私の環境ではこの方法では動作しませんでした。(phpBB 2.0.22 / dokuwiki-2007-06-26b) 動作したのは -> | ||
+ | |||
+ | **conf/ | ||
+ | |||
+ | |||
+ | We use phpBBs '' | ||
+ | |||
+ | <code php> | ||
+ | $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=' | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ==== Configure auth_mysql Fix ==== | ||
+ | :!: 私の環境では上記は動作せず、下記で動作しました(phpBB 2.0.22 / dokuwiki-2007-06-26b) | ||
+ | |||
+ | **conf/ | ||
+ | |||
+ | $conf[' | ||
+ | $conf[' | ||
+ | 文字コードはUTF-8です | ||
+ | <code php> | ||
+ | <?php | ||
+ | /* | ||
+ | * Dokuwiki' | ||
+ | * Auto-generated by config plugin | ||
+ | * Date: | ||
+ | */ | ||
+ | |||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $conf[' | ||
+ | $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=' | ||
+ | |||
+ | @include(DOKU_CONF.' | ||
+ | |||
+ | // end auto-generated content | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== 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 " | ||
+ | |||
+ | **UNION**が使用できるのはMysql4.0以降です | ||
+ | |||
+ | <code php> | ||
+ | $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=' | ||
+ | | ||
+ | | ||
+ | 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 === | ||
+ | |||
+ | <code php> | ||
+ | $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=' | ||
+ | | ||
+ | | ||
+ | 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 '' | ||
+ | |||
+ | <code php> | ||
+ | |||
+ | 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? FIXME | ||
+ | |||
+ | Well, like above. To add the // | ||
+ | <code php> | ||
+ | $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 acl.auth is described in [[acl]]. The group names are the ones that you have created in phpBB. | ||
+ | |||
+ | ===== 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 " | ||
+ | |||
+ | <code php> | ||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | </ | ||
+ | |||
+ | Then I've set the signature template to: | ||
+ | |||
+ | <code php> | ||
+ | $conf[' | ||
+ | </ | ||
+ | |||
+ | (both modifications go into local.php, see [[config]]) | ||
+ | |||
+ | The signature is now an [[interwiki]] link, which i have set to: | ||
+ | |||
+ | < | ||
+ | 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. | ||
+ | |||
+ | <code php> | ||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | |||
+ | $conf[' | ||
+ | </ | ||
+ | |||
+ | If you followed the instructions to integrate with phpBB above you already have lines like this. | ||
+ | |||
+ | <code php> | ||
+ | $conf[' | ||
+ | FROM phpbb_users | ||
+ | WHERE username=' | ||
+ | </ | ||
+ | |||
+ | I commented that line out so that it looked like this. | ||
+ | |||
+ | <code php> | ||
+ | // | ||
+ | // 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 ===== | ||
+ | **inc/ | ||
+ | |||
+ | 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 | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | /** | ||
+ | * 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) && !$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===== | ||
+ | |||
+ | :!: 動作確認済み(phpBB 2.0.22 / | ||
+ | |||
+ | $phpbb_root_path = $location.' | ||
+ | |||
+ | |||
+ | 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. | ||
+ | <code php> | ||
+ | <?php | ||
+ | /** | ||
+ | * 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 <> " . TRUE . " | ||
+ | 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 <> " . TRUE; | ||
+ | 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 '' | ||
+ | <code php> | ||
+ | This is important to find the phpBB path. | ||
+ | |||
+ | |||
+ | --- //DevO 2007-06-14// | ||
+ | |||
+ | Why not change the code to this? | ||
+ | <code php> | ||
+ | $location = DOKU_AUTH.'/ | ||
+ | $phpbb_root_path = $location.$conf[' | ||
+ | </ | ||
+ | |||
+ | Then set in dokuwiki.php | ||
+ | |||
+ | <code php> | ||
+ | $conf[' | ||
+ | </ | ||
+ | |||
+ | ===== Register and resend password links ===== | ||
+ | Change the links in the inc/ | ||
+ | <code php> | ||
+ | <? | ||
+ | if($auth-> | ||
+ | print '< | ||
+ | print $lang[' | ||
+ | print ': <a href=" | ||
+ | |||
+ | print '</ | ||
+ | } | ||
+ | |||
+ | if ($auth-> | ||
+ | print '< | ||
+ | print $lang[' | ||
+ | print ': <a href=" | ||
+ | print '</ | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== 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! | ||
+ | |||
+ | Is there going to be a similar write-up for the new phpBB3 forums? |
ja/tips/integrate_with_phpbb.txt · 最終更新: 2011-01-14 15:56 by 61.213.142.216