Exemplo n.º 1
0
        $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
    $api->setInputs($_POST);
    //var_dump($api->getInputs());
    $api->adminModuleEmail();
    if ($api->getErrors()) {
        $response->status = 500;
        $response->message = 'Unable to send email';
        $response->data = $api->getErrors();
        $response->json($response);
    }
    $response->json($response);
} elseif ($route->match('adminusers', null)) {
    // Admin only
    if ($user->role !== 1) {
        $response->status = 403;
        $response->message = 'Forbidden';
        $response->json($response);
    }
    $response->data = $model->usersAll(NULL);