24 public function sendEmailAction($login)
32 $result = \CUser::SendPassword($login,
"",
false,
"", 0,
"",
true);
35 $checkResult = $result[
"RESULT"];
38 $intervals = $checkResult->getData();
45 if($result[
"TYPE"] ==
"ERROR")
47 $errorCode = ($checkResult?
"ERR_TIMEOUT" :
"ERR_NOT_FOUND");
48 $this->
addError(
new Main\
Error($result[
"MESSAGE"], $errorCode, $intervals));
53 'signedData' => Component\ParameterSigner::signParameters(
55 [
'userId' => $result[
"USER_ID"]]
57 'intervals' => $intervals,
73 $params = Component\ParameterSigner::unsignParameters(self::SIGNATURE_SALT, $signedData);
81 if(!preg_match(
'/^[0-9]{6}$/', $code))
88 $context->setUserId($params[
"userId"]);
92 $result = $shortCode->verify($code);
94 if($result->isSuccess())
96 $codeUser = $shortCode->getUser();
97 if(!$USER->IsAuthorized() && $codeUser->getActive() && !$codeUser->getBlocked())
110 $USER->Authorize($params[
"userId"]);
117 if($result->getErrorCollection()->getErrorByCode(
"ERR_CONFIRM_CODE") !==
null)
121 if($result->getErrorCollection()->getErrorByCode(
"ERR_RETRY_COUNT") !==
null)
140 $authResult = $USER->LoginByOtp($otp,
"N", $captchaWord, $captchaSid);
142 if($authResult !==
true)
144 $this->
addError(
new Main\
Error($authResult[
"MESSAGE"],
"ERR_OTP_CODE"));
165 'ERR_OTP_CAPTCHA_REQUIRED',
167 "captchaSid" => $APPLICATION->CaptchaGetCode(),
179 Main\Engine\ActionFilter\Authentication::class,
184 Main\Engine\ActionFilter\Authentication::class,
189 Main\Engine\ActionFilter\Authentication::class,
confirmAction($code, $signedData)
loginByOtpAction($otp, $captchaSid="", $captchaWord="")
static includeModule($moduleName)
static getMessage($code, $replace=null, $language=null)