Vinoteca: wine shop on 1C-Bitrix (module, template, components, pages)
This commit is contained in:
commit
52795535ae
586 files changed
+27619
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Bitrix\Main\Application;
|
||||
use Bitrix\Main\Engine\CurrentUser;
|
||||
use Bitrix\Main\Localization\Loc;
|
||||
use Jinove\Vinoteca\Redirect;
|
||||
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
||||
die();
|
||||
}
|
||||
|
||||
Loc::loadMessages(__FILE__);
|
||||
|
||||
class JinoveAuthRegisterComponent extends CBitrixComponent
|
||||
{
|
||||
public function executeComponent(): array
|
||||
{
|
||||
$request = Application::getInstance()->getContext()->getRequest();
|
||||
$safeBack = Redirect::safe((string)$request->getQuery("back"));
|
||||
if ((int)CurrentUser::get()->getId() > 0) {
|
||||
LocalRedirect($safeBack !== "" ? $safeBack : SITE_DIR);
|
||||
}
|
||||
$GLOBALS["APPLICATION"]->SetTitle(Loc::getMessage("VINO_REG_PAGE_TITLE"));
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("description", Loc::getMessage("VINO_REG_PAGE_DESCRIPTION"));
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("vino_alternates", "N");
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("vino_schema", "N");
|
||||
$GLOBALS["APPLICATION"]->SetPageProperty("robots", "noindex, nofollow");
|
||||
$this->arResult = [
|
||||
"BACK" => $safeBack,
|
||||
"LOGIN_URL" => SITE_DIR . "login/" . ($safeBack !== "" ? "?back=" . rawurlencode($safeBack) : ""),
|
||||
];
|
||||
$this->includeComponentTemplate();
|
||||
|
||||
return $this->arResult;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user