/** * 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()}"; } }
public function process(ezcMvcResponseWriter $writer) { if ($writer instanceof ezcMvcHttpResponseWriter) { // @TODO message lookup $writer->headers["HTTP/1.1 " . ezpOauthErrorType::httpCodeForError($this->errorType)] = ""; } }
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; } }
/** * 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); } }