Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
otpevents.php
1<?php
2namespace Bitrix\Security\Mfa;
3
5
7{
13 public static function onRecheckDeactivate()
14 {
15 $users = UserTable::query()
16 ->addFilter('<DEACTIVATE_UNTIL', new Type\DateTime)
17 ->addFilter('=ACTIVE', 'N')
18 ->addSelect('USER_ID')
19 ->addSelect('SKIP_MANDATORY')
20 ->addSelect('SECRET')
21 ->setLimit(100)
22 ->exec()
23 ->fetchAll();
24
25 foreach($users as $user)
26 {
27 if ($user['SKIP_MANDATORY'] === 'Y' && !$user['SECRET'])
28 UserTable::update($user['USER_ID'], array('SKIP_MANDATORY' => 'N', 'DEACTIVATE_UNTIL' => null));
29 else
30 UserTable::update($user['USER_ID'], array('ACTIVE' => 'Y', 'SKIP_MANDATORY' => 'N', 'DEACTIVATE_UNTIL' => null));
31 }
32
33 return sprintf('%s();', __METHOD__);
34 }
35}
static update($primary, array $data)