I need help with sharing sessions across my main website and myphpBB forum.

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
Hailex
Registered User
Posts: 1
Joined: Fri Apr 27, 2018 10:48 pm
Name: Miguel Antigua

I need help with sharing sessions across my main website and myphpBB forum.

Post by Hailex » Fri Apr 27, 2018 11:15 pm

Hello phpBB community,

I'm trying to develop my website where I can have a session, more specifically an admin session, go from the phpBB forum to my main website to prevent users/guests from accessing special admin tabs that I should only have access to on my main website. I find it redundant to have to make a new table with separate login when I'm using phpBB for login/registering. I want to use my admin account on the forum website to also effect my main website so that I have access to my CMS on the main website.

I have been looking at the following guide: https://www.phpbb.com/support/docs/en/3 ... tegration/

I made the phpBB.php file that it had told me to do.

Code: Select all

define('IN_PHPBB', true);
define('ROOT_PATH', "/path/to/forums");

if (!defined('IN_PHPBB') || !defined('ROOT_PATH')) {
    exit();
}

$phpEx = "php";
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : ROOT_PATH . '/';
include($phpbb_root_path . 'common.' . $phpEx);

$user->session_begin();
$auth->acl($user->data);
But implementing them on the pages with the other code is where I am lost and every time I try to test it I get this error.

Code: Select all

Fatal error: Call to a member function session_begin() on null
I have tried with 'include' on the other files(.php) and then just plugging the code in directly at the top of the file pages but I'm getting no where. Any help or corrections would be appreciated as I am still new to phpBB and php.

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 6 guests