Page 1 of 1

Phpbb website login intergration

Posted: Fri Aug 14, 2015 10:57 am
by ravir
Hi, I'm using this post [viewtopic.php?p=4012075#p4012075] to help me achieve login integration from phpbb into my existing website. When I add the following code into my login page:

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
 
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

if($user->data['is_registered'])
{
    //User is already logged in
}
else
{
    $username = request_var('username', '', true);
    $password = request_var('password', '', true);

    $result = $auth->login($username, $password);

    if ($result['status'] == LOGIN_SUCCESS)
    {
        //User was successfully logged into phpBB
    }
    else
    {
        //User's login failed
    }
}
?>
I am given this error:
Array ( [status] => 10 [error_msg] => LOGIN_ERROR_USERNAME [user_row] => Array ( [user_id] => 1 ) ) //Users login failed
Thanks in advance

Re: Phpbb website login intergration

Posted: Fri Aug 14, 2015 1:43 pm
by Lumpy Burgertushie
that is quite old and I don't know if the code is still the same etc.

here are some KB articles to help you:
https://www.phpbb.com/support/docs/en/3 ... tegration/
https://www.phpbb.com/support/docs/en/3 ... tegration/

robert