Ejemplo n.º 1
0
Functions::checkRights(__FILE__, $action, Functions::get('token'));
switch ($action) {
    case 'fields_info':
        $data = infoFields();
        break;
    case 'new':
        $data = addRight();
        break;
    case 'update':
        $data = updateRight(Functions::get('id'));
        break;
    case 'info':
        $data = infoRight(Functions::get('id'));
        break;
    case 'delete':
        $data = deleteRight(Functions::get('id'));
        break;
    case 'search':
        $data = searchRight(Functions::get('actionId'), Functions::get('statusId'));
        break;
    case 'list':
        $data = listRights();
        break;
    case 'list_easy':
        $data = listRightsEasy();
        break;
    default:
        Functions::setResponse(400);
}
/* </controller> */
loadview('json', $data);
                    }
                }
            }
        }
    }
}
//execute the corresponding function, or do nothing on bad input
switch ($function) {
    case "create":
        createRight($_POST);
        break;
    case "edit":
        editRight($param, $_POST);
        break;
    case "delete":
        deleteRight($param);
        break;
    case "print":
        printRights($param, $_POST);
        break;
    case "terminate":
        terminateRight($_POST);
        break;
    case "request":
        requestRights($_POST);
        break;
    case "revoke":
        revokeRights($_POST);
        break;
    case "confirm":
        confirmRights($_POST);