Пример #1
0
    //$response->data = $model->modulesAllNotVerified();
    //$where = ($user->role > 1 ? array('user_id' => $user->id) : null);
    $response->data = $model->modulesAll(NULL);
    $response->json($response);
} elseif ($route->match('adminmoduleverify', null)) {
    // Admin only
    if ($user->role !== 1) {
        $response->status = 403;
        $response->message = 'Forbidden';
        $response->json($response);
    }
    // Prepare and sanitize post input
    $api->setInputs($_POST);
    //    var_dump($api->getInputs());
    //    die;
    $api->adminModuleVerify();
    if ($api->getErrors()) {
        $response->status = 500;
        $response->message = 'Unable to update the module';
        $response->data = $api->getErrors();
        $response->json($response);
    }
    $response->json($response);
} elseif ($route->match('adminmoduleemail', null)) {
    // Admin only
    if ($user->role !== 1) {
        $response->status = 403;
        $response->message = 'Forbidden';
        $response->json($response);
    }
    // Prepare and sanitize post input