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
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 .

Link to comment
Share on other sites

<?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);
?> 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.