Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
userauth.php
1<?
2
4
7use Bitrix\Sender\Trigger\Base as TriggerBase;
8
9Loc::loadMessages(__FILE__);
10
11class UserAuth extends TriggerBase
12{
13 public function getName()
14 {
15 return Loc::getMessage('sender_trigger_user_auth_name');
16 }
17
18 public function getCode()
19 {
20 return "user_auth";
21 }
22
23 public function getEventModuleId()
24 {
25 return 'main';
26 }
27
28 public function getEventType()
29 {
30 return "OnAfterUserAuthorize";
31 }
32
33 public function filter()
34 {
35 if($this->getSiteId() == Context::getCurrent()->getSite())
36 {
37 return true;
38 }
39 else
40 {
41 return false;
42 }
43 }
44
45 public function getRecipient()
46 {
47 $eventData = $this->getParam('EVENT');
48
49 if(empty($eventData[0]['user_fields']))
50 return null;
51
52 return array(
53 'EMAIL' => $eventData[0]['user_fields']['EMAIL'],
54 'USER_ID' => $eventData[0]['user_fields']['ID'],
55 'NAME' => $eventData[0]['user_fields']['NAME'],
56 );
57 }
58}
static getCurrent()
Definition context.php:241
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
getParam($name, $defaultValue=null)
Definition base.php:188