예제 #1
0
 */
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);
});
예제 #2
0
파일: routes.php 프로젝트: nickfrey/apps
 * @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);
});