Exemple #1
0
    }
    if ($_REQUEST['task'] == 'save_permission' && Loader::helper("validation/token")->validate('save_permission')) {
        $pk = UserPermissionKey::getByID($_REQUEST['pkID']);
        $pa = PermissionAccess::getByID($_REQUEST['paID'], $pk);
        $pa->save($_POST);
        $pa->clearWorkflows();
        if (is_array($_POST['wfID'])) {
            foreach ($_POST['wfID'] as $wfID) {
                $wf = Workflow::getByID($wfID);
                if (is_object($wf)) {
                    $pa->attachWorkflow($wf);
                }
            }
        }
    }
    if ($_REQUEST['task'] == 'display_access_cell' && Loader::helper("validation/token")->validate('display_access_cell')) {
        $pk = UserPermissionKey::getByID($_REQUEST['pkID']);
        $pa = UserPermissionAccess::getByID($_REQUEST['paID'], $pk);
        Loader::element('permission/labels', array('pk' => $pk, 'pa' => $pa));
    }
    if ($_REQUEST['task'] == 'save_workflows' && Loader::helper("validation/token")->validate('save_workflows')) {
        $pk = UserPermissionKey::getByID($_REQUEST['pkID']);
        $pk->clearWorkflows();
        foreach ($_POST['wfID'] as $wfID) {
            $wf = Workflow::getByID($wfID);
            if (is_object($wf)) {
                $pk->attachWorkflow($wf);
            }
        }
    }
}