eZPublishCommunityProject(LegacyStack)  2013.6
authorize.php File Reference

Namespaces

 oauth
 File containing the oauth/authorize view definition.
 

Functions

if($pResponseType== 'token')
elseif($pResponseType== 'code') 
error ($redirectUri, $errorCode, $message=null)
 oAuth error handler function. More...
 
 getHTTPVariable ($variable)
 Helper function that reads an HTTP variable over GET or POST, depending on the stage. More...
 
 response ($httpHeader, $location=null)
 oAuth2 response handler function. More...
 

Variables

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

Function Documentation

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

oAuth error handler function.

Terminates execution after redirecting.

Parameters
string$redirectUriThe URI the error should be sent to
string$errorCodeThe error code, as defined in section 3.2.1
string$messageA human readable error message explaining the error
Returns
void
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
response (   $httpHeader,
  $location = null 
)

oAuth2 response handler function.

Terminates execution after sending the headers.

Parameters
string$httpHeaderThe HTTP header to be sent as a response
string$locationThe location to redirect to. No redirection is done if not provided.
Returns
void

Referenced by error().

Variable Documentation

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