예제 #1
0
})->add($auth);
$app->put('/user/{uid}/details', function ($request, $response, $args) {
    $member = new \Models\Member();
    $response->write($member->updateMemberDetails($args['uid'], $request->getParsedBody(), \Middleware\Authenticate::$requestUid));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;
})->add($auth);
$app->put('/user/{uid}/pass', function ($request, $response, $args) {
    $member = new \Models\Member();
    $response->write($member->updatePassword($args['uid'], $request->getParsedBody(), \Middleware\Authenticate::$requestUid));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;
})->add($auth);
$app->put('/user/{uid}/groups', function ($request, $response, $args) {
    $member = new \Models\Member();
    $response->write($member->updateGroupSort($request->getParsedBody(), $args['uid'], \Middleware\Authenticate::$requestUid));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;
})->add($auth);
$app->post('/user', function ($request, $response, $args) {
    $member = new \Models\Member();
    //    error_log( print_r($request->getParsedBody(), 1));
    $response->write($member->addNewMember($request->getParsedBody()));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;
});
$app->post('/emailexists', function ($request, $response, $args) {
    $member = new \Models\Member();
    $response->write($member->emailExists($request->getParsedBody()));
    $newResponse = $response->withHeader('Content-type', 'application/json');
    return $newResponse;