Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
yandex.php
1<?php
2
4
7
9{
10
11 protected function __construct()
12 {
13 $this->oauthEntity = new YandexInterface;
14 }
15
16 protected function check()
17 {
18 $provider = new \CSocServYandexAuth;
19
20 return $provider->checkSettings();
21 }
22
23 protected function mapUserData(array $userData)
24 {
25 return array(
26 'email' => $userData['default_email'],
27 'first_name' => $userData['first_name'],
28 'last_name' => $userData['last_name'],
29 'full_name' => $userData['real_name'],
30 'image' => sprintf('https://avatars.yandex.net/get-yapic/%s/islands-middle', $userData['default_avatar_id']),
31 //'error' => $data['error']['message'],
32 );
33 }
34
35 public static function getServiceName()
36 {
37 return 'yandex';
38 }
39
40 public function getControllerUrl()
41 {
42 return \CSocServYandexAuth::CONTROLLER_URL;
43 }
44
45}
46
47if (Main\Loader::includeModule('socialservices'))
48{
49 class YandexInterface extends \CYandexOAuthInterface
50 {
51
52 public function getStorageTokens()
53 {
54 return false;
55 }
56
57 public function getTokenData()
58 {
59 return array(
60 'access_token' => $this->access_token,
61 'refresh_token' => $this->refresh_token,
62 'expires_in' => $this->accessTokenExpires,
63 );
64 }
65
66 public function getNewAccessToken($refreshToken = false, $userId = 0, $save = false)
67 {
68 return false;
69 }
70
71 }
72}
mapUserData(array $userData)
Definition yandex.php:23