Files
maria_uslugi/403.php
T
2026-03-05 10:25:39 +01:00

108 lines
3.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
// 403.php à la racine
require_once __DIR__ . '/../includes/bootstrap_global.php';
// Statut HTTP
http_response_code(403);
// Titre / textes (fallbacks RU/FR)
$title = $translations['err_403_title'] ?? '403 — Accès refusé';
$h1 = $translations['err_403_h1'] ?? 'Accès refusé';
$txt = $translations['err_403_text'] ?? 'Vous n’êtes pas autorisé à consulter cette page.';
$btnLogin = $translations['err_403_login'] ?? 'Se connecter';
$btnHome = $translations['err_403_home'] ?? 'Retour à l’accueil';
// next safe (chemin interne)
$next = $_GET['next'] ?? ($_SERVER['REQUEST_URI'] ?? '/');
$next = (is_string($next) && preg_match('#^/[^\\r\\n]*$#', $next)) ? $next : '/';
?>
<!doctype html>
<html lang="<?= htmlspecialchars($_SESSION['lang'] ?? 'fr', ENT_QUOTES, 'UTF-8') ?>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<title><?= htmlspecialchars($title, ENT_QUOTES, 'UTF-8') ?></title>
<meta name="robots" content="noindex, nofollow, noarchive, nosnippet">
<!-- Styles du site -->
<link rel="stylesheet" href="<?= asset('/includes/site_style.css') ?>">
<link rel="stylesheet" href="<?= asset('/includes/custom_style.css') ?>">
<link rel="stylesheet" href="<?= asset('/includes/mobil_style.css') ?>">
<!-- Optionnel: Bootstrap si tu veux cohérence avec le reste -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<style>
/* On reprend ton style "card" propre, mais cohérent avec le site */
html,body{height:100%}
body{
margin:0;
display:flex;
align-items:center;
justify-content:center;
background:#f7f7f9;
font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
padding:16px;
}
.card403{
max-width:560px;
width:100%;
background:#fff;
border:1px solid #e5e7eb;
border-radius:14px;
box-shadow:0 8px 24px rgba(0,0,0,.08);
padding:28px;
text-align:center;
}
.logoWrap{display:flex; justify-content:center; margin-bottom:14px;}
.logoWrap img{height:42px;}
h1{margin:6px 0 10px; font-size:22px;}
p{margin:0 0 18px; color:#6b7280;}
.rowBtns{display:flex; gap:10px; justify-content:center; flex-wrap:wrap;}
.btn403{
padding:10px 14px;
border-radius:999px;
text-decoration:none;
display:inline-block;
font-weight:600;
}
.btnPrimary{background:#E03C3F; color:#fff; width:200px; text-align:center;}
.btnOutline{border:1px solid #d1d5db; color:#fff; background:#38378B; width:200px; text-align:center;}
</style>
</head>
<body>
<div class="card403">
<div class="logoWrap">
<a href="/index.php" aria-label="uslugi.fr">
<img src="/public/uploads/img/logo.png" alt="uslugi.fr">
</a>
</div>
<h1><?= htmlspecialchars($h1, ENT_QUOTES, 'UTF-8') ?></h1>
<p><?= htmlspecialchars($txt, ENT_QUOTES, 'UTF-8') ?></p>
<div class="rowBtns">
<a class="btn403 btnPrimary" href="/connexion.php?next=<?= rawurlencode($next) ?>">
<?= htmlspecialchars($btnLogin, ENT_QUOTES, 'UTF-8') ?>
</a>
<a class="btn403 btnOutline" href="/">
<?= htmlspecialchars($btnHome, ENT_QUOTES, 'UTF-8') ?>
</a>
</div>
<!-- Lang switch optionnel (si tu veux la même UX) -->
<div style="margin-top:14px;">
<?php
$menuLang = __DIR__ . '/public/includes/menu_langue.php';
if (is_file($menuLang)) require $menuLang;
?>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>