示例#1
0
 protected function regenerateRecoveryCodes()
 {
     CUserOptions::SetOption('security', 'recovery_codes_generated', time());
     RecoveryCodesTable::regenerateCodes($this->arParams['USER_ID']);
     return $this->getRecoveryCodes(false, false);
 }
示例#2
0
function regenerateRecoveryCodes($userId)
{
    if (!Otp::getByUser($userId)->isActivated()) {
        ShowError('OTP inactive');
    }
    CUserOptions::SetOption('security', 'recovery_codes_generated', time());
    RecoveryCodesTable::regenerateCodes($userId);
    return getRecoveryCodes($userId, false);
}