protected function regenerateRecoveryCodes() { CUserOptions::SetOption('security', 'recovery_codes_generated', time()); RecoveryCodesTable::regenerateCodes($this->arParams['USER_ID']); return $this->getRecoveryCodes(false, false); }
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); }