43 lines
1.6 KiB
PHP
43 lines
1.6 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Bitrix\Main\Application;
|
|
use Bitrix\Main\Engine\CurrentUser;
|
|
use Bitrix\Main\Localization\Loc;
|
|
|
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
|
die();
|
|
}
|
|
|
|
Loc::loadMessages(__FILE__);
|
|
|
|
class JinoveAuthResetComponent extends CBitrixComponent
|
|
{
|
|
public function executeComponent(): array
|
|
{
|
|
if ((int)CurrentUser::get()->getId() > 0) {
|
|
LocalRedirect(SITE_DIR);
|
|
}
|
|
$request = Application::getInstance()->getContext()->getRequest();
|
|
$rawLogin = $request->getQuery("login");
|
|
$rawCheckword = $request->getQuery("checkword");
|
|
$login = is_string($rawLogin) ? $rawLogin : "";
|
|
$checkword = is_string($rawCheckword) ? $rawCheckword : "";
|
|
$GLOBALS["APPLICATION"]->SetTitle(Loc::getMessage("VINO_RESET_PAGE_TITLE"));
|
|
$GLOBALS["APPLICATION"]->SetPageProperty("description", Loc::getMessage("VINO_RESET_PAGE_DESCRIPTION"));
|
|
$GLOBALS["APPLICATION"]->SetPageProperty("vino_alternates", "N");
|
|
$GLOBALS["APPLICATION"]->SetPageProperty("vino_schema", "N");
|
|
$GLOBALS["APPLICATION"]->SetPageProperty("robots", "noindex, nofollow");
|
|
$GLOBALS["APPLICATION"]->AddHeadString('<meta name="referrer" content="no-referrer">');
|
|
$this->arResult = [
|
|
"LOGIN" => mb_strlen($login) <= 254 ? $login : "",
|
|
"CHECKWORD" => preg_match('/^[A-Za-z0-9]{32}$/', $checkword) ? $checkword : "",
|
|
"LOGIN_URL" => SITE_DIR . "login/",
|
|
"FORGOT_URL" => SITE_DIR . "forgot-password/",
|
|
];
|
|
$this->includeComponentTemplate();
|
|
|
|
return $this->arResult;
|
|
}
|
|
}
|