nearly prod

This commit is contained in:
Jester
2026-01-19 16:41:30 +03:00
parent 5a3494e10d
commit cfa5ad9c28
9 changed files with 158 additions and 1929 deletions

View File

@@ -21,8 +21,7 @@ if (!is_array($data)) {
$login = trim($data['username'] ?? '');
$password = $data['password'] ?? '';
$siteAlias = strtolower(trim($data['site_alias'] ?? ''));
$siteAlias = trim($data['site_alias'] ?? '');
if ($siteAlias === '') {
http_response_code(400);
echo json_encode(['success' => false, 'message' => 'Не указан сайт']);
@@ -30,6 +29,7 @@ if ($siteAlias === '') {
}
// Поиск пользователя по 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->execute([$login]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);
@@ -45,7 +45,6 @@ if ($user && password_verify($password, $user['password_hash'])) {
echo json_encode(['success' => false, 'message' => 'Нет доступа к сайту']);
exit;
}
// Успешная авторизация
session_regenerate_id(true);
$_SESSION['user_id'] = $user['id'];

View File

@@ -1,22 +1,10 @@
<?php
if (session_status() === PHP_SESSION_NONE) {
$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');
session_set_cookie_params([
'lifetime' => 0,
'path' => $basePath,
'path' => '/',
'domain' => '',
'secure' => $isSecure,
'httponly' => true,

View File

@@ -12,3 +12,87 @@
.btn-primary:hover {
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;
}

View File

@@ -1,60 +1,24 @@
<!DOCTYPE html>
<html>
<html lang="ru">
<head>
<title>БЛА БлД СТ «Орлан-7»</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Личный кабинет</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<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">
<style>
: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>
<script type="module" src="/js/window.js"></script>
</head>
<body>
<body style="display: none">
<!-- Авторизация ёпта -->
<div class="card">
<div id="user-info"></div>
<div class="actions">
<button class="btn-primary" onclick="logout()">Выйти</button>
</div>
</div>
<script>
// Проверка авторизации при загрузке страницы
async function checkAuth() {
@@ -78,8 +42,47 @@
window.location.href = 'login.html';
}
// Проверяем авторизацию
// Проверка авторизации
checkAuth();
</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>
</html>

View File

@@ -48,14 +48,12 @@ if (document.getElementById('loginForm')) {
if (!data.site_alias) {
const metaAlias = document.querySelector('meta[name="site-alias"]');
if (metaAlias && metaAlias.content) {
data.site_alias = metaAlias.content.trim().toLowerCase();
data.site_alias = metaAlias.content.trim();
} else {
const path = window.location.pathname.replace(/\/+$/, '');
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);

View File

@@ -3,83 +3,14 @@
<head>
<meta charset="utf-8">
<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">
<style>
: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>
<title>Вход</title>
</head>
<body>
<div class="card">
<h2>Вход</h2>
<p class="subtitle">Введите логин и пароль для доступа</p>
<p class="subtitle">Для доступа к стенду авторизуйтесь</p>
<form id="loginForm">
<div class="field">
<label for="username">Логин</label>
@@ -89,9 +20,9 @@
<label for="password">Пароль</label>
<input id="password" type="password" name="password" placeholder="Введите пароль" required autocomplete="current-password">
</div>
<button class="btn-primary" type="submit">Войти</button>
<button type="submit">Войти</button>
</form>
<div class="helper">Доступ только для зарегистрированных пользователей</div>
<div class="helper">Доступ выдается по согласованию с комиссией ПДТК и с ГК ОКР</div>
</div>
<script src="js/auth.js"></script>
</body>

File diff suppressed because it is too large Load Diff

6
users.txt Normal file
View File

@@ -0,0 +1,6 @@
ane.marin
r.abramov
a.agafonov
m.arkhipov
d.zaitsev
vlv.kuneevskii

6
users_with_passwords.txt Normal file
View File

@@ -0,0 +1,6 @@
ane.marin:KhfG4c
r.abramov:WAtY45
a.agafonov:XsmiAE
m.arkhipov:4nWj6J
d.zaitsev:ZgvacV
vlv.kuneevskii:RoAPfv