*/ function runSecurityChecks($security, $isAjax = false, $disableAdminCheck = true) { if ($disableAdminCheck) { $security->setIsAdminCheck(false); } if ($isAjax) { $security->runAJAXChecks(); } else { $security->runChecks(); } } /************************* * Define your routes here ************************/ /** * Normal Routes */ $this->create('apptemplate_advanced_index', '/')->action(function ($params) { callController('IndexController', 'index', $params); }); /** * Ajax Routes */ $this->create('apptemplate_advanced_ajax_setsystemvalue', '/setsystemvalue')->post()->action(function ($params) { // only an admin is allowed to save the new systemvalue $container = createDIContainer(); $container['Security']->setIsAdminCheck(true); $container['Security']->setCSRFCheck(true); callAjaxController('AjaxController', 'setSystemValue', $params, $container); });
* @param Security $security: the security object * @param bool $isAjax: if true, the ajax checks will be run, otherwise the normal * checks * @param bool $disableAdminCheck: disables the check for adminuser rights */ function runSecurityChecks($security, $isAjax = false, $disableAdminCheck = true) { if ($disableAdminCheck) { $security->setIsAdminCheck(false); } if ($isAjax) { $security->runAJAXChecks(); } else { $security->runChecks(); } } /************************* * Define your routes here ************************/ /** * Normal Routes */ $this->create('apptemplate_advanced_index', '/')->action(function ($params) { callController('IndexController', 'index', $params); }); /** * Ajax Routes */ $this->create('apptemplate_advanced_ajax_setsystemvalue', '/setsystemvalue')->post()->action(function ($params) { callAjaxController('AjaxController', 'setSystemValue', $params); });