dadasd
This commit is contained in:
@@ -5,12 +5,26 @@ declare(strict_types=1);
|
||||
require_once dirname(__DIR__, 3) . '/src/App/bootstrap.php';
|
||||
|
||||
use App\ConfigLoader;
|
||||
use App\AccountGate;
|
||||
use App\RegistrationService;
|
||||
|
||||
session_start();
|
||||
|
||||
$projectRoot = dirname(__DIR__, 3);
|
||||
$accountGate = new AccountGate(ConfigLoader::load($projectRoot, 'registration'));
|
||||
$registration = new RegistrationService($projectRoot, ConfigLoader::load($projectRoot, 'registration'));
|
||||
|
||||
if (isset($_SESSION['desktop_auth']) && is_array($_SESSION['desktop_auth'])) {
|
||||
$currentAuthUser = is_array($_SESSION['desktop_auth']['user'] ?? null) ? $_SESSION['desktop_auth']['user'] : [];
|
||||
$accountCheck = $accountGate->checkUsername((string) ($currentAuthUser['username'] ?? ''));
|
||||
|
||||
if (!($accountCheck['allowed'] ?? false)) {
|
||||
unset($_SESSION['desktop_auth']);
|
||||
header('Location: /auth/inactive/?message=' . urlencode((string) ($accountCheck['message'] ?? 'Dieses Konto ist noch nicht freigeschaltet.')), true, 302);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$currentUser = is_array($_SESSION['desktop_auth']['user'] ?? null) ? $_SESSION['desktop_auth']['user'] : [];
|
||||
$currentGroups = array_map(static fn (string $group): string => strtolower(trim($group, '/')), array_values(array_map('strval', (array) ($currentUser['groups'] ?? []))));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user