I've built web apps before that utilize PhpBB session and user data. The common move is to use code like this:
define('IN_PHPBB', true);
//replace $phpbb_root_path with path to your forum
$phpbb_root_path = '../forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
...however, by including common.php, I bring along a crap-load of other functions that run into other functions I've got setup.
In my example, I'm running the application off CodeIgniter (php framework), which already has a "redirect" function... however, this question should apply to anyone who has pre-built functions that may run into the phpBB functions.
Basically, all I need is to:
- Make sure the user is logged in ($user->data[username] == Anonymous)
- Utilize data from '$user->data' such as the user's ID, screenname, etc.
Could I grab the $user->data array and somehow save it to my own session? Any ideas?
Much thanks.