Solarpitch Posted June 25, 2007 Share Posted June 25, 2007 Hey, Not having the best day trying to integrate my login with phpbb's one.... but I'll hack on anyway! Kinda just looking for an explanation of this code if possible. The following code... Code to call in my logon. This sets the phpbb session... require 'PHPBB_Login.php'; ************** $user = new User(); $user->login( $nme, $pass ); $phpBB = new PHPBB_Login(); $phpbb->login( $user->id ); ----- line 79 PHPBB_Login.php - code that does the hard part class PHPBB_Login { function PHPBB_Login() { } function login( $phpbb_user_id ) { global $db, $board_config; global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID; // Setup the phpbb environment and then // run through the phpbb login process // You may need to change the following line to reflect // your phpBB installation. require_once( './forum/config.php' ); define('IN_PHPBB',true); // You may need to change the following line to reflect // your phpBB installation. $phpbb_root_path = "./forum/"; require_once( $phpbb_root_path . "extension.inc" ); require_once( $phpbb_root_path . "common.php" ); return session_begin( $phpbb_user_id, $user_ip, PAGE_INDEX, FALSE, TRUE ); } } Basically the code in Blue.. I kinda know what its doing but how could I do the same thing if I wasnt using a class to login a user? ie $user = new User(); At the moment I keep getting Call to a member function login() on a non-object ... line 79 Quote Link to comment Share on other sites More sharing options...
effigy Posted June 25, 2007 Share Posted June 25, 2007 $phpbb should be $phpBB. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.