Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TwitterOAuthService Class Reference
Inheritance diagram for TwitterOAuthService:
EOAuthService EAuthServiceBase IAuthService IAuthService CustomTwitterService

Public Member Functions

 authenticate ()
- Public Member Functions inherited from EOAuthService
 init ($component, $options=array())
 makeSignedRequest ($url, $options=array(), $parseJson=true)
- Public Member Functions inherited from EAuthServiceBase
 __get ($name)
 __isset ($name)
 getServiceName ()
 getServiceTitle ()
 getServiceType ()
 getJsArguments ()
 setComponent ($component)
 getComponent ()
 setRedirectUrl ($url)
 getRedirectUrl ()
 setCancelUrl ($url)
 getCancelUrl ()
 getIsAuthenticated ()
 redirect ($url=null)
 cancel ($url=null)
 getId ()
 getAttributes ()
 getAttribute ($key, $default=null)
 hasAttribute ($key)
 getItem ()
 getItemAttributes ()
- Public Member Functions inherited from IAuthService
 cancel ()

Protected Member Functions

 fetchAttributes ()
- Protected Member Functions inherited from EOAuthService
 getConsumer ()
 getAccessToken ()
 initRequest ($url, $options=array())
- Protected Member Functions inherited from EAuthServiceBase
 makeRequest ($url, $options=array(), $parseJson=true)
 parseJson ($response)
 fetchJsonError ($json)
 getStateKeyPrefix ()
 setState ($key, $value, $defaultValue=null)
 hasState ($key)
 getState ($key, $defaultValue=null)
 _fetchAttributes ()

Protected Attributes

 $name = 'twitter'
 $title = 'Twitter'
 $type = 'OAuth'
 $jsArguments = array('popup' => array('width' => 900, 'height' => 550))
 $key = ''
 $secret = ''
 $providerOptions
- Protected Attributes inherited from EOAuthService
 $key
 $secret
 $scope = ''
 $providerOptions
- Protected Attributes inherited from EAuthServiceBase
 $name
 $title
 $type
 $jsArguments = array()
 $attributes = array()
 $authenticated = false

Detailed Description

Definition at line 18 of file TwitterOAuthService.php.

Member Function Documentation

TwitterOAuthService::authenticate ( )

Authenticate the user.

Returns
boolean whether user was successfuly authenticated.

Reimplemented from EOAuthService.

Definition at line 50 of file TwitterOAuthService.php.

References IAuthService\cancel().

{
if (isset($_GET['denied']))
$this->cancel();
}
TwitterOAuthService::fetchAttributes ( )
protected

Fetch attributes array.

Returns
boolean whether the attributes was successfully fetched.

Reimplemented from EAuthServiceBase.

Reimplemented in CustomTwitterService.

Definition at line 33 of file TwitterOAuthService.php.

References EOAuthService\makeSignedRequest().

{
$info = $this->makeSignedRequest('https://api.twitter.com/1/account/verify_credentials.json');
$this->attributes['id'] = $info->id;
$this->attributes['name'] = $info->name;
$this->attributes['url'] = 'http://twitter.com/account/redirect_by_id?id='.$info->id_str;
/*$this->attributes['username'] = $info->screen_name;
$this->attributes['language'] = $info->lang;
$this->attributes['timezone'] = timezone_name_from_abbr('', $info->utc_offset, date('I'));
$this->attributes['photo'] = $info->profile_image_url;*/
}

Member Data Documentation

TwitterOAuthService::$providerOptions
protected
Initial value:
array(
'request' => 'https://api.twitter.com/oauth/request_token',
'authorize' => 'https://api.twitter.com/oauth/authorize',
'access' => 'https://api.twitter.com/oauth/access_token',
)

Definition at line 27 of file TwitterOAuthService.php.


The documentation for this class was generated from the following file: