Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ab18c7b46 | ||
|
|
92d782e6c5 |
+29
-16
@@ -22,6 +22,7 @@ $layoutSidebarColor = $layoutThemeConfig['header_color'] ?? '#0a369d';
|
|||||||
.admin-sidebar .nav-link:hover { color: #fff; background-color: rgba(255,255,255,0.1); }
|
.admin-sidebar .nav-link:hover { color: #fff; background-color: rgba(255,255,255,0.1); }
|
||||||
.admin-sidebar .nav-link.active { color: #fff; background-color: rgba(255,255,255,0.2); border-left: 3px solid #fff; }
|
.admin-sidebar .nav-link.active { color: #fff; background-color: rgba(255,255,255,0.2); border-left: 3px solid #fff; }
|
||||||
.admin-sidebar .nav-link i { width: 24px; text-align: center; margin-right: 0.5rem; }
|
.admin-sidebar .nav-link i { width: 24px; text-align: center; margin-right: 0.5rem; }
|
||||||
|
.admin-sidebar .nav-section { color: rgba(255,255,255,0.4); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 1rem 1.25rem 0.3rem 1.25rem; }
|
||||||
.admin-main { margin-left: 240px; padding: 2rem; }
|
.admin-main { margin-left: 240px; padding: 2rem; }
|
||||||
.admin-brand { color: #fff; padding: 1.25rem; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.15); }
|
.admin-brand { color: #fff; padding: 1.25rem; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.15); }
|
||||||
.admin-brand i { margin-right: 0.5rem; }
|
.admin-brand i { margin-right: 0.5rem; }
|
||||||
@@ -45,37 +46,50 @@ $layoutSidebarColor = $layoutThemeConfig['header_color'] ?? '#0a369d';
|
|||||||
<i class="bi bi-gear-fill"></i> CodePress Admin
|
<i class="bi bi-gear-fill"></i> CodePress Admin
|
||||||
</div>
|
</div>
|
||||||
<ul class="nav flex-column mt-2">
|
<ul class="nav flex-column mt-2">
|
||||||
|
<li class="nav-section">Algemeen</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= ($route ?? '') === 'dashboard' || ($route ?? '') === '' ? 'active' : '' ?>" href="/admin/dashboard">
|
<a class="nav-link <?= ($route ?? '') === 'dashboard' || ($route ?? '') === '' ? 'active' : '' ?>" href="/admin/dashboard">
|
||||||
<i class="bi bi-speedometer2"></i> Dashboard
|
<i class="bi bi-speedometer2"></i> Dashboard
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-section">Content</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= ($route ?? '') === 'content' || str_starts_with($route ?? '', 'content') ? 'active' : '' ?>" href="/admin/content">
|
<a class="nav-link <?= ($route ?? '') === 'content' || str_starts_with($route ?? '', 'content') ? 'active' : '' ?>" href="/admin/content">
|
||||||
<i class="bi bi-file-earmark-text"></i> Content
|
<i class="bi bi-file-earmark-text"></i> Content
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-section">Instellingen</li>
|
||||||
<a class="nav-link <?= ($route ?? '') === 'theme' ? 'active' : '' ?>" href="/admin/theme">
|
|
||||||
<i class="bi bi-palette"></i> Thema
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= ($route ?? '') === 'config' ? 'active' : '' ?>" href="/admin/config">
|
<a class="nav-link <?= ($route ?? '') === 'config' ? 'active' : '' ?>" href="/admin/config">
|
||||||
<i class="bi bi-sliders"></i> Configuratie
|
<i class="bi bi-sliders"></i> Configuratie
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link <?= ($route ?? '') === 'theme' ? 'active' : '' ?>" href="/admin/theme">
|
||||||
|
<i class="bi bi-palette"></i> Thema
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= ($route ?? '') === 'security' ? 'active' : '' ?>" href="/admin/security">
|
<a class="nav-link <?= ($route ?? '') === 'security' ? 'active' : '' ?>" href="/admin/security">
|
||||||
<i class="bi bi-shield-check"></i> Beveiliging
|
<i class="bi bi-shield-check"></i> Beveiliging
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-section">Gegevens</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= ($route ?? '') === 'statistics' ? 'active' : '' ?>" href="/admin/statistics">
|
<a class="nav-link <?= ($route ?? '') === 'statistics' ? 'active' : '' ?>" href="/admin/statistics">
|
||||||
<i class="bi bi-bar-chart"></i> Statistieken
|
<i class="bi bi-bar-chart"></i> Statistieken
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link <?= ($route ?? '') === 'logs' ? 'active' : '' ?>" href="/admin/logs">
|
||||||
|
<i class="bi bi-journal-text"></i> Logs
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-section">Systeem</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= ($route ?? '') === 'plugins' ? 'active' : '' ?>" href="/admin/plugins">
|
<a class="nav-link <?= ($route ?? '') === 'plugins' ? 'active' : '' ?>" href="/admin/plugins">
|
||||||
<i class="bi bi-plug"></i> Plugins
|
<i class="bi bi-plug"></i> Plugins
|
||||||
@@ -86,22 +100,21 @@ $layoutSidebarColor = $layoutThemeConfig['header_color'] ?? '#0a369d';
|
|||||||
<i class="bi bi-people"></i> Gebruikers
|
<i class="bi bi-people"></i> Gebruikers
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link <?= ($route ?? '') === 'guide' ? 'active' : '' ?>" href="/admin/guide">
|
|
||||||
<i class="bi bi-book"></i> Handleiding
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link <?= ($route ?? '') === 'logs' ? 'active' : '' ?>" href="/admin/logs">
|
|
||||||
<i class="bi bi-journal-text"></i> Logs
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <?= ($route ?? '') === 'update' ? 'active' : '' ?>" href="/admin/update">
|
<a class="nav-link <?= ($route ?? '') === 'update' ? 'active' : '' ?>" href="/admin/update">
|
||||||
<i class="bi bi-cloud-arrow-down"></i> Update
|
<i class="bi bi-cloud-arrow-down"></i> Update
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item mt-3">
|
|
||||||
|
<li class="nav-section">Help</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link <?= ($route ?? '') === 'guide' ? 'active' : '' ?>" href="/admin/guide">
|
||||||
|
<i class="bi bi-book"></i> Handleiding
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-section mt-3">Links</li>
|
||||||
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/" target="_blank">
|
<a class="nav-link" href="/" target="_blank">
|
||||||
<i class="bi bi-box-arrow-up-right"></i> Website bekijken
|
<i class="bi bi-box-arrow-up-right"></i> Website bekijken
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -127,6 +127,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow-sm mb-4">
|
||||||
|
<div class="card-header">
|
||||||
|
<i class="bi bi-eye-slash"></i> IP Uitsluitingen
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="excluded_ips" class="form-label fw-bold">IP-adressen uitsluiten van statistieken en beveiliging</label>
|
||||||
|
<textarea class="form-control font-monospace" id="excluded_ips" name="excluded_ips" rows="4" placeholder="Één IP per regel (bijv. 127.0.0.1)"><?= htmlspecialchars(implode("\n", $configData['analytics']['excluded_ips'] ?? [])) ?></textarea>
|
||||||
|
<div class="form-text">Verzoeken van deze IP-adressen worden niet opgenomen in de statistieken en overgeslagen bij beveiligingscontroles (bot-detectie, rate limiting).</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary btn-lg">
|
<button type="submit" class="btn btn-primary btn-lg">
|
||||||
<i class="bi bi-check-lg"></i> Configuratie opslaan
|
<i class="bi bi-check-lg"></i> Configuratie opslaan
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
+3
-1
@@ -53,7 +53,8 @@ if (!file_exists($configJsonPath)) {
|
|||||||
'geoip_mmdb_path' => '',
|
'geoip_mmdb_path' => '',
|
||||||
'geoip_api_url' => '',
|
'geoip_api_url' => '',
|
||||||
'geoip_api_key' => '',
|
'geoip_api_key' => '',
|
||||||
'retention_days' => 400
|
'retention_days' => 400,
|
||||||
|
'excluded_ips' => []
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
@file_put_contents($configJsonPath, json_encode($defaultConfig, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
@file_put_contents($configJsonPath, json_encode($defaultConfig, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
||||||
@@ -87,6 +88,7 @@ if (file_exists($configJsonPath)) {
|
|||||||
'geoip_api_url' => '',
|
'geoip_api_url' => '',
|
||||||
'geoip_api_key' => '',
|
'geoip_api_key' => '',
|
||||||
'retention_days' => 400,
|
'retention_days' => 400,
|
||||||
|
'excluded_ips' => [],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
foreach ($sectionDefaults as $section => $defaults) {
|
foreach ($sectionDefaults as $section => $defaults) {
|
||||||
|
|||||||
+388
-434
File diff suppressed because it is too large
Load Diff
+391
-441
File diff suppressed because it is too large
Load Diff
@@ -754,6 +754,19 @@ function handleConfig(AdminAuth $auth, array $config): void
|
|||||||
$configData['features']['search_enabled'] = !empty($_POST['feature_search']);
|
$configData['features']['search_enabled'] = !empty($_POST['feature_search']);
|
||||||
$configData['features']['breadcrumbs_enabled'] = !empty($_POST['feature_breadcrumbs']);
|
$configData['features']['breadcrumbs_enabled'] = !empty($_POST['feature_breadcrumbs']);
|
||||||
|
|
||||||
|
$parseLines = function($text) {
|
||||||
|
$lines = explode("\n", str_replace("\r", "", $text));
|
||||||
|
$clean = [];
|
||||||
|
foreach ($lines as $line) {
|
||||||
|
$item = trim($line);
|
||||||
|
if ($item !== '') {
|
||||||
|
$clean[] = $item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return array_values(array_unique($clean));
|
||||||
|
};
|
||||||
|
$configData['analytics']['excluded_ips'] = $parseLines($_POST['excluded_ips'] ?? '');
|
||||||
|
|
||||||
file_put_contents($configJson, json_encode($configData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
file_put_contents($configJson, json_encode($configData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
||||||
adminLog($config, 'info', $user['username'] . ' wijzigde site configuratie');
|
adminLog($config, 'info', $user['username'] . ' wijzigde site configuratie');
|
||||||
$message = 'Configuratie opgeslagen.';
|
$message = 'Configuratie opgeslagen.';
|
||||||
|
|||||||
+5
-2
@@ -112,7 +112,10 @@ $secSettings = $config['security'] ?? [
|
|||||||
];
|
];
|
||||||
|
|
||||||
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
|
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
|
||||||
$isAllowedIp = in_array($clientIp, $secSettings['allowed_ips'] ?? [], true);
|
$analyticsSettings = $config['analytics'] ?? [];
|
||||||
|
$excludedIps = $analyticsSettings['excluded_ips'] ?? [];
|
||||||
|
$isAllowedIp = in_array($clientIp, $secSettings['allowed_ips'] ?? [], true)
|
||||||
|
|| in_array($clientIp, $excludedIps, true);
|
||||||
$requestStatus = 'ok';
|
$requestStatus = 'ok';
|
||||||
|
|
||||||
if (!$isAllowedIp) {
|
if (!$isAllowedIp) {
|
||||||
@@ -182,7 +185,7 @@ if (!str_starts_with($path, '/-media/') && !str_starts_with($path, '/-assets/'))
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Record aggregated statistics
|
// Record aggregated statistics
|
||||||
if (!empty($analyticsSettings['enabled'])) {
|
if (!empty($analyticsSettings['enabled']) && !in_array($clientIp, $excludedIps, true)) {
|
||||||
$analytics = new Analytics($analyticsSettings);
|
$analytics = new Analytics($analyticsSettings);
|
||||||
$analytics->record($currentPage, $storedIp, $userAgent, $referrer, $geoCountry, $requestStatus);
|
$analytics->record($currentPage, $storedIp, $userAgent, $referrer, $geoCountry, $requestStatus);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-1
@@ -6,12 +6,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'version' => '1.9.1',
|
'version' => '1.9.2',
|
||||||
'release_date' => '2026-07-29',
|
'release_date' => '2026-07-29',
|
||||||
'codename' => 'Atlas',
|
'codename' => 'Atlas',
|
||||||
'status' => 'stable',
|
'status' => 'stable',
|
||||||
|
|
||||||
'changelog' => [
|
'changelog' => [
|
||||||
|
'1.9.2' => [
|
||||||
|
'date' => '2026-07-29',
|
||||||
|
'changes' => [
|
||||||
|
'Admin sidebar restructured into logical groups: Algemeen, Content, Instellingen, Gegevens, Systeem, Help, Links',
|
||||||
|
'IP uitsluitingen toegevoegd aan configuratie: IP's niet meetellen in statistieken en overslaan bij beveiligingscontroles',
|
||||||
|
'Guide (NL/EN) volledig herschreven metzelfde logische indeling als sidebar',
|
||||||
|
]
|
||||||
|
],
|
||||||
'1.9.1' => [
|
'1.9.1' => [
|
||||||
'date' => '2026-07-29',
|
'date' => '2026-07-29',
|
||||||
'changes' => [
|
'changes' => [
|
||||||
|
|||||||
Reference in New Issue
Block a user