Restore getUserMemberStatus function to original implementation and fix database queries

This commit is contained in:
twotalesanimation
2025-12-03 10:45:13 +02:00
parent c13c77aac4
commit 204462877c
58 changed files with 3204 additions and 89 deletions

15
env.php
View File

@@ -4,6 +4,21 @@ require_once __DIR__ . '/vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
// Normalize HTTPS detection behind proxies and based on HOST env
// If behind a reverse proxy, X-Forwarded-Proto may indicate HTTPS
$forwardedProto = isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ? strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) : null;
$hostEnv = $_ENV['HOST'] ?? null;
// If HOST env is set and starts with https, treat as secure
if (is_string($hostEnv) && stripos($hostEnv, 'https://') === 0) {
$_SERVER['HTTPS'] = 'on';
}
// If proxy indicates https, treat connection as secure
if ($forwardedProto === 'https') {
$_SERVER['HTTPS'] = 'on';
}
// PSR-4 Autoloader for Services and Controllers
spl_autoload_register(function ($class) {
// Remove leading namespace separator