Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Location
    Florida
    Posts
    155
    Thanks
    16
    Thanked 2 Times in 2 Posts

    phpBB and site implementation

    I already have a site that has its own login system. I would also love to have a forum. I have no idea how to code one myself and google search results just came up with "have a forum for your site in minutes by installing....". So I saw the phpBB was one of the best free ones. The problem is, I don't want my users to have to sign up twice, once for the site and the second for the forums.


    So I ask, is it possible to integrate my user table with phpBB's user table? If not, any suggestions on where to go?

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Yes, but the amount of work to do so is dependant on what you have.
    Sounds like the only table you need to migrate is the users table. This is the approach I'd take to this.
    First, install PHPBB (and yes, PHPBB is one of the good ones, bonus that its free). Then, you need to find a way to migrate your current datastructure into the new datastructure. Most of these will be a simple SELECT INTO, or SELECT and INSERT/UPDATE. The tricky one will be the passwords. There is no standard to writing passwords hashing, so you need to determine what it is that PHPBB is using. Sometimes its simple; sometimes its not.
    Once complete, you then need to modify your current scripts to either deal with the new table, or use the login interface provided from PHPBB. Both are easy to do, its the data migration thats the hard part. Remember not to delete your original table until you have verified with testing that its doing ok. If your passwords are currently hashed, you'll need to modify both your current scripts and the PHPBB scripts to allow an intercepting password table. If the user has a record existing on this table, force them to change their password (even if its to the same). Alternatively, PHPBB should have a lost password recovery form; I'd assume there is a way to batch send this, so you wouldn't need to even bother with the third table, just make all of your users use the password recovery system. Even a simple world readable notification of this being the case (explaining that passwords cannot be converted) should be good enough. Also, there is a potential that you are using the same hashing system, or similar to PHPBB.

    Unless of course your current software is OO with a DAO backend. Then its a matter of writting a simple new DAO pointing to the PHPBB table instead of the original, and wrap it in an adapter to match your current properties. Password issue will still apply, but much less work this way.

    As mentioned, if you are using the same, or similar hashing system, there may be no need to concern yourself when migrating the data.
    For example, a simple common one for starter scripts with PHP would be:
    PHP Code:
    $password md5($password); 
    Now, vBulletin I believe uses:
    PHP Code:
    $password md5(md5($password) . $salt); 
    Where $salt is a 3 random character string. If you currently just have md5, and PHPBB uses something similar to the salting technique, your already half way there. You can at this point directly convert your current passwords into the passwords required by PHPBB.

    The migration script won't be to bad to write, but you may have complications regarding runtimes or memory executing it through the web. For this, I'd look at either allowing infinite run scripts in the background (until completion of course), or executing on the cli.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • Users who have thanked Fou-Lu for this post:

    The reaper (06-25-2010)

  • #3
    Regular Coder
    Join Date
    Oct 2009
    Location
    Florida
    Posts
    155
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Wow that is a lot of info! You have greatly helped me out. I understand what you are explaining and will start to look into it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •