Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

controllers/auth.php
Go to the documentation of this file.
1 <?php
15 class ezpRestAuthController extends ezcMvcController
16 {
17 public function doBasicAuth()
18 {
19 $res = new ezcMvcResult();
20 $res->status = new ezcMvcResultUnauthorized( "Exponential REST" );
21 return $res;
22 }
23
24 public function doOauthRequired()
25 {
26 $res = new ezcMvcResult();
27 $statusCode = ezpOauthFilter::STATUS_TOKEN_UNAVAILABLE;
28 if ( isset( $this->ezpAuth_reason ) )
29 {
30 $statusCode = $this->ezpAuth_reason;
31 }
32
33 switch ( $statusCode )
34 {
35 case ezpOauthFilter::STATUS_TOKEN_UNAVAILABLE:
36 $status = new ezpOauthRequired( ezpOauthRequired::DEFAULT_REALM );
37 $res->variables['error'] = ezpOauthErrorType::INVALID_REQUEST;
38 break;
39
40 case ezpOauthFilter::STATUS_TOKEN_EXPIRED:
41 $status = new ezpOauthRequired( ezpOauthRequired::DEFAULT_REALM, ezpOauthErrorType::EXPIRED_TOKEN );
42 $res->variables['error'] = ezpOauthErrorType::EXPIRED_TOKEN;
43 break;
44
45 case ezpOauthFilter::STATUS_TOKEN_INVALID:
46 $status = new ezpOauthRequired( ezpOauthRequired::DEFAULT_REALM, ezpOauthErrorType::INVALID_TOKEN );
47 $res->variables['error'] = ezpOauthErrorType::INVALID_TOKEN;
48 break;
49
50 case ezpOauthFilter::STATUS_TOKEN_INSUFFICIENT_SCOPE:
51 $status = new ezpOauthRequired( ezpOauthRequired::DEFAULT_REALM, ezpOauthErrorType::INSUFFICIENT_SCOPE );
52 $res->variables['error'] = ezpOauthErrorType::INSUFFICIENT_SCOPE;
53 break;
54
55 default:
56 $status = new ezpOauthRequired( ezpOauthRequired::DEFAULT_REALM, ezpOauthErrorType::INVALID_REQUEST );
57 $res->variables['error'] = ezpOauthErrorType::INVALID_REQUEST;
58 break;
59 }
60
61 $res->status = $status;
62 return $res;
63 }
64 }
65
66 ?>
$status
$status
Definition: bugedit.php:473
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
ezpOauthFilter\STATUS_TOKEN_EXPIRED
const STATUS_TOKEN_EXPIRED
Definition: oauth_filter.php:15
ezpOauthFilter\STATUS_TOKEN_INVALID
const STATUS_TOKEN_INVALID
Definition: oauth_filter.php:14
ezpOauthFilter\STATUS_TOKEN_UNAVAILABLE
const STATUS_TOKEN_UNAVAILABLE
Definition: oauth_filter.php:17
ezpOauthFilter\STATUS_TOKEN_INSUFFICIENT_SCOPE
const STATUS_TOKEN_INSUFFICIENT_SCOPE
Definition: oauth_filter.php:16
ezpOauthRequired
Definition: oauth_required.php:16
ezpOauthRequired\DEFAULT_REALM
const DEFAULT_REALM
Definition: oauth_required.php:17
ezpRestAuthController
Definition: controllers/auth.php:16
ezpRestAuthController\doOauthRequired
doOauthRequired()
Definition: controllers/auth.php:24
ezpRestAuthController\doBasicAuth
doBasicAuth()
Definition: controllers/auth.php:17
$res
$res
Definition: ezstats/admin/cron.php:45
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.