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

This commit is contained in:
2026-06-26 01:31:48 +02:00
parent 40b3ef45d0
commit 8c1ae513ea
14 changed files with 367 additions and 184 deletions

View File

@@ -231,6 +231,81 @@
border-radius: 14px;
}
#admin-apps-app .aa-inline-access-form {
display: grid;
gap: 8px;
min-width: 220px;
}
#admin-apps-app .aa-inline-access-current {
margin: 0;
font-size: 14px;
line-height: 1.5;
color: #0f172a;
}
#admin-apps-app .aa-inline-access-toggle {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
gap: 8px;
align-items: start;
font-size: 13px;
line-height: 1.45;
color: #334155;
}
#admin-apps-app .aa-inline-access-toggle input {
margin-top: 3px;
}
#admin-apps-app .aa-inline-access-details {
display: grid;
gap: 10px;
}
#admin-apps-app .aa-inline-access-details summary {
cursor: pointer;
font-size: 13px;
font-weight: 700;
color: #1d4ed8;
}
#admin-apps-app .aa-inline-access-groups {
display: grid;
gap: 8px;
margin-top: 2px;
}
#admin-apps-app .aa-inline-access-option {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
gap: 8px;
align-items: start;
padding: 8px 10px;
border: 1px solid rgba(148, 163, 184, 0.22);
border-radius: 12px;
background: rgba(255, 255, 255, 0.92);
}
#admin-apps-app .aa-inline-access-option input {
margin-top: 3px;
}
#admin-apps-app .aa-inline-access-option strong,
#admin-apps-app .aa-inline-access-option small {
display: block;
}
#admin-apps-app .aa-inline-access-option small {
margin-top: 3px;
font-size: 12px;
color: #64748b;
}
#admin-apps-app .aa-inline-access-submit {
justify-self: start;
}
#admin-apps-app .aa-message.is-success {
background: rgba(34, 197, 94, 0.12);
color: #166534;

View File

@@ -53,7 +53,7 @@ $service = new AdminAppsService($projectRoot);
$messages = [];
$errors = [];
$section = trim((string) ($_GET['section'] ?? $_POST['active_section'] ?? 'overview'));
$allowedSections = ['overview', 'installation', 'access', 'widgets', 'integrations'];
$allowedSections = ['overview', 'installation', 'widgets', 'integrations'];
if (!in_array($section, $allowedSections, true)) {
$section = 'overview';
}
@@ -81,10 +81,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
} elseif ($action === 'save-app-access') {
$service->saveAppAccess(
(string) ($_POST['app_id'] ?? ''),
array_values(array_map('strval', (array) ($_POST['required_groups'] ?? [])))
array_values(array_map('strval', (array) ($_POST['required_groups'] ?? []))),
!empty($_POST['available_without_login'])
);
$messages[] = 'LDAP-Gruppen fuer die App wurden gespeichert.';
$section = 'access';
$section = 'overview';
}
} catch (\Throwable $exception) {
$errors[] = $exception->getMessage();
@@ -117,12 +118,6 @@ $sectionMeta = [
'description' => 'Installierbare Fach-Apps liegen unter custom/apps/. Upload- und Importwege werden hier als naechster Ausbauschritt vorbereitet.',
'nav' => 'ZIP-, Verzeichnis- und Server-Workflow beschreiben.',
],
'access' => [
'label' => 'Berechtigungen',
'title' => 'LDAP-Gruppen pro App',
'description' => 'Admins steuern hier, welche LDAP-Gruppen eine App benutzen duerfen. Leere Auswahl bedeutet: fuer alle sichtbaren Benutzer.',
'nav' => 'LDAP-Gruppen verwalten.',
],
'widgets' => [
'label' => 'Widgets',
'title' => 'Widgets und Quellen',
@@ -264,7 +259,50 @@ ob_start();
</td>
<td><?= $h((string) ($app['app_scope'] ?? '')) ?></td>
<td><?= $h(!empty($app['installable']) ? 'Custom App' : 'System') ?></td>
<td><?= $h((string) ($app['required_groups_display'] ?? '')) ?></td>
<td>
<form class="aa-inline-access-form" method="post" action="/admin/apps/">
<input type="hidden" name="csrf_token" value="<?= $h($csrfToken) ?>">
<input type="hidden" name="action" value="save-app-access">
<input type="hidden" name="active_section" value="overview">
<input type="hidden" name="app_id" value="<?= $h((string) ($app['app_id'] ?? '')) ?>">
<p class="aa-inline-access-current"><?= $h((string) ($app['required_groups_display'] ?? '')) ?></p>
<label class="aa-inline-access-toggle">
<input
type="checkbox"
name="available_without_login"
value="1"
<?= !empty($app['available_without_login']) ? 'checked' : '' ?>
>
<span>Auch ohne Login auf dem Logoff-Desktop anzeigen</span>
</label>
<?php if ($availableGroups !== []): ?>
<details class="aa-inline-access-details">
<summary>Bearbeiten</summary>
<div class="aa-inline-access-groups">
<?php foreach ($availableGroups as $group): ?>
<label class="aa-inline-access-option">
<input
type="checkbox"
name="required_groups[]"
value="<?= $h((string) ($group['id'] ?? '')) ?>"
<?= in_array((string) ($group['id'] ?? ''), array_values(array_map('strval', (array) ($app['required_groups'] ?? []))), true) ? 'checked' : '' ?>
>
<span>
<strong><?= $h((string) ($group['label'] ?? '')) ?></strong>
<small><?= $h((string) ($group['id'] ?? '')) ?></small>
</span>
</label>
<?php endforeach; ?>
</div>
<button class="window-app-button aa-primary aa-inline-access-submit" type="submit">Speichern</button>
</details>
<?php else: ?>
<p class="aa-table-copy">Keine LDAP-Gruppen gefunden.</p>
<?php endif; ?>
</form>
</td>
<td><code><?= $h((string) ($app['entry_route'] ?? '')) ?></code></td>
<td>
<div class="aa-flag-list">
@@ -272,6 +310,7 @@ ob_start();
<?php if (!empty($app['supports_widget'])): ?><span class="window-app-pill">Widget</span><?php endif; ?>
<?php if (!empty($app['supports_tray'])): ?><span class="window-app-pill">Tray</span><?php endif; ?>
<?php if (!empty($app['enabled_by_default'])): ?><span class="window-app-pill">Default</span><?php endif; ?>
<?php if (!empty($app['available_without_login'])): ?><span class="window-app-pill">Logoff Desktop</span><?php endif; ?>
<?php if (!empty($app['admin_only'])): ?><span class="window-app-pill">Admin only</span><?php endif; ?>
</div>
</td>
@@ -291,6 +330,17 @@ ob_start();
</div>
</div>
</section>
<section class="window-app-card aa-card">
<div class="aa-section-head">
<div>
<p class="window-app-kicker aa-kicker">Flags</p>
<h3 class="aa-section-title">Bedeutung der Flags</h3>
<p class="aa-copy"><strong>Default</strong> bedeutet: Die App wird fuer neue Benutzer oder fuer Benutzer ohne explizite Auswahl initial vorausgewaehlt. <strong>Logoff Desktop</strong> bedeutet: Die App darf bereits ohne Login auf der offenen Desktop-Oberflaeche erscheinen, sofern sie als Desktop-App darstellbar ist.</p>
<p class="aa-copy">Gespeichert wird in <?= $h((string) ($meta['app_access_config_path'] ?? '')) ?>. Dort liegen sowohl LDAP-Gruppen als auch die Freigabe fuer den offenen Desktop.</p>
</div>
</div>
</section>
<?php endif; ?>
<?php if ($section === 'installation'): ?>
@@ -331,60 +381,6 @@ ob_start();
</section>
<?php endif; ?>
<?php if ($section === 'access'): ?>
<section class="window-app-card aa-card">
<div class="aa-section-head">
<div>
<p class="window-app-kicker aa-kicker">Access Control</p>
<h3 class="aa-section-title">LDAP-Gruppen pro App</h3>
<p class="aa-copy">Gespeichert wird in <?= $h((string) ($meta['app_access_config_path'] ?? '')) ?>. Die kurzen Gruppennamen entsprechen den LDAP-/Auth-Gruppen im Desktop.</p>
</div>
</div>
<div class="aa-grid">
<?php foreach ($apps as $app): ?>
<form class="window-app-card aa-card aa-access-card" method="post" action="/admin/apps/">
<input type="hidden" name="csrf_token" value="<?= $h($csrfToken) ?>">
<input type="hidden" name="action" value="save-app-access">
<input type="hidden" name="active_section" value="access">
<input type="hidden" name="app_id" value="<?= $h((string) ($app['app_id'] ?? '')) ?>">
<div>
<strong><?= $h((string) ($app['title'] ?? '')) ?></strong>
<p class="aa-table-copy"><?= $h((string) ($app['summary'] ?? '')) ?></p>
<p class="aa-table-copy">Aktuell: <?= $h((string) ($app['required_groups_display'] ?? '')) ?></p>
</div>
<div class="aa-access-groups">
<?php if ($availableGroups === []): ?>
<p class="aa-copy">Keine LDAP-Gruppen aus der Registration-Konfiguration gefunden.</p>
<?php else: ?>
<?php foreach ($availableGroups as $group): ?>
<label class="window-app-item aa-group-item">
<input
type="checkbox"
name="required_groups[]"
value="<?= $h((string) ($group['id'] ?? '')) ?>"
<?= in_array((string) ($group['id'] ?? ''), array_values(array_map('strval', (array) ($app['required_groups'] ?? []))), true) ? 'checked' : '' ?>
>
<span class="window-app-item-main aa-group-main">
<strong><?= $h((string) ($group['label'] ?? '')) ?></strong>
<span class="aa-meta"><?= $h((string) ($group['id'] ?? '')) ?></span>
</span>
</label>
<?php endforeach; ?>
<?php endif; ?>
</div>
<div class="aa-actions">
<button class="window-app-button aa-primary" type="submit">Berechtigungen speichern</button>
</div>
</form>
<?php endforeach; ?>
</div>
</section>
<?php endif; ?>
<?php if ($section === 'widgets'): ?>
<section class="window-app-card aa-card">
<div class="aa-section-head">