update
All checks were successful
Deploy / deploy-staging (push) Successful in 47s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-15 02:38:41 +02:00
parent 46d1e624b9
commit 823c5d197d
10 changed files with 23 additions and 47 deletions

View File

@@ -74,7 +74,7 @@ return [
'app_id' => 'desktop-login', 'app_id' => 'desktop-login',
'title' => 'Desktop Login', 'title' => 'Desktop Login',
'icon' => 'DL', 'icon' => 'DL',
'entry_route' => '/auth/login', 'entry_route' => '/auth/keycloak',
'window_mode' => 'modal', 'window_mode' => 'modal',
'default_width' => 460, 'default_width' => 460,
'default_height' => 320, 'default_height' => 320,

View File

@@ -1,3 +1,6 @@
<?php <?php
declare(strict_types=1);
http_response_code(404); http_response_code(404);
echo 'LDAP-Test ist deaktiviert.'; exit;

View File

@@ -13,7 +13,7 @@ $projectRoot = dirname(__DIR__, 3);
$auth = new KeycloakAuth(ConfigLoader::load($projectRoot, 'keycloak')); $auth = new KeycloakAuth(ConfigLoader::load($projectRoot, 'keycloak'));
if (!$auth->shouldShowDesktop()) { if (!$auth->shouldShowDesktop()) {
header('Location: /auth/login', true, 302); header('Location: /auth/keycloak', true, 302);
exit; exit;
} }

View File

@@ -74,7 +74,7 @@ if ($state === '' || $expectedState === '' || !hash_equals($expectedState, $stat
<p class="login-copy"><?= htmlspecialchars($message, ENT_QUOTES) ?></p> <p class="login-copy"><?= htmlspecialchars($message, ENT_QUOTES) ?></p>
</div> </div>
<div class="login-actions"> <div class="login-actions">
<a class="login-button login-button-secondary" href="/auth/login">Zurueck zum Login</a> <a class="login-button login-button-secondary" href="/auth/keycloak">Zurueck zum Login</a>
</div> </div>
</section> </section>
</main> </main>

View File

@@ -57,7 +57,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<div class="login-actions"> <div class="login-actions">
<button class="login-button login-button-primary" type="submit">Reset-Link senden</button> <button class="login-button login-button-primary" type="submit">Reset-Link senden</button>
<a class="login-button login-button-secondary" href="/auth/login">Zurück zum Login</a> <a class="login-button login-button-secondary" href="/auth/keycloak">Zurück zum Login</a>
</div> </div>
</form> </form>
</section> </section>

View File

@@ -14,7 +14,8 @@ $auth = new KeycloakAuth(ConfigLoader::load($projectRoot, 'keycloak'));
$loginUrl = $auth->loginUrl(); $loginUrl = $auth->loginUrl();
if ($loginUrl === null) { if ($loginUrl === null) {
header('Location: /auth/login'); http_response_code(503);
echo 'Keycloak ist nicht konfiguriert.';
exit; exit;
} }

View File

@@ -11,18 +11,11 @@ session_start();
$projectRoot = dirname(__DIR__, 3); $projectRoot = dirname(__DIR__, 3);
$auth = new KeycloakAuth(ConfigLoader::load($projectRoot, 'keycloak')); $auth = new KeycloakAuth(ConfigLoader::load($projectRoot, 'keycloak'));
$previewUrl = $auth->allowDesktopPreview()
? '/?' . urlencode($auth->previewQueryKey()) . '=1'
: null;
$loginScreen = [ if ($auth->isConfigured()) {
'branding' => $auth->branding(), header('Location: /auth/keycloak', true, 302);
'login_url' => $auth->isConfigured() ? '/auth/keycloak' : null, exit;
'register_url' => '/auth/register', }
'forgot_password_url' => '/auth/forgot-password/',
'preview_url' => $previewUrl,
'keycloak_ready' => $auth->isConfigured(),
'callback_url' => $auth->redirectUri(),
];
require $projectRoot . '/partials/auth/login_screen.php'; http_response_code(503);
echo 'Keycloak ist nicht konfiguriert.';

View File

@@ -24,5 +24,5 @@ if ($logoutUrl !== null) {
exit; exit;
} }
header('Location: /auth/login', true, 302); header('Location: /auth/keycloak', true, 302);
exit; exit;

View File

@@ -33,7 +33,6 @@ $form = [
'given_name' => '', 'given_name' => '',
'family_name' => '', 'family_name' => '',
'email' => '', 'email' => '',
'note' => '',
'password' => '', 'password' => '',
'password_confirm' => '', 'password_confirm' => '',
]; ];
@@ -44,7 +43,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
'given_name' => trim((string) ($_POST['given_name'] ?? '')), 'given_name' => trim((string) ($_POST['given_name'] ?? '')),
'family_name' => trim((string) ($_POST['family_name'] ?? '')), 'family_name' => trim((string) ($_POST['family_name'] ?? '')),
'email' => trim((string) ($_POST['email'] ?? '')), 'email' => trim((string) ($_POST['email'] ?? '')),
'note' => trim((string) ($_POST['note'] ?? '')),
'password' => (string) ($_POST['password'] ?? ''), 'password' => (string) ($_POST['password'] ?? ''),
'password_confirm' => (string) ($_POST['password_confirm'] ?? ''), 'password_confirm' => (string) ($_POST['password_confirm'] ?? ''),
]; ];
@@ -68,7 +66,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
'given_name' => '', 'given_name' => '',
'family_name' => '', 'family_name' => '',
'email' => '', 'email' => '',
'note' => '',
'password' => '', 'password' => '',
'password_confirm' => '', 'password_confirm' => '',
]; ];
@@ -138,11 +135,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</label> </label>
</div> </div>
<label class="login-field">
<span>Zusätzliche Info</span>
<textarea name="note" rows="5" placeholder="Optional: Bezug zur Familie, Einladung, gewünschte Nutzung, Rückfragekontakt"><?= htmlspecialchars($form['note'], ENT_QUOTES) ?></textarea>
</label>
<div class="login-form-grid"> <div class="login-form-grid">
<label class="login-field"> <label class="login-field">
<span>Passwort</span> <span>Passwort</span>
@@ -155,14 +147,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</label> </label>
</div> </div>
<div class="login-notice login-notice-info">
<strong>Wichtig</strong>
<p>Das Passwort wird verschlüsselt zwischengespeichert und bei Freigabe direkt für LDAP und SMB gesetzt. Neue Registrierungen erhalten zunächst trotzdem keinen aktiven Desktop-Zugang.</p>
</div>
<div class="login-actions"> <div class="login-actions">
<button class="login-button login-button-primary" type="submit">Registrierung absenden</button> <button class="login-button login-button-primary" type="submit">Registrierung absenden</button>
<a class="login-button login-button-secondary" href="/auth/login">Zurück zum Login</a> <a class="login-button login-button-secondary" href="/auth/keycloak">Zurück zum Login</a>
</div> </div>
</form> </form>
</section> </section>

View File

@@ -15,21 +15,13 @@ $keycloakConfig = ConfigLoader::load($projectRoot, 'keycloak');
$auth = new KeycloakAuth($keycloakConfig); $auth = new KeycloakAuth($keycloakConfig);
if (!$auth->shouldShowDesktop()) { if (!$auth->shouldShowDesktop()) {
$previewUrl = null; if ($auth->isConfigured()) {
header('Location: /auth/keycloak', true, 302);
if ($auth->allowDesktopPreview()) { exit;
$previewUrl = '/?' . urlencode($auth->previewQueryKey()) . '=1';
} }
$loginScreen = [ http_response_code(503);
'branding' => $auth->branding(), echo 'Keycloak ist nicht konfiguriert.';
'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; exit;
} }