Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
mailru.php
1
<?php
2
3
namespace
Bitrix\Mail\Helper\OAuth
;
4
5
use
Bitrix\Main
;
6
use
Bitrix\Mail
;
7
8
class
Mailru
extends
Mail\Helper\OAuth
9
{
10
11
protected
function
__construct
()
12
{
13
$this->oauthEntity =
new
MailruInterface(
14
\CSocServMailRu2::getOption(
'mailru2_client_id'
),
15
\CSocServMailRu2::getOption(
'mailru2_client_secret'
)
16
);
17
18
$this->oauthEntity->addScope(array(
19
'userinfo'
,
20
'mail.imap'
,
21
));
22
}
23
24
protected
function
check
()
25
{
26
$provider = new \CSocServMailRu2;
27
28
return
$provider->checkSettings();
29
}
30
31
protected
function
mapUserData
(array $userData)
32
{
33
return
array(
34
'email'
=> $userData[
'email'
],
35
'first_name'
=> $userData[
'first_name'
],
36
'last_name'
=> $userData[
'last_name'
],
37
'full_name'
=> $userData[
'name'
],
38
'image'
=> $userData[
'image'
],
39
'error'
=> $userData[
'error_description'
],
40
);
41
}
42
43
public
static
function
getServiceName
()
44
{
45
return
'mailru'
;
46
}
47
48
public
function
getControllerUrl
()
49
{
50
return \CSocServMailRu2::CONTROLLER_URL;
51
}
52
53
}
54
55
if
(Main\Loader::includeModule(
'socialservices'
))
56
{
57
class_exists(
'CSocServMailRu2'
);
58
59
class
MailruInterface
extends
\CMailRu2Interface
60
{
61
62
public
function
getStorageTokens
()
63
{
64
return
false
;
65
}
66
67
public
function
getTokenData
()
68
{
69
return
array
(
70
'access_token'
=> $this->
access_token
,
71
'refresh_token'
=> $this->
refresh_token
,
72
'expires_in'
=> $this->
accessTokenExpires
,
73
);
74
}
75
76
public
function
getCurrentUser()
77
{
78
$result = parent::getCurrentUser();
79
80
if
(
is_array
($result))
81
{
82
$result =
array_merge
(
83
$result,
84
$this->
getTokenData
()
85
);
86
}
87
88
return
$result;
89
}
90
91
}
92
}
Bitrix\Mail\Helper\OAuth\Mailru
Definition
mailru.php:9
Bitrix\Mail\Helper\OAuth\Mailru\getServiceName
static getServiceName()
Definition
mailru.php:43
Bitrix\Mail\Helper\OAuth\Mailru\__construct
__construct()
Definition
mailru.php:11
Bitrix\Mail\Helper\OAuth\Mailru\mapUserData
mapUserData(array $userData)
Definition
mailru.php:31
Bitrix\Mail\Helper\OAuth\Mailru\check
check()
Definition
mailru.php:24
Bitrix\Mail\Helper\OAuth\Mailru\getControllerUrl
getControllerUrl()
Definition
mailru.php:48
Bitrix\Mail\Helper\OAuth
Definition
oauth.php:12
Bitrix\Main\DB\Connection\$host
$host
Definition
connection.php:29
Bitrix\Mail\Helper\OAuth
Definition
google.php:3
Bitrix\Mail
Definition
blacklist.php:3
Bitrix\Main
modules
mail
lib
helper
oauth
mailru.php
Создано системой
1.10.0