Files
conmed-authserver/auth/index.php
2026-03-06 21:48:17 +03:00

152 lines
4.7 KiB
PHP
Executable File

<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
// Если пользователь уже вошел
if ($USER->IsAuthorized() && !empty($_REQUEST["backurl"])) {
LocalRedirect($_REQUEST["backurl"]);
}
?>
<!-- Стили специально для страницы авторизации, чтобы перебить стили сайта -->
<style>
/* Красим фон страницы в серый (как на референсе) */
body, .main-wrapper, .page-content {
background-color: #f0f2f5 !important;
}
/* Обертка для центрирования */
.conmed-auth-wrapper {
min-height: calc(100vh - 200px); /* Высота экрана минус хедер/футер */
display: flex;
align-items: center;
justify-content: center;
padding: 40px 15px;
background-color: #f0f2f5;
}
/* Сама карточка */
.conmed-auth-card {
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 15px rgba(0,0,0,0.08);
padding: 40px;
width: 100%;
max-width: 400px; /* Ширина как на референсе */
text-align: center;
}
/* Логотип */
.conmed-auth-logo {
max-width: 180px;
margin-bottom: 25px;
display: inline-block;
}
/* Заголовки */
.conmed-auth-title {
font-size: 20px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 30px;
}
/* Инпуты */
.conmed-form-control {
height: 48px;
border-radius: 6px;
border: 1px solid #dfe1e5;
font-size: 15px;
padding-left: 15px;
margin-bottom: 20px;
width: 100%;
display: block;
box-sizing: border-box;
transition: border-color 0.2s;
}
.conmed-form-control:focus {
border-color: #1a73e8; /* Синий цвет при клике */
outline: none;
}
/* Кнопка */
.conmed-btn {
width: 100%;
height: 48px;
background-color: #1a73e8;
color: #fff;
border: none;
border-radius: 6px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: background-color 0.2s;
}
.conmed-btn:hover {
background-color: #1557b0;
}
/* Ссылки */
.conmed-link {
color: #1a73e8;
text-decoration: none;
font-size: 14px;
margin-top: 15px;
display: inline-block;
}
.conmed-link:hover {
text-decoration: underline;
}
.error-msg {
color: #d93025;
font-size: 13px;
margin-bottom: 15px;
text-align: left;
background: #fce8e6;
padding: 10px;
border-radius: 4px;
}
</style>
<div class="conmed-auth-wrapper">
<?
// ---------------------------------------------------------
// 1. ВОССТАНОВЛЕНИЕ ПАРОЛЯ
// ---------------------------------------------------------
if ($_REQUEST["forgot_password"] == "yes") {
$APPLICATION->SetTitle("Восстановление пароля");
$APPLICATION->IncludeComponent("bitrix:system.auth.forgotpasswd", "bootstrap", Array());
}
// ---------------------------------------------------------
// 2. РЕГИСТРАЦИЯ
// ---------------------------------------------------------
elseif ($_REQUEST["register"] == "yes" || $_REQUEST["register_submit_button"] == "Зарегистрироваться") {
$APPLICATION->SetTitle("Регистрация");
$APPLICATION->IncludeComponent("bitrix:main.register", "bootstrap", Array(
"SHOW_FIELDS" => array("EMAIL", "NAME", "LAST_NAME", "PASSWORD", "CONFIRM_PASSWORD"),
"REQUIRED_FIELDS" => array("EMAIL", "NAME", "PASSWORD", "CONFIRM_PASSWORD"),
"AUTH" => "Y",
"USE_BACKURL" => "Y",
"SUCCESS_PAGE" => "/personal/",
"SET_TITLE" => "Y",
"USER_PROPERTY" => array(),
));
}
// ---------------------------------------------------------
// 3. АВТОРИЗАЦИЯ (ВХОД)
// ---------------------------------------------------------
else {
$APPLICATION->SetTitle("Вход");
$APPLICATION->IncludeComponent("bitrix:system.auth.authorize", "bootstrap", Array(
"AUTH_RESULT" => $APPLICATION->arAuthResult,
"REGISTER_URL" => "/register/", // Явно указываем ссылку
"FORGOT_PASSWORD_URL" => "?forgot_password=yes", // Явно указываем ссылку
"PROFILE_URL" => "/personal/",
));
}
?>
</div>
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>