The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bad init.php after 4.1.2 install
#1
Hi, let me start by saying thanks for UserSpice! I used usercake 1.x a few years back for a project and that led me to this new and improved version.

I installed latest 4.1 ($user_spice_ver="Version 4.1.2") on Ubuntu 16.04LTS LAMP. The installation went ok, no errors, but here is what I got when trying to access the page:

Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in /var/www/html/S2S_DEV1/users/init.php on line 95

Dug around the init.php file and editor was reporting a syntax error on line 95:
//Check to see that user is verified
if($user->isLoggedIn()){
if($user->data()->email_verified == 0 && $currentPage != 'verify.php' && $currentPage != 'logout.php' && $currentPage != 'verify_thankyou.php'){
Redirect::to('verify.php');
}
}'host' => '192.168.xxx.xxx',
'username' => 'xxxxx',
'password' => 'xxxxx',
'db' => 'S2SDB_DEV1',
),
'remember' => array(
'cookie_name' => 'yyyyyyyyyyyyy',
'cookie_expiry' => 604800 //One week, feel free to make it longer
),
'session' => array(
'session_name' => 'user',
'token_name' => 'token',
)
);




I looked around some of the code on github and playing around with some of the code was able to change it to this:
//Check to see that user is verified
if($user->isLoggedIn()){
if($user->data()->email_verified == 0 && $currentPage != 'verify.php' && $currentPage != 'logout.php' && $currentPage != 'verify_thankyou.php'){
Redirect::to('verify.php');
}
};
$GLOBALS['config'] = array(
'mysql' => array(

'host' => '192.168.xxx.xxx',
'username' => 'xxxxx',
'password' => 'xxxxx',
'db' => 'S2SDB_DEV1',
),
'remember' => array(
'cookie_name' => 'yyyyyyyyyyy',
'cookie_expiry' => 604800 //One week, feel free to make it longer
),
'session' => array(
'session_name' => 'user',
'token_name' => 'token',
)
);




Now, that seems to fix the problem as everything works after that but I have not looked at the code enough to call it a fix. I'm not 100{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d} sure of what I did there so can you guys confirm if that is indeed the missing piece?


Thanks again!
  Reply


Messages In This Thread
Bad init.php after 4.1.2 install - by venedude - 06-05-2016, 02:25 PM
Bad init.php after 4.1.2 install - by venedude - 06-05-2016, 03:19 PM
Bad init.php after 4.1.2 install - by brian - 06-05-2016, 07:54 PM
Bad init.php after 4.1.2 install - by venedude - 06-05-2016, 09:49 PM
Bad init.php after 4.1.2 install - by mudmin - 06-05-2016, 09:53 PM
Bad init.php after 4.1.2 install - by venedude - 06-05-2016, 10:01 PM
Bad init.php after 4.1.2 install - by mudmin - 06-05-2016, 10:05 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)