log irgendwas

This commit is contained in:
2026-02-03 01:15:59 +01:00
parent 11936a4b71
commit 42f49f275e
3 changed files with 24 additions and 3 deletions

View File

@@ -1,6 +1,25 @@
<?php
require_once __DIR__ . '/../config/fileload.php';
$debugDir = dirname(__DIR__) . '/debug';
if (!is_dir($debugDir)) {
@mkdir($debugDir, 0777, true);
@chmod($debugDir, 0777);
}
$clientIp = '';
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$clientIp = trim(explode(',', (string)$_SERVER['HTTP_X_FORWARDED_FOR'])[0]);
} elseif (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])) {
$clientIp = (string)$_SERVER['HTTP_CF_CONNECTING_IP'];
} elseif (!empty($_SERVER['HTTP_X_REAL_IP'])) {
$clientIp = (string)$_SERVER['HTTP_X_REAL_IP'];
} else {
$clientIp = (string)($_SERVER['REMOTE_ADDR'] ?? '');
}
$clientIp = trim($clientIp);
$accessLine = date(DATE_ATOM) . ' | ' . ($clientIp !== '' ? $clientIp : 'unknown') . "\n";
@file_put_contents($debugDir . '/last_access.log', $accessLine);
$pageTitle = 'Email Template System Admin';
$pageId = 'home';
$navLinks = [];