40 lines
970 B
PHP
40 lines
970 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once dirname(__DIR__) . '/src/App/bootstrap.php';
|
|
|
|
use App\App;
|
|
use App\ConfigLoader;
|
|
use App\KeycloakAuth;
|
|
|
|
session_start();
|
|
|
|
$projectRoot = dirname(__DIR__);
|
|
$keycloakConfig = ConfigLoader::load($projectRoot, 'keycloak');
|
|
$auth = new KeycloakAuth($keycloakConfig);
|
|
|
|
if (!$auth->shouldShowDesktop()) {
|
|
$previewUrl = null;
|
|
|
|
if ($auth->allowDesktopPreview()) {
|
|
$previewUrl = '/?' . urlencode($auth->previewQueryKey()) . '=1';
|
|
}
|
|
|
|
$loginScreen = [
|
|
'branding' => $auth->branding(),
|
|
'login_url' => $auth->isConfigured() ? '/auth/keycloak' : null,
|
|
'preview_url' => $previewUrl,
|
|
'keycloak_ready' => $auth->isConfigured(),
|
|
'callback_url' => $auth->redirectUri(),
|
|
];
|
|
|
|
require $projectRoot . '/partials/auth/login_screen.php';
|
|
exit;
|
|
}
|
|
|
|
$app = new App($projectRoot);
|
|
$desktopPayload = $app->desktopPayload();
|
|
|
|
require $projectRoot . '/partials/desktop/shell.php';
|