Cross site session integration

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: phpBB 3.1.x is at its End of Life stage and support will NOT be provided after July 1st, 2018.
Locked
User avatar
Going4Quests
Registered User
Posts: 77
Joined: Sat Sep 07, 2013 7:34 am

Cross site session integration

Post by Going4Quests »

So we wanted to integrate our phpBB sessions into our site but sadly this isnt working. I have upload the config.php file of our forum and this code (which are both being included_once in the header).

Code: Select all

define('IN_PHPBB', true);
define('ROOT_PATH', "/forumtest");

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);
The forum we are trying to link to is located in /forumtest. However sadly after doing this, the website itself is gone and only the background appears.

I've used this guide: https://www.phpbb.com/support/docs/en/3 ... tegration/

What has gone wrong? Thanks!
User avatar
Going4Quests
Registered User
Posts: 77
Joined: Sat Sep 07, 2013 7:34 am

Re: Cross site session integration

Post by Going4Quests »

Anyone?
User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10551
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Cross site session integration

Post by Noxwizard »

Your root path should be a relative path.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.
User avatar
Going4Quests
Registered User
Posts: 77
Joined: Sat Sep 07, 2013 7:34 am

Re: Cross site session integration

Post by Going4Quests »

Noxwizard wrote:Your root path should be a relative path.
What does that mean? :oops:
User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10551
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Cross site session integration

Post by Noxwizard »

Your current root path is /forumtest which is an absolute path (it starts with the directory separator /). You should be using relative paths (either starts with a ., .., or the folder name). If your board is at mydomain.com/forumtest/ and the page you are trying to integrate sessions on to is at mydomain.com/page.php, then your root path would be ./forumtest or just forumtest.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.
User avatar
Going4Quests
Registered User
Posts: 77
Joined: Sat Sep 07, 2013 7:34 am

Re: Cross site session integration

Post by Going4Quests »

Noxwizard wrote:Your current root path is /forumtest which is an absolute path (it starts with the directory separator /). You should be using relative paths (either starts with a ., .., or the folder name). If your board is at mydomain.com/forumtest/ and the page you are trying to integrate sessions on to is at mydomain.com/page.php, then your root path would be ./forumtest or just forumtest.
Finally got it working! Now another question, how can I get an echo which style the active user is using? :) (so, if i use prosilver, the echo would be "prosilver". :)

EDIT: I got the style thing working, but if I travel to a page which is not the index page I get this error:
Illegal use of $_GET. You must use the request class or request_var() to access input data. Found in /forumtest/website/index.php on line 73. This error message was generated by deactivated_super_global.

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/request/deactivated_super_global.php
LINE: 67
CALL: trigger_error()

FILE: [ROOT]/phpbb/request/deactivated_super_global.php
LINE: 87
CALL: phpbb\request\deactivated_super_global->error()

FILE: [ROOT]/website/index.php
LINE: 73
CALL: phpbb\request\deactivated_super_global->offsetGet()
What now?
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Cross site session integration

Post by Oyabun1 »

Quick search, Illegal use of $_GET.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
Going4Quests
Registered User
Posts: 77
Joined: Sat Sep 07, 2013 7:34 am

Re: Cross site session integration

Post by Going4Quests »

Oyabun1 wrote:Quick search, Illegal use of $_GET.
Sadly doesn't work. Still the error. :(

EDIT: After Googling I found a fix! viewtopic.php?f=461&t=2270496&p=13798336#p13788226

That post works. :)
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Cross site session integration

Post by Oyabun1 »

Did you read the post a few down from there, viewtopic.php?p=13798336#p13798336? Enabling superglobals is not recommended.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
Going4Quests
Registered User
Posts: 77
Joined: Sat Sep 07, 2013 7:34 am

Re: Cross site session integration

Post by Going4Quests »

Oyabun1 wrote:Did you read the post a few down from there, viewtopic.php?p=13798336#p13798336? Enabling superglobals is not recommended.
Using $request->is_set_post() sadly gives the same error without the super globals thing, so I cant use that. :(
User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10551
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Cross site session integration

Post by Noxwizard »

The Request class should not throw that error. Most likely you have other code that is still using GET/POST/REQUEST directly.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.
Locked

Return to “[3.1.x] Support Forum”