Autosave: 20260415-140256

This commit is contained in:
Flatlogic Bot 2026-04-15 14:02:57 +00:00
parent 253188b46d
commit 382882b7e9
16 changed files with 354 additions and 173 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@ -161,8 +161,7 @@ a:hover {
background-size: auto;
background-color: rgb(0 0 0 / 50%);
z-index: 100;
width: min(300px, calc(100vw - 50px));
max-width: calc(100vw - 50px);
width: 300px;
display: flex; /* Active le mode Flexbox */
flex-direction: column; /* Aligne les liens les uns sous les autres */
align-items: center; /* Centre verticalement */
@ -170,7 +169,7 @@ a:hover {
justify-content: center;
border: solid 3px rgb(155 145 60 / 25%);
border-radius: 10px;
padding: 5px 12px;
padding: 5px 0px 5px 0px;
text-align: center;
}
@ -184,16 +183,13 @@ a:hover {
background-size: auto;
background-color: rgb(0 0 0 / 50%);
z-index: 100;
width: min(300px, calc(100vw - 50px));
max-width: calc(100vw - 50px);
min-height: 35px;
height: auto;
width: 300px;
height: 35px;
display: flex; /* Active le mode Flexbox */
align-items: center; /* Centre verticalement */
justify-content: center;
border: solid 3px rgb(155 145 60 / 25%);
border-radius: 10px;
padding: 5px 12px;
text-align: center;
}
@ -206,9 +202,8 @@ a:hover {
background-position: center center;
background-size: auto;
z-index: 3;
width: min(1050px, calc(100vw - 40px));
min-height: 80px;
height: auto;
width: 1050px;
height: 80px;
text-align: center;
}
@ -217,7 +212,6 @@ a:hover {
justify-content: center; /* Centre les items horizontalement */
align-items: center; /* Centre verticalement */
gap: 10px; /* Espace entre les divs (modifiable) */
flex-wrap: wrap;
}
.center-div-menu .menu-item {
@ -380,7 +374,7 @@ a:hover {
}
.center-div-menu {
width: min(900px, calc(100vw - 48px));
width: min(1050px, calc(100vw - 40px));
}
}

View File

@ -18714,3 +18714,14 @@ INSERT INTO `tbl_scitemcustomstat` (`cl_scitemcustomstat_id`,`cl_scitemcustomsta
('6','3','6','','0.50','2026-04-08 22:01:49');
SET FOREIGN_KEY_CHECKS = 1;
CREATE TABLE IF NOT EXISTS tbl_page_access (
cl_page_access_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
cl_page_key VARCHAR(190) NOT NULL UNIQUE,
cl_page_file VARCHAR(190) NOT NULL UNIQUE,
cl_page_label VARCHAR(190) NOT NULL,
cl_allow_admin TINYINT(1) NOT NULL DEFAULT 1,
cl_allow_member TINYINT(1) NOT NULL DEFAULT 0,
cl_updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -193,3 +193,14 @@ CREATE TABLE `tbl_scwebhooks` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
CREATE TABLE IF NOT EXISTS tbl_page_access (
cl_page_access_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
cl_page_key VARCHAR(190) NOT NULL UNIQUE,
cl_page_file VARCHAR(190) NOT NULL UNIQUE,
cl_page_label VARCHAR(190) NOT NULL,
cl_allow_admin TINYINT(1) NOT NULL DEFAULT 1,
cl_allow_member TINYINT(1) NOT NULL DEFAULT 0,
cl_updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

View File

@ -51,6 +51,18 @@ function auth_bootstrap(): void
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"
);
$pdo->exec(
"CREATE TABLE IF NOT EXISTS tbl_page_access (
cl_page_access_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
cl_page_key VARCHAR(190) NOT NULL UNIQUE,
cl_page_file VARCHAR(190) NOT NULL UNIQUE,
cl_page_label VARCHAR(190) NOT NULL,
cl_allow_admin TINYINT(1) NOT NULL DEFAULT 1,
cl_allow_member TINYINT(1) NOT NULL DEFAULT 0,
cl_updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"
);
$sql_count_admin = "SELECT COUNT(*) FROM tbl_auth WHERE cl_auth_right = 'admin'";
$stmt_count_admin = $pdo->query($sql_count_admin);
$cl_auth_admin_total = (int) $stmt_count_admin->fetchColumn();
@ -139,6 +151,20 @@ function auth_is_admin(): bool
return isset($_SESSION['role']) && $_SESSION['role'] === 'admin';
}
function auth_current_user(): string
{
auth_start_session();
return isset($_SESSION['user']) ? (string) $_SESSION['user'] : '';
}
function auth_current_role(): string
{
auth_start_session();
return isset($_SESSION['role']) ? (string) $_SESSION['role'] : '';
}
function auth_flash_set(string $flash_type, string $flash_message): void
{
auth_start_session();
@ -160,4 +186,264 @@ function auth_flash_get(): ?array
unset($_SESSION['flash']);
return $flash;
}
}
function auth_page_basename(string $page_file): string
{
$basename = basename(trim($page_file));
if ($basename === '' || preg_match('/^[a-zA-Z0-9._-]+$/', $basename) !== 1) {
throw new InvalidArgumentException('Nom de page invalide.');
}
return $basename;
}
function auth_page_default_member_access(string $page_file): int
{
static $member_defaults = [
'scnotification.php' => 1,
'scpreset.php' => 1,
];
$page_file = auth_page_basename($page_file);
return $member_defaults[$page_file] ?? 0;
}
function auth_page_access_defaults(string $page_file, string $page_label = ''): array
{
$normalized_page_file = auth_page_basename($page_file);
$normalized_page_label = trim($page_label) !== '' ? trim($page_label) : $normalized_page_file;
return [
'cl_page_key' => pathinfo($normalized_page_file, PATHINFO_FILENAME),
'cl_page_file' => $normalized_page_file,
'cl_page_label' => $normalized_page_label,
'cl_allow_admin' => 1,
'cl_allow_member' => auth_page_default_member_access($normalized_page_file),
];
}
function auth_page_access_ensure(string $page_file, string $page_label = ''): array
{
auth_bootstrap();
$defaults = auth_page_access_defaults($page_file, $page_label);
$pdo = db();
$stmt = $pdo->prepare(
'SELECT cl_page_access_id, cl_page_key, cl_page_file, cl_page_label, cl_allow_admin, cl_allow_member
FROM tbl_page_access
WHERE cl_page_file = :cl_page_file
LIMIT 1'
);
$stmt->execute([
'cl_page_file' => $defaults['cl_page_file'],
]);
$row = $stmt->fetch();
if (!$row) {
$stmt_insert = $pdo->prepare(
'INSERT INTO tbl_page_access (cl_page_key, cl_page_file, cl_page_label, cl_allow_admin, cl_allow_member)
VALUES (:cl_page_key, :cl_page_file, :cl_page_label, :cl_allow_admin, :cl_allow_member)'
);
$stmt_insert->execute($defaults);
$stmt->execute([
'cl_page_file' => $defaults['cl_page_file'],
]);
$row = $stmt->fetch();
} elseif ($defaults['cl_page_label'] !== '' && (string) $row['cl_page_label'] !== $defaults['cl_page_label']) {
$stmt_update_label = $pdo->prepare(
'UPDATE tbl_page_access SET cl_page_label = :cl_page_label WHERE cl_page_file = :cl_page_file'
);
$stmt_update_label->execute([
'cl_page_label' => $defaults['cl_page_label'],
'cl_page_file' => $defaults['cl_page_file'],
]);
$row['cl_page_label'] = $defaults['cl_page_label'];
}
if (!$row) {
throw new RuntimeException('Impossible d\'initialiser la configuration d\'accès de la page.');
}
$row['cl_allow_admin'] = (int) ($row['cl_allow_admin'] ?? 1);
$row['cl_allow_member'] = (int) ($row['cl_allow_member'] ?? 0);
return $row;
}
function auth_user_can_access_page(string $page_file, string $page_label = ''): bool
{
auth_start_session();
auth_bootstrap();
if (!auth_is_logged_in()) {
return false;
}
if (auth_is_admin()) {
return true;
}
if (auth_current_role() !== 'member') {
return false;
}
$row = auth_page_access_ensure($page_file, $page_label);
return (int) $row['cl_allow_member'] === 1;
}
function auth_require_page_access(string $page_file, string $page_label = ''): void
{
if (!auth_is_logged_in()) {
header('Location: index.php');
exit;
}
if (auth_is_admin()) {
auth_page_access_ensure($page_file, $page_label);
return;
}
if (auth_user_can_access_page($page_file, $page_label)) {
return;
}
auth_flash_set('error', 'Accès refusé : cette page n\'est pas ouverte aux membres.');
header('Location: index.php');
exit;
}
function auth_handle_page_access_post(string $page_file, string $page_label = ''): void
{
auth_start_session();
auth_bootstrap();
if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST') {
return;
}
if (!isset($_POST['page_access_action'])) {
return;
}
$redirect_target = auth_page_basename($page_file);
if (!auth_is_admin()) {
auth_flash_set('error', 'Seul un administrateur peut modifier les accès de page.');
header('Location: index.php');
exit;
}
$csrf_token = isset($_POST['csrf_token']) ? (string) $_POST['csrf_token'] : null;
if (!auth_validate_csrf($csrf_token)) {
auth_flash_set('error', 'Jeton CSRF invalide.');
header('Location: ' . $redirect_target);
exit;
}
$row = auth_page_access_ensure($page_file, $page_label);
$cl_allow_member = isset($_POST['cl_allow_member']) ? 1 : 0;
$stmt = db()->prepare(
'UPDATE tbl_page_access
SET cl_page_label = :cl_page_label,
cl_allow_admin = 1,
cl_allow_member = :cl_allow_member
WHERE cl_page_file = :cl_page_file'
);
$stmt->execute([
'cl_page_label' => $row['cl_page_label'],
'cl_allow_member' => $cl_allow_member,
'cl_page_file' => $row['cl_page_file'],
]);
auth_flash_set('success', 'Accès mis à jour pour ' . $row['cl_page_label'] . '.');
header('Location: ' . $redirect_target);
exit;
}
function auth_render_page_access_widget(string $page_file, string $page_label = ''): string
{
if (!auth_is_admin()) {
return '';
}
$row = auth_page_access_ensure($page_file, $page_label);
$csrf_token = auth_csrf_token();
$action = htmlspecialchars($row['cl_page_file'], ENT_QUOTES, 'UTF-8');
$label = htmlspecialchars((string) $row['cl_page_label'], ENT_QUOTES, 'UTF-8');
$csrf = htmlspecialchars($csrf_token, ENT_QUOTES, 'UTF-8');
$member_checked = (int) $row['cl_allow_member'] === 1 ? 'checked' : '';
return <<<HTML
<div style="position:fixed;top:10px;right:10px;z-index:9999;background:rgba(10,14,18,0.94);border:1px solid rgba(162,155,120,0.45);border-radius:12px;padding:10px 12px;box-shadow:0 10px 24px rgba(0,0,0,0.35);backdrop-filter:blur(8px);font-family:Arial,sans-serif;color:#f2f2f2;min-width:220px;max-width:min(92vw,280px);">
<form method="post" action="{$action}" style="margin:0;display:flex;flex-direction:column;gap:8px;">
<input type="hidden" name="csrf_token" value="{$csrf}">
<input type="hidden" name="page_access_action" value="save">
<div style="font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#a29b78;">Accès page</div>
<div style="font-size:14px;font-weight:700;line-height:1.25;">{$label}</div>
<label style="display:flex;align-items:center;gap:8px;font-size:13px;opacity:.9;">
<input type="checkbox" checked disabled>
<span>Admin <small style="opacity:.7;">(toujours autorisé)</small></span>
</label>
<label style="display:flex;align-items:center;gap:8px;font-size:13px;">
<input type="checkbox" name="cl_allow_member" value="1" {$member_checked}>
<span>Membre</span>
</label>
<button type="submit" style="appearance:none;border:0;border-radius:8px;padding:8px 10px;background:#a29b78;color:#111;font-weight:700;cursor:pointer;">Appliquer</button>
</form>
</div>
HTML;
}
function auth_navigation_items(): array
{
return [
['file' => 'admin.php', 'label' => 'Utilisateurs', 'admin_only' => true],
['file' => 'scwebhook.php', 'label' => 'WEBHOOK'],
['file' => 'scnotification.php', 'label' => 'NOTIF DISCORD'],
['file' => 'scitems.php', 'label' => 'Base d\'Objets'],
['file' => 'scstatsitem.php', 'label' => 'Stats Item'],
['file' => 'scitemcustom.php', 'label' => 'Item Custom'],
['file' => 'scmining.php', 'label' => 'Scanner Minage'],
['file' => 'scmanufactures.php', 'label' => 'Manufactures'],
['file' => 'scvaisseaux.php', 'label' => 'Vaisseaux'],
['file' => 'scpreset.php', 'label' => 'Presets Vaisseau'],
];
}
function auth_render_app_nav(string $current_page): string
{
if (!auth_is_logged_in()) {
return '';
}
$current_page = auth_page_basename($current_page);
$html = '<nav class="nav-tabs">';
foreach (auth_navigation_items() as $item) {
$file = (string) $item['file'];
$label = (string) $item['label'];
$admin_only = !empty($item['admin_only']);
if ($admin_only && !auth_is_admin()) {
continue;
}
if (!auth_is_admin() && !auth_user_can_access_page($file, $label)) {
continue;
}
$is_active = $file === $current_page ? ' class="active"' : '';
$html .= '<a href="' . htmlspecialchars($file, ENT_QUOTES, 'UTF-8') . '"' . $is_active . '>' . htmlspecialchars($label, ENT_QUOTES, 'UTF-8') . '</a>';
}
$html .= '</nav>';
return $html;
}

View File

@ -38,7 +38,7 @@ $has_member_access = $is_authenticated && in_array($session_cl_auth_right, ['mem
<div class="connexion-div-menu <?php echo $is_authenticated ? 'is-authenticated' : 'md-trigger'; ?>" data-login-label="Login" <?php echo $is_authenticated ? '' : 'data-modal="modal-Login"'; ?> id="accountPanel">
<span id="accountLabel"><?php echo htmlspecialchars($is_authenticated ? $session_cl_auth_user : 'Login', ENT_QUOTES, 'UTF-8'); ?></span>
<span class="connexion-actions" id="accountActions" <?php echo $is_authenticated ? '' : 'hidden'; ?>>
<a id="adminLink" href="admin.php" <?php echo $session_cl_auth_right === 'admin' ? '' : 'hidden'; ?>>Admin</a>
<a id="adminLink" href="admin.php" <?php echo $has_member_access ? '' : 'hidden'; ?>>Admin</a>
<a id="logoutLink" href="logout.php">Déconnexion</a>
</span>
</div>

View File

@ -1005,7 +1005,7 @@ if ($has_member_access) {
<div class="connexion-div-menu <?php echo $is_authenticated ? 'is-authenticated' : 'md-trigger'; ?>" data-login-label="Connexion" <?php echo $is_authenticated ? '' : 'data-modal="modal-Login"'; ?> id="accountPanel">
<span id="accountLabel"><?php echo htmlspecialchars($is_authenticated ? $session_cl_auth_user : 'Connexion', ENT_QUOTES, 'UTF-8'); ?></span>
<span class="connexion-actions" id="accountActions" <?php echo $is_authenticated ? '' : 'hidden'; ?>>
<a id="adminLink" href="admin.php" <?php echo $session_cl_auth_right === 'admin' ? '' : 'hidden'; ?>>Admin</a>
<a id="adminLink" href="admin.php" <?php echo $has_member_access ? '' : 'hidden'; ?>>Admin</a>
<a id="logoutLink" href="logout.php">Déconnexion</a>
</span>
</div>

View File

@ -6,14 +6,11 @@ require_once __DIR__ . '/db/scitemcustom.php';
auth_start_session();
auth_bootstrap();
auth_handle_page_access_post('scitemcustom.php', 'Item Custom');
auth_require_page_access('scitemcustom.php', 'Item Custom');
scstatsitem_bootstrap();
scitemcustom_bootstrap();
if (!auth_is_admin()) {
header('Location: index.php');
exit;
}
function scitemcustom_normalize_sign(?string $sign): string
{
if ($sign === '-') {
@ -755,6 +752,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</style>
</head>
<body>
<?php echo auth_render_page_access_widget('scitemcustom.php', 'Item Custom'); ?>
<div class="admin-layout">
<header class="admin-topbar">
<div class="topbar-info">
@ -768,18 +766,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</div>
</header>
<nav class="nav-tabs">
<a href="admin.php">Utilisateurs</a>
<a href="scwebhook.php">WEBHOOK</a>
<a href="scnotification.php">NOTIF DISCORD</a>
<a href="scitems.php">Base d'Objets</a>
<a href="scstatsitem.php">Stats Item</a>
<a href="scitemcustom.php" class="active">Item Custom</a>
<a href="scmining.php">Scanner Minage</a>
<a href="scmanufactures.php">Manufactures</a>
<a href="scvaisseaux.php">Vaisseaux</a>
<a href="scpreset.php">Presets Vaisseau</a>
</nav>
<?php echo auth_render_app_nav('scitemcustom.php'); ?>
<?php if ($flash_message !== ''): ?>
<div class="flash <?php echo htmlspecialchars($flash_type, ENT_QUOTES, 'UTF-8'); ?>">

View File

@ -4,11 +4,8 @@ require_once __DIR__ . '/db/auth.php';
auth_start_session();
auth_bootstrap();
if (!auth_is_admin()) {
header('Location: index.php');
exit;
}
auth_handle_page_access_post('scitems.php', "Base d'Objets");
auth_require_page_access('scitems.php', "Base d'Objets");
$flash = auth_flash_get();
$flash_type = $flash['type'] ?? '';
@ -387,6 +384,7 @@ if ($edit_id > 0) {
</style>
</head>
<body>
<?php echo auth_render_page_access_widget('scitems.php', "Base d'Objets"); ?>
<div class="admin-layout">
<header class="admin-topbar">
<div class="topbar-info">
@ -399,18 +397,7 @@ if ($edit_id > 0) {
</div>
</header>
<nav class="nav-tabs">
<a href="admin.php">Utilisateurs</a>
<a href="scwebhook.php">WEBHOOK</a>
<a href="scnotification.php">NOTIF DISCORD</a>
<a href="scitems.php" class="active">Base d'Objets</a>
<a href="scstatsitem.php">Stats Item</a>
<a href="scitemcustom.php">Item Custom</a>
<a href="scmining.php">Scanner Minage</a>
<a href="scmanufactures.php">Manufactures</a>
<a href="scvaisseaux.php">Vaisseaux</a>
<a href="scpreset.php">Presets Vaisseau</a>
</nav>
<?php echo auth_render_app_nav('scitems.php'); ?>
<?php if ($flash_message !== ''): ?>
<div class="flash <?php echo htmlspecialchars($flash_type); ?>">

View File

@ -4,11 +4,8 @@ require_once __DIR__ . '/db/auth.php';
auth_start_session();
auth_bootstrap();
if (!auth_is_admin()) {
header('Location: index.php');
exit;
}
auth_handle_page_access_post('scmanufactures.php', 'Manufactures');
auth_require_page_access('scmanufactures.php', 'Manufactures');
$flash = auth_flash_get();
$flash_type = $flash['type'] ?? '';
@ -259,6 +256,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</style>
</head>
<body>
<?php echo auth_render_page_access_widget('scmanufactures.php', 'Manufactures'); ?>
<div class="admin-layout">
<header class="admin-topbar">
<div class="topbar-info">
@ -271,18 +269,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</div>
</header>
<nav class="nav-tabs">
<a href="admin.php">Utilisateurs</a>
<a href="scwebhook.php">WEBHOOK</a>
<a href="scnotification.php">NOTIF DISCORD</a>
<a href="scitems.php">Base d'Objets</a>
<a href="scstatsitem.php">Stats Item</a>
<a href="scitemcustom.php">Item Custom</a>
<a href="scmining.php">Scanner Minage</a>
<a href="scmanufactures.php" class="active">Manufactures</a>
<a href="scvaisseaux.php">Vaisseaux</a>
<a href="scpreset.php">Presets Vaisseau</a>
</nav>
<?php echo auth_render_app_nav('scmanufactures.php'); ?>
<?php if ($flash_message !== ''): ?>
<div class="flash <?php echo htmlspecialchars($flash_type); ?>">

View File

@ -4,11 +4,8 @@ require_once __DIR__ . '/db/auth.php';
auth_start_session();
auth_bootstrap();
if (!auth_is_admin()) {
header('Location: index.php');
exit;
}
auth_handle_page_access_post('scmining.php', 'Scanner Minage');
auth_require_page_access('scmining.php', 'Scanner Minage');
$flash = auth_flash_get();
$flash_type = $flash['type'] ?? '';
@ -445,6 +442,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</style>
</head>
<body>
<?php echo auth_render_page_access_widget('scmining.php', 'Scanner Minage'); ?>
<div class="admin-layout">
<header class="admin-topbar">
<div class="topbar-info">
@ -457,18 +455,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</div>
</header>
<nav class="nav-tabs">
<a href="admin.php">Utilisateurs</a>
<a href="scwebhook.php">WEBHOOK</a>
<a href="scnotification.php">NOTIF DISCORD</a>
<a href="scitems.php">Base d'Objets</a>
<a href="scstatsitem.php">Stats Item</a>
<a href="scitemcustom.php">Item Custom</a>
<a href="scmining.php" class="active">Scanner Minage</a>
<a href="scmanufactures.php">Manufactures</a>
<a href="scvaisseaux.php">Vaisseaux</a>
<a href="scpreset.php">Presets Vaisseau</a>
</nav>
<?php echo auth_render_app_nav('scmining.php'); ?>
<?php if ($flash_message !== ''): ?>
<div class="flash <?php echo htmlspecialchars($flash_type); ?>">

View File

@ -5,13 +5,10 @@ require_once __DIR__ . '/db/scdiscord.php';
auth_start_session();
auth_bootstrap();
auth_handle_page_access_post('scnotification.php', 'NOTIF DISCORD');
auth_require_page_access('scnotification.php', 'NOTIF DISCORD');
scdiscord_bootstrap();
if (!auth_is_logged_in()) {
header('Location: index.php');
exit;
}
$db = db();
$csrf_token = auth_csrf_token();
$flash = auth_flash_get();
@ -661,6 +658,7 @@ function scnotification_old_checked(array $old, string $key, bool $default = fal
</style>
</head>
<body>
<?php echo auth_render_page_access_widget('scnotification.php', 'NOTIF DISCORD'); ?>
<div class="admin-layout">
<header class="admin-topbar">
<div class="topbar-info">
@ -673,20 +671,7 @@ function scnotification_old_checked(array $old, string $key, bool $default = fal
</div>
</header>
<nav class="nav-tabs">
<?php if (auth_is_admin()): ?>
<a href="admin.php">Utilisateurs</a>
<a href="scwebhook.php">WEBHOOK</a>
<a href="scnotification.php" class="active">NOTIF DISCORD</a>
<a href="scitems.php">Base d'Objets</a>
<a href="scstatsitem.php">Stats Item</a>
<a href="scitemcustom.php">Item Custom</a>
<a href="scmining.php">Scanner Minage</a>
<a href="scmanufactures.php">Manufactures</a>
<a href="scvaisseaux.php">Vaisseaux</a>
<?php endif; ?>
<a href="scpreset.php">Presets Vaisseau</a>
</nav>
<?php echo auth_render_app_nav('scnotification.php'); ?>
<?php if ($flash_message !== ''): ?>
<div class="flash <?php echo htmlspecialchars($flash_type, ENT_QUOTES, 'UTF-8'); ?>">

View File

@ -4,11 +4,8 @@ require_once __DIR__ . '/db/auth.php';
auth_start_session();
auth_bootstrap();
if (!auth_is_logged_in()) {
header('Location: index.php');
exit;
}
auth_handle_page_access_post('scpreset.php', 'Presets Vaisseau');
auth_require_page_access('scpreset.php', 'Presets Vaisseau');
$flash = auth_flash_get();
$flash_type = $flash['type'] ?? '';
@ -461,6 +458,7 @@ unset($preset);
</style>
</head>
<body>
<?php echo auth_render_page_access_widget('scpreset.php', 'Presets Vaisseau'); ?>
<div class="admin-layout">
<header class="admin-topbar">
<div class="topbar-info">
@ -473,20 +471,7 @@ unset($preset);
</div>
</header>
<nav class="nav-tabs">
<?php if (auth_is_admin()): ?>
<a href="admin.php">Utilisateurs</a>
<a href="scwebhook.php">WEBHOOK</a>
<a href="scnotification.php">NOTIF DISCORD</a>
<a href="scitems.php">Base d'Objets</a>
<a href="scstatsitem.php">Stats Item</a>
<a href="scitemcustom.php">Item Custom</a>
<a href="scmining.php">Scanner Minage</a>
<a href="scmanufactures.php">Manufactures</a>
<a href="scvaisseaux.php">Vaisseaux</a>
<?php endif; ?>
<a href="scpreset.php" class="active">Presets Vaisseau</a>
</nav>
<?php echo auth_render_app_nav('scpreset.php'); ?>
<?php if ($flash_message !== ''): ?>
<div class="flash <?php echo htmlspecialchars($flash_type); ?>">

View File

@ -5,13 +5,10 @@ require_once __DIR__ . '/db/scstatsitem.php';
auth_start_session();
auth_bootstrap();
auth_handle_page_access_post('scstatsitem.php', 'Stats Item');
auth_require_page_access('scstatsitem.php', 'Stats Item');
scstatsitem_bootstrap();
if (!auth_is_admin()) {
header('Location: index.php');
exit;
}
$flash = auth_flash_get();
$flash_type = $flash['type'] ?? '';
$flash_message = $flash['message'] ?? '';
@ -349,6 +346,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</style>
</head>
<body>
<?php echo auth_render_page_access_widget('scstatsitem.php', 'Stats Item'); ?>
<div class="admin-layout">
<header class="admin-topbar">
<div class="topbar-info">
@ -362,18 +360,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</div>
</header>
<nav class="nav-tabs">
<a href="admin.php">Utilisateurs</a>
<a href="scwebhook.php">WEBHOOK</a>
<a href="scnotification.php">NOTIF DISCORD</a>
<a href="scitems.php">Base d'Objets</a>
<a href="scstatsitem.php" class="active">Stats Item</a>
<a href="scitemcustom.php">Item Custom</a>
<a href="scmining.php">Scanner Minage</a>
<a href="scmanufactures.php">Manufactures</a>
<a href="scvaisseaux.php">Vaisseaux</a>
<a href="scpreset.php">Presets Vaisseau</a>
</nav>
<?php echo auth_render_app_nav('scstatsitem.php'); ?>
<?php if ($flash_message !== ''): ?>
<div class="flash <?php echo htmlspecialchars($flash_type, ENT_QUOTES, 'UTF-8'); ?>">

View File

@ -4,11 +4,8 @@ require_once __DIR__ . '/db/auth.php';
auth_start_session();
auth_bootstrap();
if (!auth_is_admin()) {
header('Location: index.php');
exit;
}
auth_handle_page_access_post('scvaisseaux.php', 'Vaisseaux');
auth_require_page_access('scvaisseaux.php', 'Vaisseaux');
$flash = auth_flash_get();
$flash_type = $flash['type'] ?? '';
@ -270,6 +267,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</style>
</head>
<body>
<?php echo auth_render_page_access_widget('scvaisseaux.php', 'Vaisseaux'); ?>
<div class="admin-layout">
<header class="admin-topbar">
<div class="topbar-info">
@ -282,18 +280,7 @@ $current_session_user = $_SESSION['user'] ?? '';
</div>
</header>
<nav class="nav-tabs">
<a href="admin.php">Utilisateurs</a>
<a href="scwebhook.php">WEBHOOK</a>
<a href="scnotification.php">NOTIF DISCORD</a>
<a href="scitems.php">Base d'Objets</a>
<a href="scstatsitem.php">Stats Item</a>
<a href="scitemcustom.php">Item Custom</a>
<a href="scmining.php">Scanner Minage</a>
<a href="scmanufactures.php">Manufactures</a>
<a href="scvaisseaux.php" class="active">Vaisseaux</a>
<a href="scpreset.php">Presets Vaisseau</a>
</nav>
<?php echo auth_render_app_nav('scvaisseaux.php'); ?>
<?php if ($flash_message !== ''): ?>
<div class="flash <?php echo htmlspecialchars($flash_type); ?>">

View File

@ -5,13 +5,10 @@ require_once __DIR__ . '/db/scdiscord.php';
auth_start_session();
auth_bootstrap();
auth_handle_page_access_post('scwebhook.php', 'WEBHOOK');
auth_require_page_access('scwebhook.php', 'WEBHOOK');
scdiscord_bootstrap();
if (!auth_is_admin()) {
header('Location: index.php');
exit;
}
$db = db();
$csrf_token = auth_csrf_token();
$flash = auth_flash_get();
@ -535,6 +532,7 @@ $banners = $stmt_banners->fetchAll();
</style>
</head>
<body>
<?php echo auth_render_page_access_widget('scwebhook.php', 'WEBHOOK'); ?>
<div class="admin-layout">
<header class="admin-topbar">
<div class="topbar-info">
@ -547,18 +545,7 @@ $banners = $stmt_banners->fetchAll();
</div>
</header>
<nav class="nav-tabs">
<a href="admin.php">Utilisateurs</a>
<a href="scwebhook.php" class="active">WEBHOOK</a>
<a href="scnotification.php">NOTIF DISCORD</a>
<a href="scitems.php">Base d'Objets</a>
<a href="scstatsitem.php">Stats Item</a>
<a href="scitemcustom.php">Item Custom</a>
<a href="scmining.php">Scanner Minage</a>
<a href="scmanufactures.php">Manufactures</a>
<a href="scvaisseaux.php">Vaisseaux</a>
<a href="scpreset.php">Presets Vaisseau</a>
</nav>
<?php echo auth_render_app_nav('scwebhook.php'); ?>
<?php if ($flash_message !== ''): ?>
<div class="flash <?php echo htmlspecialchars($flash_type, ENT_QUOTES, 'UTF-8'); ?>">