Exemplo n.º 1
0
 /**
  * Uses the passed in $writer to set the HTTP authentication header.
  *
  * @param ezcMvcResponseWriter $writer
  */
 public function process(ezcMvcResponseWriter $writer)
 {
     if ($writer instanceof ezcMvcHttpResponseWriter) {
         $writer->headers['HTTP/1.1 ' . ezpOauthErrorType::httpCodeforError($this->errorType)] = "";
         $writer->headers['WWW-Authenticate'] = "OAuth realm=\"{$this->realm}\"{$this->createErrorString()}";
     }
 }
Exemplo n.º 2
0
 public function process(ezcMvcResponseWriter $writer)
 {
     if ($writer instanceof ezcMvcHttpResponseWriter) {
         // @TODO message lookup
         $writer->headers["HTTP/1.1 " . ezpOauthErrorType::httpCodeForError($this->errorType)] = "";
     }
 }
Exemplo n.º 3
0
 public function process(ezcMvcResponseWriter $writer)
 {
     if ($writer instanceof ezcMvcHttpResponseWriter) {
         $writer->headers["HTTP/1.1 " . ezpOauthErrorType::httpCodeForError($this->errorType)] = "";
     }
     if ($this->message !== null) {
         $writer->response->body = $this->message;
     }
 }
Exemplo n.º 4
0
 /**
  * Uses the passed in $writer to set the HTTP authentication header.
  *
  * @param ezcMvcResponseWriter $writer
  */
 public function process(ezcMvcResponseWriter $writer)
 {
     if ($writer instanceof ezcMvcHttpResponseWriter) {
         $writer->headers['HTTP/1.1 ' . ezpOauthErrorType::httpCodeforError($this->errorType)] = "";
         $writer->headers['WWW-Authenticate'] = "OAuth realm='{$this->realm}'{$this->createErrorString()}";
     }
     if (isset($this->errorType)) {
         $writer->headers['Content-Type'] = 'application/json; charset=UTF-8';
         $body = array('error' => $this->errorType);
         if (isset($this->errorMessage)) {
             $body['error_description'] = $this->errorMessage;
         }
         $writer->response->body = json_encode($body);
     }
 }