Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
verification.php
1<?php
2
4
6
13{
14 public static function isEmailConfirmed(): bool
15 {
16 if (! \Bitrix\Main\Loader::includeModule('bitrix24'))
17 {
18 return true;
19 }
20
21 return \CBitrix24::isEmailConfirmed();
22 }
23
24 public static function isPhoneConfirmed(): bool
25 {
26 // no need to verify boxes
27 if (! \Bitrix\Main\Loader::includeModule('bitrix24'))
28 {
29 return true;
30 }
31
32 if (\CBitrix24::isPhoneConfirmed())
33 {
34 return true;
35 }
36
37 // phone required only for new portals
38 if (self::isMailingsUsed() && self::isForceCheckDisabled())
39 {
40 // remember verified state
41 \CBitrix24::setPhoneConfirmed(true);
42 return true;
43 }
44
45 return false;
46 }
47
51 private static function isMailingsUsed(): bool
52 {
53 $letters = \Bitrix\Sender\Internals\Model\LetterTable::getList([
54 'select' => ['ID'],
55 'filter' => [
56 '=STATUS' => \Bitrix\Sender\Dispatch\Semantics::getFinishStates(),
57 '=MESSAGE_CODE' => \Bitrix\Sender\Message\iBase::CODE_MAIL
58 ],
59 'limit' => 1,
60 ]);
61
62 return (bool)$letters->fetch();
63 }
64
69 private static function isForceCheckDisabled()
70 {
71 return Option::get('sender', 'force_phone_check', 'N') !== 'Y';
72 }
73}