1abe5218ca
What changed: Added pretty URL helpers/default setting in [includes/db.php](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php). Added root rewrite rules in [.htaccess](/Users/tyemeclifford/Documents/GH/mediaplayer/.htaccess):/v/<slug> /all /search/<query> Added Admin → Settings “Public URL Style” toggle in [admin/settings.php](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/settings.php), defaulting to pretty URLs. Updated public/player/catalogue/embed/admin preview links to use the configured URL style. Added redirects from legacy ?v= and ?q= URLs to pretty routes when rewriting is enabled. Documented deployment and fallback behavior in [README.md](/Users/tyemeclifford/Documents/GH/mediaplayer/README.md).
82 lines
2.8 KiB
PHP
82 lines
2.8 KiB
PHP
<?php
|
|
require_once __DIR__ . '/auth.php';
|
|
require_once __DIR__ . '/../includes/layout.php';
|
|
|
|
if (admin_is_logged_in()) {
|
|
header('Location: index.php');
|
|
exit;
|
|
}
|
|
|
|
$error = '';
|
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
$pw = $_POST['password'] ?? '';
|
|
if (admin_login($pw)) {
|
|
header('Location: index.php');
|
|
exit;
|
|
}
|
|
$error = 'Invalid password.';
|
|
}
|
|
|
|
render_head('Admin Login — TyClifford.com', '
|
|
.login-wrap {
|
|
display:flex; align-items:center; justify-content:center;
|
|
min-height:70vh;
|
|
}
|
|
.login-card {
|
|
background:var(--surface); border:1px solid var(--border);
|
|
border-radius:calc(var(--r)+4px); padding:2.5rem 2rem;
|
|
width:100%; max-width:380px;
|
|
display:flex; flex-direction:column; gap:1.5rem;
|
|
position:relative; overflow:hidden;
|
|
box-shadow:0 4px 60px rgba(0,0,0,.5);
|
|
}
|
|
.login-card::before {
|
|
content:""; position:absolute; top:0; left:0; right:0; height:2px;
|
|
background:linear-gradient(90deg,var(--pat),var(--purple),var(--blue),var(--green),var(--blue),var(--purple),var(--pat));
|
|
background-size:300% 100%; animation:shimmer 5s linear infinite;
|
|
}
|
|
.login-title { font-size:1.1rem; font-weight:700; color:var(--text); }
|
|
.login-sub { font-family:"Share Tech Mono",monospace; font-size:.63rem; color:var(--text-3); letter-spacing:.12em; text-transform:uppercase; margin-top:.15rem; }
|
|
');
|
|
?>
|
|
<main class="page" role="main">
|
|
<header class="topbar">
|
|
<div class="topbar-brand">
|
|
<div>
|
|
<div class="brand-name">Ty Clifford</div>
|
|
<div class="brand-sub">admin dashboard</div>
|
|
</div>
|
|
</div>
|
|
<a href="<?= h(public_absolute_url(public_home_url())) ?>" class="btn btn-secondary btn-sm">← Back to site</a>
|
|
</header>
|
|
|
|
<div class="login-wrap">
|
|
<div class="login-card">
|
|
<div>
|
|
<div class="login-title">Admin Login</div>
|
|
<div class="login-sub">tyclifford.com / media / admin</div>
|
|
</div>
|
|
|
|
<?php if ($error): ?>
|
|
<div class="notice notice-error"><?= h($error) ?></div>
|
|
<?php endif; ?>
|
|
|
|
<form method="post" action="login.php">
|
|
<div class="form-group" style="margin-bottom:1rem">
|
|
<label class="form-label" for="password">Password</label>
|
|
<input class="form-input" type="password" id="password" name="password"
|
|
autofocus autocomplete="current-password" placeholder="••••••••">
|
|
</div>
|
|
<button class="btn btn-primary" type="submit" style="width:100%">
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg>
|
|
Sign In
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<?php render_footer(); ?>
|
|
</main>
|
|
</body>
|
|
</html>
|