Property | Type | Description | |
---|---|---|---|
$attributes | authorization attributes. | ||
$authenticated | whether user was successfuly authenticated. | ||
$jsArguments | arguments for the jQuery.eauth() javascript function. | ||
$name | the service name. | ||
$title | the service title to display in views. | ||
$type | the service type (e.g. OpenID, OAuth). |
Method | Description | |
---|---|---|
__get ( string $name ) : mixed | PHP getter magic method. | |
__isset ( string $name ) : boolean | Checks if a attribute value is null. | |
authenticate ( ) : boolean | Authenticate the user. | |
cancel ( $url = null ) | Redirect to the {@link cancelUrl} or simply close the popup window. | |
getAttribute ( string $key, mixed $default = null ) : mixed | Returns the authorization attribute value. | |
getAttributes ( ) : array | Returns the array that contains all available authorization attributes. | |
getCancelUrl ( ) : string | Returns the redirect url after unsuccessful authorization (e.g. user canceled). | |
getComponent ( ) : EAuth | Returns the {@link EAuth} application component. | |
getId ( ) : mixed | Returns the user unique id. | |
getIsAuthenticated ( ) : boolean | Whether user was successfuly authenticated. | |
getItem ( ) : stdClass | Returns the object with a human-readable representation of the current authorization. | |
getItemAttributes ( ) : array | Returns the array that contains all available authorization attributes. | |
getJsArguments ( ) : array | Returns arguments for the jQuery.eauth() javascript function. | |
getRedirectUrl ( ) : string | Returns the redirect url after successful authorization. | |
getServiceName ( ) : string | Returns service name(id). | |
getServiceTitle ( ) : string | Returns service title. | |
getServiceType ( ) : string | Returns service type (e.g. OpenID, OAuth). | |
hasAttribute ( string $key ) : boolean | Whether the authorization attribute exists. | |
init ( EAuth $component, array $options = [] ) | Initialize the component. | |
redirect ( string $url = null, array $params = [] ) | Redirect to the url. If url is null, {@link redirectUrl} will be used. | |
setCancelUrl ( $url ) | Sets redirect url after unsuccessful authorization (e.g. user canceled). | |
setComponent ( EAuth $component ) | Sets {@link EAuth} application component | |
setRedirectUrl ( $url ) | Sets redirect url after successful authorization. |
Method | Description | |
---|---|---|
_fetchAttributes ( ) | Fetch attributes array. | |
fetchAttributes ( ) : boolean | Fetch attributes array. | |
fetchJsonError ( stdClass $json ) : array | Returns the error info from json. | |
getState ( string $key, mixed $defaultValue = null ) : mixed | Returns the value of a variable that is stored in eauth session. | |
getStateKeyPrefix ( ) : string | ||
hasState ( string $key ) : boolean | Returns a value indicating whether there is a state of the specified name. | |
initRequest ( string $url, array $options = [] ) : cURL | Initializes a new session and return a cURL handle. | |
makeRequest ( string $url, array $options = [], boolean $parseJson = true ) : stdClass | Makes the curl request to the url. | |
parseJson ( string $response ) : object | Parse response from {@link makeRequest} in json format and check OAuth errors. | |
setState ( string $key, mixed $value, mixed $defaultValue = null ) | Stores a variable in eauth session. |
protected _fetchAttributes ( ) |
public authenticate ( ) : boolean | ||
return | boolean | whether user was successfuly authenticated. |
public cancel ( $url = null ) |
protected fetchAttributes ( ) : boolean | ||
return | boolean | whether the attributes was successfully fetched. |
protected fetchJsonError ( stdClass $json ) : array | ||
$json | stdClass | the json response. |
return | array | the error array with 2 keys: code and message. Should be null if no errors. |
public getAttributes ( ) : array | ||
return | array | the attributes. |
public getCancelUrl ( ) : string | ||
return | string | the redirect url after unsuccessful authorization (e.g. user canceled). |
public getComponent ( ) : EAuth | ||
return | EAuth | the {@link EAuth} application component. |
public getIsAuthenticated ( ) : boolean | ||
return | boolean | whether user was successfuly authenticated. |
public getItem ( ) : stdClass | ||
return | stdClass | the object. |
public getItemAttributes ( ) : array | ||
return | array | the attributes. |
public getJsArguments ( ) : array | ||
return | array | the arguments for the jQuery.eauth() javascript function. |
public getRedirectUrl ( ) : string | ||
return | string | the redirect url after successful authorization. |
public getServiceName ( ) : string | ||
return | string | the service name(id). |
public getServiceTitle ( ) : string | ||
return | string | the service title. |
public getServiceType ( ) : string | ||
return | string | the service type (e.g. OpenID, OAuth). |
protected getStateKeyPrefix ( ) : string | ||
return | string | a prefix for the name of the session variables storing eauth session data. |
public hasAttribute ( string $key ) : boolean | ||
$key | string | the attribute name. |
return | boolean | true if attribute exists, false otherwise. |
protected initRequest ( string $url, array $options = [] ) : cURL | ||
$url | string | url to request. |
$options | array | HTTP request options. Keys: query, data, referer. |
return | cURL | handle. |
public setCancelUrl ( $url ) |
public setComponent ( EAuth $component ) | ||
$component | EAuth | the application auth component. |
public setRedirectUrl ( $url ) |
protected $authenticated |
protected $jsArguments |