volt-newsroom-scraper-report/web/test-index.php
DJP 2bdc5e1549 Add MAMP-friendly simplified interface
- Created index-simple.php (better for MAMP buffering)
- Created generate-simple.php (waits for completion, no streaming)
- Shows loading spinner instead of trying to stream output
- Works perfectly with MAMP's output buffering
- Added test pages for debugging
- Use index-simple.php for MAMP, index.php for production Apache
2026-01-06 14:07:39 -05:00

41 lines
1.2 KiB
PHP

<?php
/**
* Test version of index.php to debug loading issues
*/
error_reporting(E_ALL);
ini_set('display_errors', 1);
echo "Loading config...<br>";
require_once __DIR__ . '/config.php';
echo "✓ Config loaded<br>";
echo "Loading AuthMiddleware...<br>";
require_once __DIR__ . '/AuthMiddleware.php';
echo "✓ AuthMiddleware loaded<br>";
echo "Creating AuthMiddleware instance...<br>";
$auth = new AuthMiddleware();
echo "✓ AuthMiddleware instance created<br>";
echo "SSO Enabled: " . ($auth->isSSOEnabled() ? 'Yes' : 'No') . "<br>";
if (!$auth->isSSOEnabled()) {
echo "SSO is disabled - proceeding without authentication<br>";
$user = [
'name' => 'Local Developer',
'preferred_username' => 'dev@localhost'
];
} else {
echo "Checking authentication...<br>";
$user = $auth->requireAuth();
echo "✓ User authenticated<br>";
}
echo "<br>User info:<br>";
echo "Name: " . htmlspecialchars($user['name'] ?? 'Unknown') . "<br>";
echo "Email: " . htmlspecialchars($user['preferred_username'] ?? $user['upn'] ?? 'Unknown') . "<br>";
echo "<br><strong>✓ All checks passed!</strong><br>";
echo "<br><a href='index.php'>Try loading full index.php</a>";
?>