Public Member Functions | |
__get ($name) | |
__isset ($name) | |
init ($component, $options=array()) | |
getServiceName () | |
getServiceTitle () | |
getServiceType () | |
getJsArguments () | |
setComponent ($component) | |
getComponent () | |
setRedirectUrl ($url) | |
getRedirectUrl () | |
setCancelUrl ($url) | |
getCancelUrl () | |
authenticate () | |
getIsAuthenticated () | |
redirect ($url=null) | |
cancel ($url=null) | |
getId () | |
getAttributes () | |
getAttribute ($key, $default=null) | |
hasAttribute ($key) | |
getItem () | |
getItemAttributes () | |
![]() | |
cancel () |
Protected Member Functions | |
makeRequest ($url, $options=array(), $parseJson=true) | |
initRequest ($url, $options=array()) | |
parseJson ($response) | |
fetchJsonError ($json) | |
getStateKeyPrefix () | |
setState ($key, $value, $defaultValue=null) | |
hasState ($key) | |
getState ($key, $defaultValue=null) | |
fetchAttributes () | |
_fetchAttributes () |
Protected Attributes | |
$name | |
$title | |
$type | |
$jsArguments = array() | |
$attributes = array() | |
$authenticated = false |
Definition at line 16 of file EAuthServiceBase.php.
EAuthServiceBase::__get | ( | $name | ) |
PHP getter magic method. This method is overridden so that service attributes can be accessed like properties.
string | $name | property name. |
Definition at line 79 of file EAuthServiceBase.php.
References getAttribute(), and hasAttribute().
EAuthServiceBase::__isset | ( | $name | ) |
Checks if a attribute value is null. This method overrides the parent implementation by checking if the attribute is null or not.
string | $name | the attribute name. |
Definition at line 93 of file EAuthServiceBase.php.
References hasAttribute().
|
protected |
Fetch attributes array. This function is internally used to handle fetched state.
Definition at line 408 of file EAuthServiceBase.php.
References fetchAttributes().
Referenced by getAttribute(), getAttributes(), getId(), and hasAttribute().
EAuthServiceBase::authenticate | ( | ) |
Authenticate the user.
Implements IAuthService.
Reimplemented in EOAuthService, EmailService, EOAuth2Service, TwitterOAuthService, and EOpenIDService.
Definition at line 203 of file EAuthServiceBase.php.
References getIsAuthenticated().
EAuthServiceBase::cancel | ( | $url = null | ) |
Redirect to the cancelUrl or simply close the popup window.
Reimplemented in EmailService.
Definition at line 226 of file EAuthServiceBase.php.
|
protected |
Fetch attributes array.
Reimplemented in MailruOAuthService, VKontakteOAuthService, MoikrugOAuthService, OdnoklassnikiOAuthService, FacebookOAuthService, GoogleOAuthService, TwitterOAuthService, YandexOpenIDService, CustomYandexService, CustomGoogleService, GoogleService, FacebookService, CustomVKontakteService, CustomOdnoklassnikiService, CustomMailruService, and CustomTwitterService.
Definition at line 400 of file EAuthServiceBase.php.
Referenced by _fetchAttributes().
|
protected |
Returns the error info from json.
stdClass | $json | the json response. |
Reimplemented in MailruOAuthService, VKontakteOAuthService, GoogleOAuthService, FacebookOAuthService, and OdnoklassnikiOAuthService.
Definition at line 336 of file EAuthServiceBase.php.
Referenced by parseJson().
EAuthServiceBase::getAttribute | ( | $key, | |
$default = null |
|||
) |
Returns the authorization attribute value.
string | $key | the attribute name. |
mixed | $default | the default value. |
Implements IAuthService.
Definition at line 445 of file EAuthServiceBase.php.
References _fetchAttributes().
Referenced by __get(), getAttributes(), and getItem().
EAuthServiceBase::getAttributes | ( | ) |
Returns the array that contains all available authorization attributes.
Implements IAuthService.
Definition at line 430 of file EAuthServiceBase.php.
References _fetchAttributes(), and getAttribute().
Referenced by getItemAttributes().
EAuthServiceBase::getCancelUrl | ( | ) |
Returns the redirect url after unsuccessful authorization (e.g. user canceled).
Implements IAuthService.
Definition at line 195 of file EAuthServiceBase.php.
Referenced by EmailService\cancel().
EAuthServiceBase::getComponent | ( | ) |
Returns the EAuth application component.
Implements IAuthService.
Definition at line 163 of file EAuthServiceBase.php.
EAuthServiceBase::getId | ( | ) |
Returns the user unique id.
Implements IAuthService.
Definition at line 421 of file EAuthServiceBase.php.
References _fetchAttributes().
Referenced by getItem().
EAuthServiceBase::getIsAuthenticated | ( | ) |
Whether user was successfuly authenticated.
Implements IAuthService.
Definition at line 211 of file EAuthServiceBase.php.
Referenced by EOAuth2Service\authenticate(), EOAuthService\authenticate(), authenticate(), MoikrugOAuthService\makeSignedRequest(), MailruOAuthService\makeSignedRequest(), EOAuthService\makeSignedRequest(), and EOAuth2Service\makeSignedRequest().
EAuthServiceBase::getItem | ( | ) |
Returns the object with a human-readable representation of the current authorization.
Implements IAuthService.
Definition at line 468 of file EAuthServiceBase.php.
References getAttribute(), getId(), and hasAttribute().
EAuthServiceBase::getItemAttributes | ( | ) |
Returns the array that contains all available authorization attributes.
Definition at line 483 of file EAuthServiceBase.php.
References getAttributes().
EAuthServiceBase::getJsArguments | ( | ) |
Returns arguments for the jQuery.eauth() javascript function.
Implements IAuthService.
Definition at line 147 of file EAuthServiceBase.php.
EAuthServiceBase::getRedirectUrl | ( | ) |
Returns the redirect url after successful authorization.
Implements IAuthService.
Definition at line 179 of file EAuthServiceBase.php.
Referenced by EmailService\redirect().
EAuthServiceBase::getServiceName | ( | ) |
Returns service name(id).
Implements IAuthService.
Definition at line 123 of file EAuthServiceBase.php.
Referenced by EOpenIDService\authenticate().
EAuthServiceBase::getServiceTitle | ( | ) |
Returns service title.
Implements IAuthService.
Definition at line 131 of file EAuthServiceBase.php.
EAuthServiceBase::getServiceType | ( | ) |
Returns service type (e.g. OpenID, OAuth).
Implements IAuthService.
Definition at line 139 of file EAuthServiceBase.php.
|
protected |
Returns the value of a variable that is stored in eauth session.
string | $key | variable name. |
mixed | $defaultValue | default value. |
Definition at line 390 of file EAuthServiceBase.php.
References getStateKeyPrefix().
Referenced by OdnoklassnikiOAuthService\getAccessToken(), MailruOAuthService\getAccessToken(), GoogleOAuthService\getAccessToken(), FacebookOAuthService\getTokenUrl(), MailruOAuthService\restoreAccessToken(), VKontakteOAuthService\restoreAccessToken(), and EOAuth2Service\restoreAccessToken().
|
protected |
Definition at line 350 of file EAuthServiceBase.php.
Referenced by getState(), hasState(), and setState().
EAuthServiceBase::hasAttribute | ( | $key | ) |
Whether the authorization attribute exists.
string | $key | the attribute name. |
Implements IAuthService.
Definition at line 459 of file EAuthServiceBase.php.
References _fetchAttributes().
|
protected |
Returns a value indicating whether there is a state of the specified name.
string | $key | state name. |
Definition at line 376 of file EAuthServiceBase.php.
References getStateKeyPrefix().
Referenced by MailruOAuthService\restoreAccessToken(), VKontakteOAuthService\restoreAccessToken(), and EOAuth2Service\restoreAccessToken().
EAuthServiceBase::init | ( | $component, | |
$options = array() |
|||
) |
Initialize the component. Sets the default redirectUrl and cancelUrl.
EAuth | $component | the component instance. |
array | $options | properties initialization. |
Implements IAuthService.
Reimplemented in EOAuthService, and EOpenIDService.
Definition at line 106 of file EAuthServiceBase.php.
References setCancelUrl(), setComponent(), and setRedirectUrl().
|
protected |
Initializes a new session and return a cURL handle.
string | $url | url to request. |
array | $options | HTTP request options. Keys: query, data, referer. |
boolean | $parseJson | Whether to parse response in json format. |
Reimplemented in EOAuthService.
Definition at line 297 of file EAuthServiceBase.php.
Referenced by makeRequest().
|
protected |
Makes the curl request to the url.
string | $url | url to request. |
array | $options | HTTP request options. Keys: query, data, referer. |
boolean | $parseJson | Whether to parse response in json format. |
Reimplemented in GoogleOAuthService.
Definition at line 237 of file EAuthServiceBase.php.
References initRequest(), and parseJson().
Referenced by OdnoklassnikiOAuthService\fetchAttributes(), MoikrugOAuthService\getAccessToken(), OdnoklassnikiOAuthService\getAccessToken(), FacebookOAuthService\getAccessToken(), MailruOAuthService\getAccessToken(), EOAuth2Service\getAccessToken(), CustomOdnoklassnikiService\getRealIdAndUrl(), MoikrugOAuthService\makeSignedRequest(), MailruOAuthService\makeSignedRequest(), EOAuthService\makeSignedRequest(), and EOAuth2Service\makeSignedRequest().
|
protected |
Parse response from makeRequest in json format and check OAuth errors.
string | $response | Json string. |
Definition at line 313 of file EAuthServiceBase.php.
References fetchJsonError().
Referenced by makeRequest().
EAuthServiceBase::redirect | ( | $url = null | ) |
Redirect to the url. If url is null, redirectUrl will be used.
string | $url | url to redirect. |
Implements IAuthService.
Reimplemented in EmailService.
Definition at line 219 of file EAuthServiceBase.php.
EAuthServiceBase::setCancelUrl | ( | $url | ) |
Sets redirect url after unsuccessful authorization (e.g. user canceled).
string | url to redirect. |
Implements IAuthService.
Definition at line 187 of file EAuthServiceBase.php.
Referenced by init().
EAuthServiceBase::setComponent | ( | $component | ) |
Sets EAuth application component
EAuth | $component | the application auth component. |
Implements IAuthService.
Definition at line 155 of file EAuthServiceBase.php.
Referenced by init().
EAuthServiceBase::setRedirectUrl | ( | $url | ) |
Sets redirect url after successful authorization.
string | url to redirect. |
Implements IAuthService.
Definition at line 171 of file EAuthServiceBase.php.
Referenced by init().
|
protected |
Stores a variable in eauth session.
string | $key | variable name. |
mixed | $value | variable value. |
mixed | $defaultValue | default value. If $value===$defaultValue, the variable will be removed from the session. |
Definition at line 362 of file EAuthServiceBase.php.
References getStateKeyPrefix().
Referenced by FacebookOAuthService\getCodeUrl(), MailruOAuthService\getCodeUrl(), GoogleOAuthService\getCodeUrl(), OdnoklassnikiOAuthService\getCodeUrl(), MoikrugOAuthService\saveAccessToken(), FacebookOAuthService\saveAccessToken(), MailruOAuthService\saveAccessToken(), GoogleOAuthService\saveAccessToken(), VKontakteOAuthService\saveAccessToken(), and EOAuth2Service\saveAccessToken().