hasUsers()) { header('Location: setup.php'); exit; } // If already logged in, redirect to main page if ($auth->isAuthenticated()) { header('Location: index.php'); exit; } $error = ''; $message = ''; // Handle login form submission if ($_SERVER['REQUEST_METHOD'] === 'POST') { $username = trim($_POST['username'] ?? ''); $password = $_POST['password'] ?? ''; $ip = Auth::getClientIP(); if (empty($username) || empty($password)) { $error = 'Введите имя пользователя и пароль'; } else { $result = $auth->login($username, $password, $ip); if ($result['success']) { $auth->startSession($result['username'], $result['token']); header('Location: index.php'); exit; } else { $error = $result['message']; } } } // CSRF token $csrfToken = bin2hex(random_bytes(32)); $_SESSION['csrf_token'] = $csrfToken; ?> Вход - VH Posting System

VH Posting System

Вход в систему