How can I integrate users' logins from my site into phpBB?

后端 未结 4 1996
半阙折子戏
半阙折子戏 2020-12-08 16:56

I need some help with what is probably a newbie question in terms of modifying phpBB.

I have a whole system developed in PHP, and I would like to integrate phpBB so

相关标签:
4条回答
  • 2020-12-08 17:26

    I just worked on this task today, after some investigation implemented an Authentication plugin Here is a good example Getting phpBB to accept Django sessions

    0 讨论(0)
  • 2020-12-08 17:26

    You can use the below to login into phpBB:

    $result=$auth->login($username, $password);
    
    if ($result['status'] == LOGIN_SUCCESS) {
    
      echo "You're logged in";
    
    } else {
    
      echo $user->lang[$result['error_msg']];
    
    }
    
    0 讨论(0)
  • 2020-12-08 17:27

    This is an old question so I'm sure you've worked something out by now, but if you need to refactor things in the future, this is entirely possible with authentication plugins in phpBB3:

    http://wiki.phpbb.com/Authentication_plugins

    I'm working on one now where phpBB is the "secondary" system, and it's going pretty well.

    0 讨论(0)
  • 2020-12-08 17:34

    I have integrated phpBB with a site before, however I used phpBB's login system/users table as the primary one as you said. Since phpBB is a pretty advanced forum software, it would be a pretty time consuming project to change its user and login system completely.

    When I had to use the site's login as the primary one, I used PunBB. It was way simpler to modify PunBB.

    If you absolutely have to use your own login as primary, and phpBB, then I agree with you in that the easiest way would be to keep the tables synchronized, and call both the login scripts when somebody logs in.

    When you're inserting data into phpBB, the users table is pretty straightforward. Each entry has the basic info for a user, and if you have custom fields for the user profiles, they go into the profile_fields and profile_fields_data tables.

    One tricky thing is how phpBB encrypts user passwords. I think you have to use phpBB's function called phpbb_hash($password) to do that. It's declared in the file phpbb/includes/functions.php

    For the phpBB login code, see funciton login_box in file phpbb/includes/functions.php

    0 讨论(0)
提交回复
热议问题