示例#1
0
 public function post()
 {
     $request = $this->getSlim()->request();
     // Do the validation - TODO!!!
     //$this->statementValidator->validateRequest($request);
     //$this->statementValidator->validatePutRequest($request);
     if ($this->userService->loggedIn()) {
         // Authorization is always requested
         $this->oAuthService->authorizePost($request);
         $redirectUri = $this->oAuthService->getRedirectUri();
         $this->getSlim()->response->headers->set('Location', $redirectUri);
         Resource::response(Resource::STATUS_FOUND);
     } else {
         // Unauthorized
         Resource::response(Resource::STATUS_UNAUTHORIZED);
     }
 }