diff --git a/admin/templates/pages/dashboard.php b/admin/templates/pages/dashboard.php
index 8a82b85..47fa884 100644
--- a/admin/templates/pages/dashboard.php
+++ b/admin/templates/pages/dashboard.php
@@ -56,7 +56,9 @@
| Site titel | = htmlspecialchars($siteConfig['site_title'] ?? 'CodePress') ?> |
| Standaard taal | = htmlspecialchars($siteConfig['language']['default'] ?? 'nl') ?> |
| Auteur | = htmlspecialchars($siteConfig['author']['name'] ?? '-') ?> |
+ | CodePress versie | v= htmlspecialchars($stats['cms_version']) ?> |
| PHP versie | = $stats['php_version'] ?> |
+ | Besturingssysteem | = htmlspecialchars($stats['os']) ?> |
| Config geladen | = $stats['config_exists'] ? 'Ja' : 'Nee' ?> |
@@ -74,6 +76,7 @@
= htmlspecialchars($log['time']) ?>
= htmlspecialchars($log['level']) ?>
+ = htmlspecialchars($log['ip']) ?>
= htmlspecialchars($log['message']) ?>
diff --git a/public/admin.php b/public/admin.php
index ba37b28..706ae79 100644
--- a/public/admin.php
+++ b/public/admin.php
@@ -178,6 +178,9 @@ function handleDashboard(AdminAuth $auth, array $config): void
$pluginsDir = $config['plugins_dir'];
$configJson = $config['config_json'];
+ $versionFile = __DIR__ . '/../version.php';
+ $versionInfo = file_exists($versionFile) ? include $versionFile : [];
+
$stats = [
'pages' => countFiles($contentDir, ['md', 'php', 'html']),
'directories' => countDirs($contentDir),
@@ -185,6 +188,8 @@ function handleDashboard(AdminAuth $auth, array $config): void
'config_exists' => file_exists($configJson),
'content_size' => formatSize(dirSize($contentDir)),
'php_version' => PHP_VERSION,
+ 'cms_version' => $versionInfo['version'] ?? '-',
+ 'os' => PHP_OS_FAMILY . ' (' . php_uname('r') . ')',
];
// Load site config
@@ -290,7 +295,10 @@ function adminLog(array $config, string $level, string $message): void
@mkdir($dir, 0755, true);
}
$timestamp = date('Y-m-d H:i:s');
- $ip = $_SERVER['REMOTE_ADDR'] ?? 'cli';
+ $ip = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['HTTP_X_REAL_IP'] ?? $_SERVER['REMOTE_ADDR'] ?? 'cli';
+ if (($commaPos = strpos($ip, ',')) !== false) {
+ $ip = trim(substr($ip, 0, $commaPos));
+ }
@file_put_contents($logFile, "[{$timestamp}] [{$level}] [{$ip}] {$message}\n", FILE_APPEND);
}