phpbb login session

Discuss the integratoin of phpbb and Joomla! here.

Moderator: General Support Moderators

Locked
djtech2k
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Tue Oct 18, 2005 6:32 pm

phpbb login session

Post by djtech2k » Wed Oct 19, 2005 11:58 pm

Hello.

I may be covering already covered ground here, so if I am please excuse me. 

I am trying out joomla 1.03 and I have an existing phpp 2017.  I have successfully integrated the user database but setting up the joomla registration process to create the phpbb login.  I have also imported all existing user data from phpbb into joomla, so from this point forward, the user db's should stay in sync with the exception of phpbb user profile changes.  All my files are seperate and databases are unedited, so I can upgrade or mod anything with no problems and only chnage a couple lines of code in joomla.  My problem now comes to login.  I need to be able to have my users login thru joomla and have that login session be passed directly to phpbb so the user does not have to login again to the phpbb.  My first thought was to use a wrapper and try to mod it.  I have tried the wrapper with a few suggested mods with no success in grabbing the joomla session for phpbb.  I was wondering if anyone here would have a good idea that i can use for a single login for joomla and phpbb for my environment.

User avatar
crow
Joomla! Explorer
Joomla! Explorer
Posts: 304
Joined: Mon Aug 29, 2005 5:17 pm
Location: Austria
Contact:

Re: phpbb login session

Post by crow » Thu Oct 20, 2005 2:30 pm

How you imported Joomla user to PHPBB.
I know there is Comunity Builder Plugin (called phpbb bridge) that plugin work so:
When user registred to joomla (trought Comunity Builder) it will imported in phpbb, also changing profile and so will cause to change profil in phpbb. This plugin is in early alpha or beta version :)).

http://www.mambojoe.com (see if you can be a part of TEST team and try to test phpbb bridge).

I have test this plugin (import in phpbb when user is registred is OK, but it doesnt import OLD joomla user :((.
If you are good in this you can try to help plugin devoleper to make this plugin betther :)).

How you imported joomla user to phpbb can you tell me that :).

Thnx
BosanskoHercegovacki Chat Komjuniti
http://www.chat.ba

djtech2k
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Tue Oct 18, 2005 6:32 pm

Re: phpbb login session

Post by djtech2k » Thu Oct 20, 2005 3:03 pm

crow wrote: How you imported Joomla user to PHPBB.
I know there is Comunity Builder Plugin (called phpbb bridge) that plugin work so:
When user registred to joomla (trought Comunity Builder) it will imported in phpbb, also changing profile and so will cause to change profil in phpbb. This plugin is in early alpha or beta version :)).

http://www.mambojoe.com (see if you can be a part of TEST team and try to test phpbb bridge).

I have test this plugin (import in phpbb when user is registred is OK, but it doesnt import OLD joomla user :((.
If you are good in this you can try to help plugin devoleper to make this plugin betther :)).

How you imported joomla user to phpbb can you tell me that :).

Thnx
I did all of this by hand.  With some help, I edited the registration files for joomla to create users in phpbb whenever they are created in joomla.

Since I have users already in my phpbb and my joomla is new, I wrote some sql scripts to export/import the data into joomla.  After I wrote the scripts, someone gave me 2 php scripts that do something similar, but I have not tried them out yet.

User avatar
crow
Joomla! Explorer
Joomla! Explorer
Posts: 304
Joined: Mon Aug 29, 2005 5:17 pm
Location: Austria
Contact:

Re: phpbb login session

Post by crow » Thu Oct 20, 2005 3:38 pm

I have diferent installation. Joomla 1.0.3 is runing and will be MAIN site, and phpbb is new Vanila installation (with only 1 user admin)
The newly registration will be done trought the CB and phpbb plugin in CB. But i need to transfer older user from joomla user table to phpbb user table.
In your casse are both joomla and phpbb in same databse or diferent?
Can you share thise script to try or something :).

Thnx
BosanskoHercegovacki Chat Komjuniti
http://www.chat.ba

djtech2k
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Tue Oct 18, 2005 6:32 pm

Re: phpbb login session

Post by djtech2k » Thu Oct 20, 2005 4:51 pm

In my case, the phpbb tables and the joomla tables are in the same database but are NOT integrated.  They are completely seperate. 

If you want to transfer the joomla user into the phpbb, I would try something like this:

Code: Select all

insert into phpbb_users (username,user_password,user_email,user_regdate)
select username,password,email,registerDate
from jos_users
This above code assumes that your phpbb data tables and your joomla tables are in a single database.  You may run into trouble with the user_id in the phpbb user table if it is not set to auto_increment.  If you do this import and it does not let you login to phpbb with the imported admin account, then there must be a duplicate username in phpbb OR your imported user did not get a user_id.  If it does not get a user_id, the easiest thing would be to go into your phpbb database and give it a user_id that is 1 number higher than the highest one there already.  I doubt this will happen, but you should be prepared just in case.

The code below is php code that I found that I have not tried out.



Also, here is a way to do it with php.  I found this script.

Code: Select all

<?php 
## Mod Title:phpBB&Mambo Users 
## Mod Version: 0.0.2 :: Segunda Feira, 11 Abril, 2005 22:05 GMT 
## Author: Álvaro Martins alvaromartins@globalfree.net 
## URL: http://www.phpbb.globalfree.net 
## Mod URL: http://www.phpbb.globalfree.net/forum/viewtopic.php?p=102 
## Description: Mambo e phpBB ( standalone ) integração de utilizadores. 
##                   
##                   Para fóruns phpBB já existentes que vão instalar mambo 
##                   Para portais mambo já existentes e que vão instalar o phpBB 
##                   Para instalações novas de mambo e phpBB 
##                   Para instalações já existentes de ambos os sistemas 
// 
// 
// Para portais mambo já existentes e que vão instalar o phpBB 
// 
// 
// Primeira alteração 
// 
// Substituir "basededados", pelo nome da base de dados onde estão as tabelas do phpbb e do mambo 
// Substituir "password" pela password do user associado à base de dados onde estão as tabelas do phpbb e do mambo 
$conn=mysql_connect('localhost','basededados','password');;                 

if ($conn) 
{ 
// 
// 
// Segunda alteração 
// 
// Substituir "basededados", pelo nome da base de dados 
// Substituir "mos_users", pelo nome da tabela de utilizadores do mambo ( mos_users por defeito ) 
   $status = mysql_query("select * from basededados.mos_users"); 
               if($status == false) 
                  echo ("Erro 1"); 
   else 
   { 
   $linha = mysql_fetch_row($status); 
   while($linha != false) 
      { 
           $regdate = strtotime ("now"); 
// Substituir "basededados", pelo nome da base de dados 
// Substituir "phpbb_userss", pelo nome da tabela de utilizadores do phpbb ( phpbb_users por defeito ) 
           $sql="insert into basededados.phpbb_users (username, user_email, user_password, user_regdate) values ('$linha[2]', '$linha[3]', '$linha[4]', '$regdate')"; 
           mysql_query($sql); 
####################################################################################################### 
## Termos de uso: Esta mod não pode ser colocada ou adicionada em foruns nao oficiais de phpBB ou Mambo 
####################################################################################################### 
           $linha = mysql_fetch_row($status); 
           } 
        mysql_close($conn); 
   } 
} 
else 
   echo ("Erro"); 
## Mod Title:phpBB&Mambo Users 
## Mod Version: 0.0.2 :: Segunda Feira, 11 Abril, 2005 22:05 GMT 
## Author: Álvaro Martins alvaromartins@globalfree.net 
## URL: http://www.phpbb.globalfree.net 
## Mod URL: http://www.phpbb.globalfree.net/forum/viewtopic.php?p=102 
## Description: Mambo e phpBB ( standalone ) integração de utilizadores. 
##                   
##                   Para fóruns phpBB já existentes que vão instalar mambo 
##                   Para portais mambo já existentes e que vão instalar o phpBB 
##                   Para instalações novas de mambo e phpBB 
?>

User avatar
crow
Joomla! Explorer
Joomla! Explorer
Posts: 304
Joined: Mon Aug 29, 2005 5:17 pm
Location: Austria
Contact:

Re: phpbb login session

Post by crow » Thu Oct 20, 2005 6:04 pm

I have that code also, from Portugal mod phpbb forum. I have posted here in Portugal forum, and matheus translate it to english,
http://forum.joomla.org/index.php/topic,13282.0.html
Its not easy for me to make it but i will try. And i need to user_id be same as is mambo, because CB plugin modify user table in phpbb when profil is edited and so :))..

Thnx if you get something diferent then post here to :).

Thnx
BosanskoHercegovacki Chat Komjuniti
http://www.chat.ba


Locked

Return to “phpbb - Joomla! Integration”