$log_paths = ['auth_debug.log', 'php/auth_debug.log']; if (isset($_GET['clear'])) { foreach ($log_paths as $path) { if (file_exists($path)) @file_put_contents($path, ""); } header('Location: check_auth_log.php'); exit; } header('Content-Type: text/plain'); echo "--- GRID AUTH LOGS ---\n"; echo "Visit ?clear=1 to reset logs.\n\n"; $found = false; foreach ($log_paths as $path) { if (file_exists($path)) { echo "LOG FOUND AT [$path]:\n"; echo file_get_contents($path); echo "\n-------------------\n"; $found = true; } } if (!$found) { echo "No log files found in root or php/ directory.\n"; echo "Potential causes:\n"; echo "1. No login attempts made yet.\n"; echo "2. Permission denied (check if script can write to root directory).\n"; echo "3. auth.php is not being reached by the form.\n"; } echo "\n--- SYSTEM CHECK ---\n"; echo "Current File: " . __FILE__ . "\n"; echo "Dir Writeable: " . (is_writable('.') ? 'YES' : 'NO') . "\n"; ?>