nearly prod
This commit is contained in:
@@ -21,8 +21,7 @@ if (!is_array($data)) {
|
|||||||
|
|
||||||
$login = trim($data['username'] ?? '');
|
$login = trim($data['username'] ?? '');
|
||||||
$password = $data['password'] ?? '';
|
$password = $data['password'] ?? '';
|
||||||
$siteAlias = strtolower(trim($data['site_alias'] ?? ''));
|
$siteAlias = trim($data['site_alias'] ?? '');
|
||||||
|
|
||||||
if ($siteAlias === '') {
|
if ($siteAlias === '') {
|
||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
echo json_encode(['success' => false, 'message' => 'Не указан сайт']);
|
echo json_encode(['success' => false, 'message' => 'Не указан сайт']);
|
||||||
@@ -30,6 +29,7 @@ if ($siteAlias === '') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Поиск пользователя по username
|
// Поиск пользователя по username
|
||||||
|
// $stmt = $pdo->prepare("SELECT * FROM users WHERE username = ?");
|
||||||
$stmt = $pdo->prepare("SELECT id, username, password_hash, ok5, o7, o10m, o10a, webp FROM users WHERE username = ?");
|
$stmt = $pdo->prepare("SELECT id, username, password_hash, ok5, o7, o10m, o10a, webp FROM users WHERE username = ?");
|
||||||
$stmt->execute([$login]);
|
$stmt->execute([$login]);
|
||||||
$user = $stmt->fetch(PDO::FETCH_ASSOC);
|
$user = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
@@ -45,7 +45,6 @@ if ($user && password_verify($password, $user['password_hash'])) {
|
|||||||
echo json_encode(['success' => false, 'message' => 'Нет доступа к сайту']);
|
echo json_encode(['success' => false, 'message' => 'Нет доступа к сайту']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Успешная авторизация
|
// Успешная авторизация
|
||||||
session_regenerate_id(true);
|
session_regenerate_id(true);
|
||||||
$_SESSION['user_id'] = $user['id'];
|
$_SESSION['user_id'] = $user['id'];
|
||||||
@@ -62,4 +61,4 @@ if ($user && password_verify($password, $user['password_hash'])) {
|
|||||||
} else {
|
} else {
|
||||||
echo json_encode(['success' => false, 'message' => 'Неверные учетные данные']);
|
echo json_encode(['success' => false, 'message' => 'Неверные учетные данные']);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,22 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
if (session_status() === PHP_SESSION_NONE) {
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
$isSecure = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
|
$isSecure = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
|
||||||
$scriptName = $_SERVER['SCRIPT_NAME'] ?? '';
|
|
||||||
$basePath = '/';
|
|
||||||
if ($scriptName !== '') {
|
|
||||||
$basePath = preg_replace('#/api/.*$#', '', $scriptName);
|
|
||||||
if ($basePath === $scriptName) {
|
|
||||||
$basePath = dirname($scriptName);
|
|
||||||
}
|
|
||||||
$basePath = rtrim($basePath, '/');
|
|
||||||
if ($basePath === '') {
|
|
||||||
$basePath = '/';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ini_set('session.use_strict_mode', '1');
|
ini_set('session.use_strict_mode', '1');
|
||||||
session_set_cookie_params([
|
session_set_cookie_params([
|
||||||
'lifetime' => 0,
|
'lifetime' => 0,
|
||||||
'path' => $basePath,
|
'path' => '/',
|
||||||
'domain' => '',
|
'domain' => '',
|
||||||
'secure' => $isSecure,
|
'secure' => $isSecure,
|
||||||
'httponly' => true,
|
'httponly' => true,
|
||||||
|
|||||||
84
css/auth.css
84
css/auth.css
@@ -12,3 +12,87 @@
|
|||||||
.btn-primary:hover {
|
.btn-primary:hover {
|
||||||
background: #2563eb;
|
background: #2563eb;
|
||||||
}
|
}
|
||||||
|
:root {
|
||||||
|
color-scheme: light;
|
||||||
|
--bg: #f5f7fb;
|
||||||
|
--card: #ffffff;
|
||||||
|
--text: #1b1f2a;
|
||||||
|
--muted: #6b7280;
|
||||||
|
--border: #e5e7eb;
|
||||||
|
--accent: #3b82f6;
|
||||||
|
--accent-dark: #2563eb;
|
||||||
|
}
|
||||||
|
* { box-sizing: border-box; }
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: "Segoe UI", Arial, sans-serif;
|
||||||
|
background: linear-gradient(135deg, #eef2ff, #f8fafc);
|
||||||
|
color: var(--text);
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 520px;
|
||||||
|
background: var(--card);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 42px;
|
||||||
|
padding: 24px;
|
||||||
|
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
margin: 0 0 16px;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
.subtitle {
|
||||||
|
margin: 0 0 20px;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.field {
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--muted);
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px 12px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
transition: border-color 0.2s, box-shadow 0.2s;
|
||||||
|
}
|
||||||
|
input:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: var(--accent);
|
||||||
|
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px 12px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--accent);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 15px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.2s;
|
||||||
|
}
|
||||||
|
button:hover { background: var(--accent-dark); }
|
||||||
|
.helper {
|
||||||
|
margin-top: 14px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--muted);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
99
index.html
99
index.html
@@ -1,60 +1,24 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="ru">
|
||||||
<head>
|
<head>
|
||||||
|
<title>БЛА БлД СТ «Орлан-7»</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
|
||||||
<title>Личный кабинет</title>
|
<meta name="site-alias" content="o7">
|
||||||
|
<link type="text/css" rel="stylesheet" href="/css/fonts.css">
|
||||||
|
<link type="text/css" rel="stylesheet" href="/css/style.css">
|
||||||
<link rel="stylesheet" href="css/auth.css">
|
<link rel="stylesheet" href="css/auth.css">
|
||||||
<style>
|
<script type="module" src="/js/window.js"></script>
|
||||||
:root {
|
|
||||||
color-scheme: light;
|
|
||||||
--bg: #f5f7fb;
|
|
||||||
--card: #ffffff;
|
|
||||||
--text: #1b1f2a;
|
|
||||||
--muted: #6b7280;
|
|
||||||
--border: #e5e7eb;
|
|
||||||
--accent: #3b82f6;
|
|
||||||
--accent-dark: #2563eb;
|
|
||||||
}
|
|
||||||
* { box-sizing: border-box; }
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: "Segoe UI", Arial, sans-serif;
|
|
||||||
background: linear-gradient(135deg, #eef2ff, #f8fafc);
|
|
||||||
color: var(--text);
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 24px;
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 520px;
|
|
||||||
background: var(--card);
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 24px;
|
|
||||||
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
margin: 0 0 16px;
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
.actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
|
||||||
|
<body style="display: none">
|
||||||
|
<!-- Авторизация ёпта -->
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div id="user-info"></div>
|
<div id="user-info"></div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button class="btn-primary" onclick="logout()">Выйти</button>
|
<button class="btn-primary" onclick="logout()">Выйти</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Проверка авторизации при загрузке страницы
|
// Проверка авторизации при загрузке страницы
|
||||||
async function checkAuth() {
|
async function checkAuth() {
|
||||||
@@ -78,8 +42,47 @@
|
|||||||
window.location.href = 'login.html';
|
window.location.href = 'login.html';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Проверяем авторизацию
|
// Проверка авторизации
|
||||||
checkAuth();
|
checkAuth();
|
||||||
</script>
|
</script>
|
||||||
|
<!-- Вот и фсе ребята -->
|
||||||
|
<div id="background">
|
||||||
|
<div class="border">
|
||||||
|
</div>
|
||||||
|
<div id="code">
|
||||||
|
<span>Комплект стендов учебных комплекса с БЛА БлД СТ АЦИЕ.01181-01</span>
|
||||||
|
</div>
|
||||||
|
<div class="header">
|
||||||
|
<img class="top-bar" src="/assets/img/tinybar.png"/>
|
||||||
|
<img class="center-bar" src="/assets/img/centerbar.png"/>
|
||||||
|
<img class="bottom-bar" src="/assets/img/tinybar.png"/>
|
||||||
|
<div>
|
||||||
|
<img class="logo" src="/assets/img/logo.svg"/>
|
||||||
|
<img class="logo-text" src="/assets/img/logo_text.svg"/>
|
||||||
|
</div>
|
||||||
|
<div class="title">
|
||||||
|
<span>
|
||||||
|
БЛА БлД СТ «Орлан-7»
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="select-menu">
|
||||||
|
<div class="point-menu">
|
||||||
|
<a href="/okr/polebla/orlan7/stand/stand7/orlan7.html?back=1">БЛА БлД СТ «Орлан-7»</a>
|
||||||
|
</div>
|
||||||
|
<div class="point-menu disable">
|
||||||
|
<a href="/okr/polebla/orlan7/stand/power7/power7.html?back=1">Силовая установка БЛА БлД СТ «Орлан-7»</a>
|
||||||
|
</div>
|
||||||
|
<div class="point-menu disable">
|
||||||
|
<a href="/okr/polebla/orlan7/stand/sau7/sau7.html?back=1">САУ БЛА БлД СТ «Орлан-7»</a>
|
||||||
|
</div>
|
||||||
|
<div class="point-menu disable">
|
||||||
|
<a href="/okr/polebla/orlan7/stand/landsystem7/landsystem7.html?back=1">Система посадки БЛА БлД СТ «Орлан-7»</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="info-button">
|
||||||
|
<img src="/assets/img/info.png"></img>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -48,14 +48,12 @@ if (document.getElementById('loginForm')) {
|
|||||||
if (!data.site_alias) {
|
if (!data.site_alias) {
|
||||||
const metaAlias = document.querySelector('meta[name="site-alias"]');
|
const metaAlias = document.querySelector('meta[name="site-alias"]');
|
||||||
if (metaAlias && metaAlias.content) {
|
if (metaAlias && metaAlias.content) {
|
||||||
data.site_alias = metaAlias.content.trim().toLowerCase();
|
data.site_alias = metaAlias.content.trim();
|
||||||
} else {
|
} else {
|
||||||
const path = window.location.pathname.replace(/\/+$/, '');
|
const path = window.location.pathname.replace(/\/+$/, '');
|
||||||
const parts = path.split('/').filter(Boolean);
|
const parts = path.split('/').filter(Boolean);
|
||||||
data.site_alias = (parts[0] || 'root').toLowerCase();
|
data.site_alias = parts[0] || 'root';
|
||||||
}
|
}
|
||||||
} else if (typeof data.site_alias === 'string') {
|
|
||||||
data.site_alias = data.site_alias.trim().toLowerCase();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await sendRequest('api/login.php', data);
|
const result = await sendRequest('api/login.php', data);
|
||||||
|
|||||||
79
login.html
79
login.html
@@ -3,83 +3,14 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Вход</title>
|
<meta name="site-alias" content="o7">
|
||||||
<link rel="stylesheet" href="css/auth.css">
|
<link rel="stylesheet" href="css/auth.css">
|
||||||
<style>
|
<title>Вход</title>
|
||||||
:root {
|
|
||||||
color-scheme: light;
|
|
||||||
--bg: #f5f7fb;
|
|
||||||
--card: #ffffff;
|
|
||||||
--text: #1b1f2a;
|
|
||||||
--muted: #6b7280;
|
|
||||||
--border: #e5e7eb;
|
|
||||||
--accent: #3b82f6;
|
|
||||||
--accent-dark: #2563eb;
|
|
||||||
}
|
|
||||||
* { box-sizing: border-box; }
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: "Segoe UI", Arial, sans-serif;
|
|
||||||
background: linear-gradient(135deg, #eef2ff, #f8fafc);
|
|
||||||
color: var(--text);
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 24px;
|
|
||||||
}
|
|
||||||
.card {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 380px;
|
|
||||||
background: var(--card);
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 24px;
|
|
||||||
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
margin: 0 0 8px;
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
.subtitle {
|
|
||||||
margin: 0 0 20px;
|
|
||||||
color: var(--muted);
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.field {
|
|
||||||
margin-bottom: 14px;
|
|
||||||
}
|
|
||||||
label {
|
|
||||||
display: block;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--muted);
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 10px 12px;
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 8px;
|
|
||||||
font-size: 14px;
|
|
||||||
transition: border-color 0.2s, box-shadow 0.2s;
|
|
||||||
}
|
|
||||||
input:focus {
|
|
||||||
outline: none;
|
|
||||||
border-color: var(--accent);
|
|
||||||
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
|
|
||||||
}
|
|
||||||
.helper {
|
|
||||||
margin-top: 14px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--muted);
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h2>Вход</h2>
|
<h2>Вход</h2>
|
||||||
<p class="subtitle">Введите логин и пароль для доступа</p>
|
<p class="subtitle">Для доступа к стенду авторизуйтесь</p>
|
||||||
<form id="loginForm">
|
<form id="loginForm">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="username">Логин</label>
|
<label for="username">Логин</label>
|
||||||
@@ -89,9 +20,9 @@
|
|||||||
<label for="password">Пароль</label>
|
<label for="password">Пароль</label>
|
||||||
<input id="password" type="password" name="password" placeholder="Введите пароль" required autocomplete="current-password">
|
<input id="password" type="password" name="password" placeholder="Введите пароль" required autocomplete="current-password">
|
||||||
</div>
|
</div>
|
||||||
<button class="btn-primary" type="submit">Войти</button>
|
<button type="submit">Войти</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="helper">Доступ только для зарегистрированных пользователей</div>
|
<div class="helper">Доступ выдается по согласованию с комиссией ПДТК и с ГК ОКР</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="js/auth.js"></script>
|
<script src="js/auth.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
1786
nginx_T.txt
1786
nginx_T.txt
File diff suppressed because it is too large
Load Diff
6
users.txt
Normal file
6
users.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
ane.marin
|
||||||
|
r.abramov
|
||||||
|
a.agafonov
|
||||||
|
m.arkhipov
|
||||||
|
d.zaitsev
|
||||||
|
vlv.kuneevskii
|
||||||
6
users_with_passwords.txt
Normal file
6
users_with_passwords.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
ane.marin:KhfG4c
|
||||||
|
r.abramov:WAtY45
|
||||||
|
a.agafonov:XsmiAE
|
||||||
|
m.arkhipov:4nWj6J
|
||||||
|
d.zaitsev:ZgvacV
|
||||||
|
vlv.kuneevskii:RoAPfv
|
||||||
Reference in New Issue
Block a user