I have Laravel running an app and also a PhpBB forum on it. I am trying to do a check to see if the user is logged in using this PHP function which is \App\Helpers
<?php
namespace App\Helpers;
ini_set('display_startup_errors',1);
error_reporting(-1);
error_reporting(E_ALL);
ini_set('display_errors', 'On');
define('IN_PHPBB', true);
$phpbb_root_path = '/home/clashdata/public_html/forum/';
$phpEx = 'php';
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
function isLoggedIn(){
global $user;
if($user->data['is_registered']){
return true;
}else{
return false;
}
}
?>
And I am using this code in my Laravel controller as the if
statement.
if(phpbb::isLoggedIn()){
But the output is what I get here: http://clashdata.tk/search/livesearch?clanname=clans&location=&trophies=0&minmembers=1&maxmembers=50&clanlevel=0
How come this is happening and what can I do to fix it?
redirect()
and another one is clearly stated in the error. – frz3993 Nov 24 '15 at 19:36