receiveReq.open("GET", '/assets/components/mytools/connector.php?action=getcontent&c='+ca+'&pid='+pid, true);
receiveReq.onreadystatechange = handlegetContent;
receiveReq.send(null);
{"success":false,"message":"Access denied.","total":0,"data":[],"object":[]}
receiveReq.open("GET", '/assets/components/mytools/connector.php?action=getcontent&c='+ca+'&pid='+pid, true);
receiveReq.setRequestHeader('modAuth', 'modx111111122222);
receiveReq.onreadystatechange = handlegetContent;
receiveReq.send(null);
$basePath = dirname( dirname( dirname( dirname( __FILE__ ) ) )) ;
require_once $basePath . '/config.core.php';
require_once MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
require_once MODX_CONNECTORS_PATH . 'index.php';
$_SERVER['HTTP_MODAUTH'] = $modx->site_id;
//echo $modx->getOption( 'core_path' ) . 'components/mytools/processors/';
$path = $modx->getOption( 'core_path' ) . 'components/mytools/processors/';
$modx->request->handleRequest(array(
'processors_path' => $path,
'location' => '',
));
$basePath = dirname( dirname( dirname( dirname( __FILE__ ) ) )) ;
require_once $basePath . '/config.core.php';
require_once MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
require_once MODX_CONNECTORS_PATH . 'index.php';
//$_SERVER['HTTP_MODAUTH'] = $modx->site_id;
if ($_REQUEST['action'] == 'getcontent') {
$version = $modx->getVersionData();
if (version_compare($version['full_version'],'2.1.1-pl') >= 0) {
if ($modx->user->hasSessionContext($modx->context->get('key'))) {
$_SERVER['HTTP_MODAUTH'] = $_SESSION["modx.{$modx->context->get('key')}.user.token"];
} else {
$_SESSION["modx.{$modx->context->get('key')}.user.token"] = 0;
$_SERVER['HTTP_MODAUTH'] = 0;
}
} else {
$_SERVER['HTTP_MODAUTH'] = $modx->site_id;
}
$_REQUEST['HTTP_MODAUTH'] = $_SERVER['HTTP_MODAUTH'];
}
/* handle request */
$path = $modx->getOption( 'core_path' ) . 'components/mytools/processors/';
$modx->request->handleRequest(array(
'processors_path' => $path,
'location' => '',
));