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

111 lines
4.0 KiB
PHP
Raw Permalink 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-Problem final beheben
echo "🔧 Fix: Logout-Problem final beheben\n";
echo "===================================\n\n";
// 1. Layout korrigieren
echo "1. 🎨 Layout korrigieren...\n";
$layoutPath = 'resources/views/layouts/app.blade.php';
if (file_exists($layoutPath)) {
$content = file_get_contents($layoutPath);
// Ersetze hardcodierte Logout-URL
$oldAction = 'action="https://neonail.vogt.de.com/logout"';
$newAction = 'action="{{ route("logout") }}"';
if (strpos($content, $oldAction) !== false) {
$content = str_replace($oldAction, $newAction, $content);
file_put_contents($layoutPath, $content);
echo " ✅ Hardcodierte URL ersetzt: $oldAction$newAction\n";
} else {
echo " Keine hardcodierte URL gefunden\n";
}
// Prüfe ob die Korrektur erfolgreich war
if (strpos($content, '{{ route("logout") }}') !== false) {
echo " ✅ Laravel Route wird verwendet\n";
} else {
echo " ❌ Laravel Route wird nicht verwendet\n";
}
} else {
echo " ❌ Layout-Datei nicht gefunden\n";
}
// 2. Cache leeren
echo "\n2. 🧹 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 " ✅ Cache geleert\n";
// 3. Layout nochmal prüfen
echo "\n3. 🎨 Layout final prüfen...\n";
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";
}
// 4. JavaScript prüfen
echo "\n4. 🔧 JavaScript prüfen...\n";
if (file_exists($layoutPath)) {
$content = file_get_contents($layoutPath);
// Suche nach onclick Event
if (strpos($content, 'onclick="event.preventDefault(); document.getElementById("logout-form").submit();"') !== false) {
echo " ✅ JavaScript Event Handler gefunden\n";
} else {
echo " ❌ JavaScript Event Handler nicht gefunden\n";
}
// Suche nach Bootstrap JS
if (strpos($content, 'bootstrap.bundle.min.js') !== false) {
echo " ✅ Bootstrap JS geladen\n";
} else {
echo " ❌ Bootstrap JS nicht geladen\n";
}
} else {
echo " ❌ Layout-Datei nicht gefunden\n";
}
// 5. Test-Anleitung
echo "\n5. 🧪 Test-Anleitung...\n";
echo " 📋 1. Öffnen Sie: https://neonail.vogt.de.com\n";
echo " 📋 2. Melden Sie sich an\n";
echo " 📋 3. Klicken Sie auf Ihren Benutzernamen (oben rechts)\n";
echo " 📋 4. Wählen Sie 'Abmelden' aus dem Dropdown\n";
echo " 📋 5. Sie sollten zur Login-Seite weitergeleitet werden\n";
echo "\n 🔍 Falls Problem besteht:\n";
echo " 📋 - Öffnen Sie Browser-Entwicklertools (F12)\n";
echo " 📋 - Gehen Sie zu Console-Tab\n";
echo " 📋 - Klicken Sie auf Abmelden\n";
echo " 📋 - Schauen Sie nach JavaScript-Fehlern\n";
echo " 📋 - Gehen Sie zu Network-Tab\n";
echo " 📋 - Schauen Sie welche URL aufgerufen wird\n";
echo "\n✅ Logout-Problem final behoben!\n";
echo "🔗 Testen Sie jetzt das Logout und teilen Sie mit:\n";
echo "1. Funktioniert das Logout jetzt?\n";
echo "2. Werden Sie zur Login-Seite weitergeleitet?\n";
echo "3. Falls nicht: Welche Fehlermeldungen sehen Sie?\n";
?>