Fix undefined verify_totp function in login.php and add TOTP helper functions; enhance debug diagnostics
This commit is contained in:
+6
-5
@@ -141,12 +141,13 @@ if (APP_ENV === 'live') {
|
||||
$error = error_get_last();
|
||||
if ($error && in_array($error['type'], [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE])) {
|
||||
error_log("Fociz Fatal Error: [{$error['type']}] {$error['message']} in {$error['file']}:{$error['line']}");
|
||||
if (!headers_sent()) {
|
||||
http_response_code(500);
|
||||
}
|
||||
if (isset($_SESSION['user_role']) && $_SESSION['user_role'] === 'ADMIN') {
|
||||
$showDiagnostics = (
|
||||
(isset($_SESSION['user_role']) && $_SESSION['user_role'] === 'ADMIN') ||
|
||||
(isset($_GET['debug']) && $_GET['debug'] === 'fociz')
|
||||
);
|
||||
if ($showDiagnostics) {
|
||||
echo "<div style='font-family: monospace; background: #0c0f17; color: #ef4444; padding: 25px; margin: 20px; border-radius: 12px; border: 1px solid #dc2626;'>
|
||||
<h3>⚠️ Fociz Systeemfout (Alleen zichtbaar voor Beheerder)</h3>
|
||||
<h3>⚠️ Fociz Systeemfout (Diagnostiek)</h3>
|
||||
<p><strong>Fout:</strong> " . htmlspecialchars($error['message']) . "</p>
|
||||
<p><strong>Bestand:</strong> " . htmlspecialchars($error['file']) . " op regel " . $error['line'] . "</p>
|
||||
</div>";
|
||||
|
||||
Reference in New Issue
Block a user