Hello,
I have a problem with modx authorization checking from external php script. I wrote a modx_auth.php which contains:
<?php
function isAuthenticatedInModx() {
require_once dirname(dirname(__FILE__)) . '/config.core.php';
require_once MODX_CORE_PATH.'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('mgr');
$modx->getService('error','error.modError');
return ($modx->user->hasSessionContext('mgr')) ? true : false;
}
But when I call isAuthenticatedInModx() function from my external.php file I get nothing, because the function creates a new instance of modX class where I'm not logged in.
How can I check authorization externally in modx revo? Does have Revo any analogs for Evo's startCMSSession() function?