Files
2026-02-17 09:29:34 -06:00

98 lines
2.8 KiB
PHP

<?php // phpcs:ignoreFile
$assetVersion = '2025.10.06.3';
$errorMessage = null;
if (!empty($_GET['error'])) {
$errorKey = $_GET['error'];
switch ($errorKey) {
case 'pleaselogin':
$errorMessage = 'We couldn\'t sign you in. Check your username and password, then try again.';
break;
case 'noinput':
$errorMessage = 'Enter both your username and password before signing in.';
break;
case 'invalidlogin':
$errorMessage = 'Those credentials didn\'t match our records. Double-check your username and password.';
break;
case 'servererror':
$errorMessage = 'We\'re having trouble reaching the login service. Please try again in a moment.';
break;
default:
$errorMessage = 'We couldn\'t sign you in right now. Please try again.';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sign in | LASUCA Controls</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
rel="stylesheet"
>
<link
rel="stylesheet"
href="style.css?v=<?php echo rawurlencode($assetVersion); ?>"
>
</head>
<body class="login-body">
<div class="login-actions">
<?php require __DIR__ . '/darkmode.php'; ?>
</div>
<main class="login-card" aria-labelledby="login-title">
<span class="login-card__badge">LASUCA Controls</span>
<header class="login-card__header">
<h1 class="login-card__title" id="login-title">Sign in</h1>
<p class="login-card__subtitle">Access live dashboards, historian tools, and production analytics.</p>
</header>
<?php if ($errorMessage) : ?>
<div class="login-card__alert" role="alert">
<span aria-hidden="true">⚠️</span>
<span><?php echo htmlspecialchars($errorMessage); ?></span>
</div>
<?php endif; ?>
<form
class="login-form"
id="loginForm"
method="post"
action="login/function.php"
novalidate
>
<div class="login-form__field">
<label for="login">Username</label>
<input
type="text"
name="login"
id="login"
autocomplete="username"
required
>
</div>
<div class="login-form__field">
<label for="password">Password</label>
<input
type="password"
name="password"
id="password"
autocomplete="current-password"
required
>
</div>
<button type="submit" name="submit" class="button button--full">Sign in</button>
</form>
<p class="login-card__footer">Need access? Contact the control room or your shift supervisor.</p>
</main>
</body>
</html>