I'm trying to make a calendar for my forums usage using phpBBs login functionality to restrict it to registered users.
Here's the logInManager.php that's supposed to handle the phpBB login:
Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? 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['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN']);
}
?>
Code: Select all
<script type="text/javascript"><?php require_once('logInManager.php') ?></script>
but it keeps failing on reaching
Code: Select all
$user->session_begin();
Thanks!
EDIT
tought my phpBB root path might be the cause, the site is located
Code: Select all
www.mysite.com/phpBBforum/pagedirectory/calendar.php
Ok figured it out, I had the root phpBB directory one above my pages so I had wrong directory in
Code: Select all
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
Code: Select all
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';