-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path403.php
More file actions
57 lines (49 loc) · 2.63 KB
/
403.php
File metadata and controls
57 lines (49 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
declare(strict_types=1);
http_response_code(403);
require_once __DIR__ . '/canonical_redirect.php';
require_once __DIR__ . '/lib/view_helpers.php';
$dbPath = getenv('PODCAST_DB_PATH') ?: __DIR__ . '/podcast.sqlite';
loadAppLocale($dbPath);
loadAdminTheme($dbPath);
handlePublicThemeModePreference();
$podcast = null;
try {
$pdo = new PDO('sqlite:' . $dbPath);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$podcast = $pdo->query('SELECT * FROM podcast ORDER BY id ASC LIMIT 1')->fetch() ?: null;
} catch (Throwable $e) {
// Si la BD no responde el header usa los valores por defecto.
}
$podcastTitle = (string) ($podcast['title'] ?? 'Podcast');
$podcastAuthor = (string) ($podcast['author'] ?? '');
$podcastDescription = (string) ($podcast['description'] ?? '');
$podcastImage = (string) ($podcast['image_url'] ?? '');
$searchQuery = '';
?><!doctype html>
<html lang="<?= esc(i18n_html_lang()) ?>" data-theme="<?= esc(adminTheme()) ?>" data-theme-mode="normal">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= __('Acceso prohibido') ?> – <?= esc($podcastTitle) ?></title>
<?= publicThemeModeBootstrapScript() ?>
<meta name="robots" content="noindex, nofollow">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/favicon.ico">
<link rel="stylesheet" href="/assets/css/common.css">
<link rel="stylesheet" href="/assets/css/header.css">
<link rel="stylesheet" href="/assets/css/themes.css">
</head>
<body>
<div class="container">
<?php require __DIR__ . '/header.php'; ?>
<main class="card" style="text-align:center;padding:3.5rem 2rem;">
<p style="font-family:var(--font-display);font-size:clamp(4rem,15vw,7rem);font-weight:700;line-height:1;margin:0;color:var(--accent);letter-spacing:-0.03em;">403</p>
<h2 style="font-family:var(--font-display);font-size:clamp(1.2rem,4vw,1.6rem);margin:.75rem 0 .6rem;"><?= __('Acceso prohibido') ?></h2>
<p style="color:var(--muted);margin:0 auto;max-width:38ch;"><?= __('El contenido al que estás tratando de acceder está prohibido y no tienes permiso para verlo.') ?></p>
<a href="/" style="display:inline-block;margin-top:2rem;padding:.5rem 1.4rem;border-radius:20px;background:var(--accent);color:#fff;font-weight:600;font-size:.9rem;text-decoration:none;transition:background .15s;" onmouseover="this.style.background='var(--accent-dark)'" onmouseout="this.style.background='var(--accent)'"><?= __('Volver al inicio') ?></a>
</main>
<?php require __DIR__ . '/footer.php'; ?>
</div>
</body>
</html>