Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

outh_error_type.php
Go to the documentation of this file.
1 <?php
12 class ezpOauthErrorType
13 {
14 const INVALID_REQUEST = 'invalid_request';
15 const INVALID_TOKEN = 'invalid_token';
16 const EXPIRED_TOKEN = 'expired_token';
17 const INSUFFICIENT_SCOPE = 'insufficient_scope';
18
19 public static function httpCodeforError( $error )
20 {
21 // These HTTP response codes are extracted from Section 5.2.1 of the oauth2.0 spec.
22 switch ( $error )
23 {
24 case self::INVALID_REQUEST:
25 return ezpHttpResponseCodes::BAD_REQUEST;
26 break;
27 case self::INVALID_TOKEN:
28 case self::EXPIRED_TOKEN:
29 return ezpHttpResponseCodes::UNAUTHORIZED;
30 break;
31 case self::INSUFFICIENT_SCOPE:
32 return ezpHttpResponseCodes::FORBIDDEN;
33 break;
34 default:
35 return ezpHttpResponseCodes::SERVER_ERROR;
36 break;
37 }
38 }
39 }
40 ?>
ezpHttpResponseCodes\BAD_REQUEST
const BAD_REQUEST
Definition: http_response_codes.php:15
ezpHttpResponseCodes\UNAUTHORIZED
const UNAUTHORIZED
Definition: http_response_codes.php:16
ezpHttpResponseCodes\SERVER_ERROR
const SERVER_ERROR
Definition: http_response_codes.php:20
ezpHttpResponseCodes\FORBIDDEN
const FORBIDDEN
Definition: http_response_codes.php:17
ezpOauthErrorType
Definition: outh_error_type.php:13
ezpOauthErrorType\httpCodeforError
static httpCodeforError( $error)
Definition: outh_error_type.php:19
ezpOauthErrorType\INSUFFICIENT_SCOPE
const INSUFFICIENT_SCOPE
Definition: outh_error_type.php:17
ezpOauthErrorType\EXPIRED_TOKEN
const EXPIRED_TOKEN
Definition: outh_error_type.php:16
ezpOauthErrorType\INVALID_TOKEN
const INVALID_TOKEN
Definition: outh_error_type.php:15
ezpOauthErrorType\INVALID_REQUEST
const INVALID_REQUEST
Definition: outh_error_type.php:14
$error
$error
Definition: ezarticle/admin/categoryedit.php:51
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.