Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
CustomYandexService.php
1 <?php
2 /**
3  * An example of extending the provider class.
4  *
5  * @author Maxim Zemskov <nodge@yandex.ru>
6  * @link http://code.google.com/p/yii-eauth/
7  * @license http://www.opensource.org/licenses/bsd-license.php
8  */
9 
10 require_once dirname(dirname(__FILE__)) . '/services/YandexOpenIDService.php';
11 
13 
14  protected $jsArguments = array('popup' => array('width' => 900, 'height' => 620));
15 
16  protected $requiredAttributes = array(
17  'name' => array('fullname', 'namePerson'),
18  'username' => array('nickname', 'namePerson/friendly'),
19  'email' => array('email', 'contact/email'),
20  'gender' => array('gender', 'person/gender'),
21  'birthDate' => array('dob', 'birthDate'),
22  );
23 
24  protected function fetchAttributes() {
25  if (isset($this->attributes['username']) && !empty($this->attributes['username']))
26  $this->attributes['url'] = 'http://openid.yandex.ru/'.$this->attributes['username'];
27 
28  if (isset($this->attributes['birthDate']) && !empty($this->attributes['birthDate']))
29  $this->attributes['birthDate'] = strtotime($this->attributes['birthDate']);
30  }
31 }