Browse Source

Default normalize user attribute map added to OpentId clients.

tags/2.0.0-beta
Paul Klimov 11 years ago
parent
commit
a286f30951
  1. 2
      extensions/yii/authclient/ClientTrait.php
  2. 13
      extensions/yii/authclient/clients/GoogleOpenId.php
  3. 11
      extensions/yii/authclient/clients/YandexOpenId.php

2
extensions/yii/authclient/ClientTrait.php

@ -203,7 +203,7 @@ trait ClientTrait
* Particular client may override this method in order to provide specific default map.
* @return array normalize attribute map.
*/
public function defaultNormalizeUserAttributeMap()
protected function defaultNormalizeUserAttributeMap()
{
return [];
}

13
extensions/yii/authclient/clients/GoogleOpenId.php

@ -35,6 +35,19 @@ class GoogleOpenId extends OpenId
/**
* @inheritdoc
*/
protected function defaultNormalizeUserAttributeMap()
{
return [
'first_name' => 'namePerson/first',
'last_name' => 'namePerson/last',
'email' => 'contact/email',
'language' => 'pref/language',
];
}
/**
* @inheritdoc
*/
protected function defaultViewOptions()
{
return [

11
extensions/yii/authclient/clients/YandexOpenId.php

@ -33,6 +33,17 @@ class YandexOpenId extends OpenId
/**
* @inheritdoc
*/
protected function defaultNormalizeUserAttributeMap()
{
return [
'name' => 'namePerson',
'email' => 'contact/email',
];
}
/**
* @inheritdoc
*/
protected function defaultViewOptions()
{
return [

Loading…
Cancel
Save