Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Namespaces | Functions | Variables
authorize.php File Reference

Go to the source code of this file.

## Namespaces
| oauth

## Functions
if( $pResponseType=='token') elseif( $pResponseType=='code') | error ( $redirectUri, $errorCode, $message=null)
| response ( $httpHeader, $location=null)
| getHTTPVariable ( $variable)

## Variables
| $module = $Params['Module']
| $http = eZHTTPTool::instance()
| $restINI = eZINI::instance( 'rest.ini' )
if(( $pRedirectUri=getHTTPVariable( 'redirect_uri'))===false) if(( $pClientId=getHTTPVariable( 'client_id'))===false) if(( $pResponseType=getHTTPVariable( 'response_type'))===false) | $pScope = getHTTPVariable( 'scope' )
| $application = ezpRestClient::fetchByClientId( $pClientId )
if(! $application instanceof ezpRestClient) if(! $application->isEndPointValid( $pRedirectUri)) | $user = eZUser::currentUser()
if(! $user->isRegistered()) | $access = $user->hasAccessTo( 'oauth', 'authorize' )
if(! $application->isAuthorizedByUser( $pScope, eZUser::currentUser())) | $tokenTTL = (int)$restINI->variable( 'OAuthSettings', 'TokenTTL' )

## Function Documentation

## ◆ error()

if ($pResponseType=='token') elseif ($pResponseType=='code') error | ( |  | $redirectUri,
|  |  | $errorCode,
|  |  | $message = `null`
| ) |  |

oAuth error handler function. Terminates execution after redirecting.

Parameters

  string | $redirectUri | The URI the error should be sent to
  string | $errorCode | The error code, as defined in section 3.2.1
  string | $message | A human readable error message explaining the error

Returns
  void

Definition at line 215 of file authorize.php.

References $location, $message, and response().

## ◆ getHTTPVariable()

getHTTPVariable | ( |  | $variable | ) |

Helper function that reads an HTTP variable over GET or POST, depending on the stage. The POST variables AuthorizeButton and DenyButton will make the function read from POST

Parameters

  string | $variable |

Returns
  mixed The parameter, or false if not set

Definition at line 247 of file authorize.php.

References $http.

## ◆ response()

response | ( |  | $httpHeader,
|  |  | $location = `null`
| ) |  |

oAuth2 response handler function. Terminates execution after sending the headers.

Parameters

  string | $httpHeader | The HTTP header to be sent as a response
  string | $location | The location to redirect to. No redirection is done if not provided.

Returns
  void

Definition at line 231 of file authorize.php.

References $location, and eZExecution\cleanExit().

Referenced by error().

## Variable Documentation

## ◆ $access

if (! $user->isRegistered()) $access = $user->hasAccessTo( 'oauth', 'authorize' )

Definition at line 88 of file authorize.php.

Referenced by eZWebDAVContentBackendAuth\authorize(), eZSiteAccess\change(), eZSiteAccess\getIni(), eZSiteAccess\load(), eZSiteAccess\match(), eZSession\registerFunctions(), and eZWebDAVContentBackend\setCurrentSite().

## ◆ $application

$application = ezpRestClient::fetchByClientId( $pClientId )

Definition at line 51 of file authorize.php.

## ◆ $http

$http = eZHTTPTool::instance()

Definition at line 20 of file authorize.php.

Referenced by eZContentObjectState\fetchHTTPPersistentVariables(), eZContentObjectStateGroup\fetchHTTPPersistentVariables(), getHTTPVariable(), ezpMobileDeviceRegexpFilter\redirect(), and ezpKernelWeb\run().

## ◆ $module

$module = $Params['Module']

Definition at line 17 of file authorize.php.

## ◆ $pScope

if (($pRedirectUri=getHTTPVariable('redirect_uri'))===false) if (($pClientId=getHTTPVariable('client_id'))===false) if (($pResponseType=getHTTPVariable('response_type'))===false) $pScope = getHTTPVariable( 'scope' )

Definition at line 46 of file authorize.php.

## ◆ $restINI

$restINI = eZINI::instance( 'rest.ini' )

Definition at line 21 of file authorize.php.

## ◆ $tokenTTL

if (! $application->isAuthorizedByUser($pScope, eZUser::currentUser())) $tokenTTL = (int)$restINI->variable( 'OAuthSettings', 'TokenTTL' )

Definition at line 137 of file authorize.php.

Referenced by ezpRestOauthTokenController\doHandleRequest(), ezpOauthUtility\doRefreshToken(), and ezpOauthUtility\doRefreshTokenWithAuthorizationCode().

## ◆ $user

if (! $application instanceof ezpRestClient) if (! $application->isEndPointValid($pRedirectUri)) $user = eZUser::currentUser()

Definition at line 64 of file authorize.php.

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.