Custom Auth and Routing
Since 5.0RC3 the ajax framework allows for custom authentication and custom routing without making changes to the core files.
There is a file: cjax/auth.default.php, in this file there is a further information and framework functionality to create custom validation and routes. For changes to take effect you must rename file auth.default.php to auth.php.
Auth and Routing
File auth.php has a class name "AjaxAuth", in this class there are two methods,
one of them is "validation" - triggers at validation before the
ajax request is finished and allows you to write your own custom validation code.
The other function is "intercept" - provides you with a section
where you can create your custom code to route ajax requests to other parts of your application.
Note: If a controller name is the same name as a Cjax plugin, the request will be routed to that controller plugin's directory.
AuthReturning true indicates that the session is valid. If your return false the request will not proceed and will present an error.
function validate($controller = null, $function = null, $args = array())
RoutingAjax Routes are specially needed if your application supports plugins or addons, then these addons may also have full access to the ajax framework and feed ajax requests through your custom route.
The intercept function gives you space to write your own custom routes. Returning "true" in the intercept function would tell the framework not to persue the request any longer and indicates that your route has taken lead of the request. Returning false would give back the control to the framework and continue the request as it normally would.
function intercept($controller = null, $function = null , $args = array(), $requestObj = null)