* @package TYPO3 */ $TYPO3_AJAX = TRUE; // include t3lib_div at this time to get the GET/POST methods it provides require_once(dirname(__FILE__) . '/../t3lib/class.t3lib_div.php'); // first get the ajaxID $ajaxID = (string)t3lib_div::_GP('ajaxID'); // this is a list of requests that don't necessarily need a valid BE user $noUserAjaxIDs = array( 'BackendLogin::login', 'BackendLogin::logout', 'BackendLogin::refreshLogin', 'BackendLogin::isTimedOut', 'BackendLogin::getChallenge', ); // if we're trying to do an ajax login, don't require a user. if(in_array($ajaxID, $noUserAjaxIDs)) { define('TYPO3_PROCEED_IF_NO_USER', 2); } require('init.php'); require('classes/class.typo3ajax.php'); // finding the script path from the variable $ajaxScript = $TYPO3_CONF_VARS['BE']['AJAX'][$ajaxID]; // instantiating the AJAX object $ajaxObj = t3lib_div::makeInstance('TYPO3AJAX', $ajaxID); $ajaxParams = array(); // evaluating the arguments and calling the AJAX method/function if (empty($ajaxID)) { $ajaxObj->setError('No valid ajaxID parameter given.'); } elseif (empty($ajaxScript)) { $ajaxObj->setError('No backend function registered for ajaxID "'.$ajaxID.'".'); } else { $ret = t3lib_div::callUserFunction($ajaxScript, $ajaxParams, $ajaxObj, FALSE, TRUE); if ($ret === FALSE) { $ajaxObj->setError('Registered backend function for ajaxID "'.$ajaxID.'" was not found.'); } } // outputting the content (and setting the X-JSON-Header) $ajaxObj->render(); ?>