Jump to content

[SOLVED] phpbb forum modify


mraiur

Recommended Posts

Hi.

  I am trying to make a site whit the phpBB v2 forum and i have a login form but i need to make a connection whit that login form and the login in the phpbb forum so you dont have to login in two places .

But i cant find how ?

 

Can somebody help me whit that ?

 

THX all . And Merry Xmas and happy new Year.

Link to comment
https://forums.phpfreaks.com/topic/83271-solved-phpbb-forum-modify/
Share on other sites

Yes i tried... But it uses Cookies and sessions ... cookies are set in the moment you enter the forum. One of them is a generated SID and that is one of the hardest to find and the other thing is that i cant find how the forum contains the user data ...in the session or the cookie that is .

<?php
$phpbb_root_path  =  './forums/';
                                               
define('IN_PHPBB',  true);

//
//  phpBB  related  files
//

include($phpbb_root_path  .  'extension.inc');
include($phpbb_root_path  .  'common.'  .  $phpEx);
include($phpbb_root_path  .  'includes/bbcode.'  .  $phpEx);

//
//  start  session  management
//

$userdata  =  session_pagestart($user_ip,  PAGE_INDEX);
init_userprefs($userdata);
       
if($userdata['session_logged_in']) 
{
        $db  =  mysql_connect(DB_SERVER,  DB_USER,  DB_PASS);
        mysql_select_db(DB_NAME,$db);
        $session->startSession();
        $session->userinfo    =  $database->getUserInfo($userdata['username']);
        $session->logged_in  =  1;
        $session->username    =  $_SESSION['username']  =  $userdata['username'];
        $session->userid        =  $_SESSION['userid']      =  $session->userinfo['userid'];
        $session->userlevel  =  $session->userinfo['userlevel'];
        $session->sessionid  =  $userdata['session_id'];
        $session->time  =  $userdata['session_start'];
       
        $database->updateUserField($session->username,  "userid",  $session->userid);
        $database->addActiveUser($session->username,  $session->time);
        $database->removeActiveGuest($_SERVER['REMOTE_ADDR']);       
}
$db  =  mysql_connect(DB_SERVER,  DB_USER,  DB_PASS);
mysql_select_db(DB_NAME,$db);
?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.