neonail-database/fix-logout-simple-2.php
2025-08-10 18:09:07 +02:00

148 lines
4.9 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
// Fix: Logout-Route Cache-Problem beheben (vereinfacht)
echo "🔧 Fix: Logout-Route Cache-Problem beheben (vereinfacht)\n";
echo "======================================================\n\n";
// 1. Alle Cache-Dateien löschen
echo "1. 🗑️ Alle Cache-Dateien löschen...\n";
$cacheFiles = [
'bootstrap/cache/packages.php',
'bootstrap/cache/services.php',
'bootstrap/cache/routes.php',
'bootstrap/cache/config.php',
'bootstrap/cache/application.php'
];
foreach ($cacheFiles as $cacheFile) {
if (file_exists($cacheFile)) {
unlink($cacheFile);
echo " ✅ Gelöscht: $cacheFile\n";
} else {
echo " Nicht vorhanden: $cacheFile\n";
}
}
// 2. Laravel Cache leeren (ohne Composer)
echo "\n2. 🧹 Laravel Cache leeren...\n";
system('php artisan cache:clear 2>/dev/null || echo " ⚠️ cache:clear übersprungen"');
system('php artisan config:clear 2>/dev/null || echo " ⚠️ config:clear übersprungen"');
system('php artisan view:clear 2>/dev/null || echo " ⚠️ view:clear übersprungen"');
system('php artisan route:clear 2>/dev/null || echo " ⚠️ route:clear übersprungen"');
echo " ✅ Laravel Cache geleert\n";
// 3. Routes-Datei prüfen
echo "\n3. 🛣️ Routes-Datei prüfen...\n";
$routesPath = 'routes/web.php';
if (file_exists($routesPath)) {
$content = file_get_contents($routesPath);
// Zeige alle Logout-bezogenen Zeilen
$lines = explode("\n", $content);
$logoutLines = [];
foreach ($lines as $lineNumber => $line) {
if (strpos($line, 'logout') !== false) {
$logoutLines[] = ($lineNumber + 1) . ": " . trim($line);
}
}
if (!empty($logoutLines)) {
echo " ✅ Logout-Routes gefunden:\n";
foreach ($logoutLines as $line) {
echo " 📋 $line\n";
}
} else {
echo " ❌ Keine Logout-Routes gefunden\n";
}
} else {
echo " ❌ Routes-Datei nicht gefunden\n";
}
// 4. LoginController prüfen
echo "\n4. 🔐 LoginController prüfen...\n";
$controllerPath = 'app/Http/Controllers/Auth/LoginController.php';
if (file_exists($controllerPath)) {
$content = file_get_contents($controllerPath);
if (strpos($content, 'public function logout') !== false) {
echo " ✅ Logout-Methode vorhanden\n";
// Zeige Logout-Methode
$lines = explode("\n", $content);
$inLogoutMethod = false;
$methodLines = [];
foreach ($lines as $lineNumber => $line) {
if (strpos($line, 'public function logout') !== false) {
$inLogoutMethod = true;
$methodLines[] = ($lineNumber + 1) . ": " . trim($line);
} elseif ($inLogoutMethod && strpos($line, 'public function') !== false) {
$inLogoutMethod = false;
} elseif ($inLogoutMethod) {
$methodLines[] = ($lineNumber + 1) . ": " . trim($line);
}
}
echo " 📋 Logout-Methode:\n";
foreach ($methodLines as $line) {
echo " $line\n";
}
} else {
echo " ❌ Logout-Methode nicht gefunden\n";
}
} else {
echo " ❌ LoginController nicht gefunden\n";
}
// 5. Layout prüfen
echo "\n5. 🎨 Layout prüfen...\n";
$layoutPath = 'resources/views/layouts/app.blade.php';
if (file_exists($layoutPath)) {
$content = file_get_contents($layoutPath);
// Suche nach Logout-Form
if (strpos($content, 'logout-form') !== false) {
echo " ✅ Logout-Form gefunden\n";
// Zeige Logout-Form Details
$lines = explode("\n", $content);
foreach ($lines as $lineNumber => $line) {
if (strpos($line, 'logout') !== false) {
echo " 📋 Zeile " . ($lineNumber + 1) . ": " . trim($line) . "\n";
}
}
} else {
echo " ❌ Logout-Form nicht gefunden\n";
}
} else {
echo " ❌ Layout-Datei nicht gefunden\n";
}
// 6. Test-Logout-URL erstellen
echo "\n6. 🧪 Test-Logout-URL erstellen...\n";
$testUrl = 'https://neonail.vogt.de.com/logout';
echo " 🔗 Test-URL: $testUrl\n";
echo " 📋 Methode: POST\n";
echo " 📋 CSRF-Token erforderlich\n";
// 7. Einfacher Test
echo "\n7. 🧪 Einfacher Test...\n";
echo " 📋 Öffnen Sie: https://neonail.vogt.de.com\n";
echo " 📋 Melden Sie sich an\n";
echo " 📋 Klicken Sie auf Ihren Benutzernamen\n";
echo " 📋 Wählen Sie 'Abmelden'\n";
echo " 📋 Falls Fehler: Öffnen Sie Browser-Entwicklertools (F12)\n";
echo " 📋 Gehen Sie zu Network-Tab\n";
echo " 📋 Schauen Sie welche URL aufgerufen wird\n";
echo "\n✅ Logout-Route Fix abgeschlossen!\n";
echo "🔗 Testen Sie jetzt das Logout und teilen Sie mit:\n";
echo "1. Funktioniert das Logout?\n";
echo "2. Falls nicht: Welche URL wird im Network-Tab angezeigt?\n";
echo "3. Gibt es Fehlermeldungen in der Browser-Konsole?\n";
?>