PDA

View Full Version : vB 4.1.0 logs user out automatically


tscargo
12-01-2010, 10:17 AM
Hi,

I have a vB powered site, was working fine on 4.0.6 and upgraded to 4.1.0 today.
Site is still working, but I am using some Javascript that load data into the document via a direct call of a script that uses some vB code.

My php script starts with:

setlocale(LC_ALL, 'nl_NL');

//define globals for vba
define('CWD',$_SERVER['DOCUMENT_ROOT']);
define('THIS_SCRIPT', 'adv_index');
define('VBA_PORTAL', true);
define('VBA_SCRIPT', 'CMPS');
define('VB_AREA', 'custom-ajax');
//includes
require_once(CWD.'/includes/init.php');


Unfortunately this makes the user logout. Any idea what I am doing wrong ?

The only thing I want to be able to use is the $db object....

Any help is very much appreciated.

Thanks,

Taco

ForumsMods
12-01-2010, 10:43 AM
Use this:

setlocale(LC_ALL, 'nl_NL');

//define globals for vba
define('CWD',$_SERVER['DOCUMENT_ROOT']);
define('THIS_SCRIPT', 'adv_index');
define('VBA_PORTAL', true);
define('VBA_SCRIPT', 'CMPS');
define('VB_AREA', 'custom-ajax');
if (!defined('VB_API'))
{
define('VB_API', false);
}
//includes
require_once(CWD.'/includes/init.php');

tscargo
12-01-2010, 11:25 AM
By changing

define('THIS_SCRIPT', 'test');

//init VB
// require_once(CWD.'/includes/init.php');
chdir(CWD);
require_once('./global.php');

I got it all working. Thanks !