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

Protected Member Functions

 fetchAttributes ()
 getRealIdAndUrl ()
- Protected Member Functions inherited from OdnoklassnikiOAuthService
 getTokenUrl ($code)
 getAccessToken ($code)
 getCodeUrl ($redirect_uri)
 fetchJsonError ($json)
- Protected Member Functions inherited from EOAuth2Service
 saveAccessToken ($token)
 restoreAccessToken ()
- Protected Member Functions inherited from EAuthServiceBase
 makeRequest ($url, $options=array(), $parseJson=true)
 initRequest ($url, $options=array())
 parseJson ($response)
 getStateKeyPrefix ()
 setState ($key, $value, $defaultValue=null)
 hasState ($key)
 getState ($key, $defaultValue=null)
 _fetchAttributes ()

Protected Attributes

 $scope = 'VALUABLE ACCESS'
- Protected Attributes inherited from OdnoklassnikiOAuthService
 $name = 'odnoklassniki'
 $title = 'Odnoklassniki'
 $type = 'OAuth'
 $jsArguments = array('popup' => array('width' => 680, 'height' => 500))
 $client_id = ''
 $client_secret = ''
 $client_public = ''
 $scope = ''
 $providerOptions
- Protected Attributes inherited from EOAuth2Service
 $client_id
 $client_secret
 $scope = ''
 $providerOptions
 $access_token = ''
- Protected Attributes inherited from EAuthServiceBase
 $name
 $title
 $type
 $jsArguments = array()
 $attributes = array()
 $authenticated = false

Additional Inherited Members

- Public Member Functions inherited from EOAuth2Service
 authenticate ()
 makeSignedRequest ($url, $options=array(), $parseJson=true)

Detailed Description

CustomOdnoklassnikiService class file.

Author
Sergey Vardanyan rakot.nosp@m..ss@.nosp@m.gmail.nosp@m..com http://www.opensource.org/licenses/bsd-license.php

Definition at line 11 of file CustomOdnoklassnikiService.php.

Member Function Documentation

CustomOdnoklassnikiService::fetchAttributes ( )
protected

Fetch attributes array.

Returns
boolean whether the attributes was successfully fetched.

Reimplemented from OdnoklassnikiOAuthService.

Definition at line 15 of file CustomOdnoklassnikiService.php.

References getRealIdAndUrl().

{
if ($this->scope == 'VALUABLE ACCESS')
$this->getRealIdAndUrl();
}
CustomOdnoklassnikiService::getRealIdAndUrl ( )
protected

Avable only if VALUABLE ACCESS is on you should ask for enable this scope for odnoklassniki administration

Definition at line 25 of file CustomOdnoklassnikiService.php.

References EAuthServiceBase\makeRequest().

Referenced by fetchAttributes().

{
$sig = strtolower(md5('application_key='.$this->client_public.'client_id='.$this->client_id.'fields=url_profileformat=JSONmethod=users.getInfouids='.$this->attributes['id'].md5($this->access_token.$this->client_secret)));
$info = $this->makeRequest('http://api.odnoklassniki.ru/fb.do', array(
'query' => array(
'method' => 'users.getInfo',
'sig' => $sig,
'uids' => $this->attributes['id'],
'fields' => 'url_profile',
'format' => 'JSON',
'application_key' => $this->client_public,
'client_id' => $this->client_id,
'access_token' => $this->access_token,
),
));
preg_match('/\d+\/{0,1}$/',$info[0]->url_profile, $matches);
$this->attributes['id'] = (int)$matches[0];
$this->attributes['url'] = $info[0]->url_profile;
}

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