Main update
This commit is contained in:
@@ -134,6 +134,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$pendingRequests = $registration->pendingApprovals();
|
||||
$availableGroups = $registration->availableGroups();
|
||||
$existingUsers = $registration->searchExistingUsers('', 250);
|
||||
$selectedExistingUser = null;
|
||||
if ($manualUsername !== '') {
|
||||
foreach ($existingUsers as $existingUser) {
|
||||
if (strtolower((string) ($existingUser['username'] ?? '')) === strtolower($manualUsername)) {
|
||||
$selectedExistingUser = $existingUser;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$selected = $selectedId !== ''
|
||||
? $registration->find($selectedId)
|
||||
: ($pendingRequests[0] ?? null);
|
||||
@@ -348,17 +357,22 @@ ob_start();
|
||||
|
||||
<fieldset class="um-fieldset">
|
||||
<legend>Gruppen fuer Aktivierung</legend>
|
||||
<div class="um-checkbox-grid">
|
||||
<?php foreach ($availableGroups as $group): ?>
|
||||
<label class="window-app-item um-checkbox-item">
|
||||
<input type="checkbox" name="manual_group_dns[]" value="<?= $h((string) ($group['dn'] ?? '')) ?>">
|
||||
<span class="window-app-item-main">
|
||||
<strong><?= $h((string) ($group['label'] ?? '')) ?></strong>
|
||||
<p><?= $h((string) ($group['dn'] ?? '')) ?></p>
|
||||
</span>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="um-checkbox-grid">
|
||||
<?php foreach ($availableGroups as $group): ?>
|
||||
<?php
|
||||
$groupDn = (string) ($group['dn'] ?? '');
|
||||
$selectedGroupDns = array_values(array_map('strval', (array) ($selectedExistingUser['group_dns'] ?? [])));
|
||||
$isChecked = in_array($groupDn, $selectedGroupDns, true);
|
||||
?>
|
||||
<label class="window-app-item um-checkbox-item">
|
||||
<input type="checkbox" name="manual_group_dns[]" value="<?= $h($groupDn) ?>" <?= $isChecked ? 'checked' : '' ?>>
|
||||
<span class="window-app-item-main">
|
||||
<strong><?= $h((string) ($group['label'] ?? '')) ?></strong>
|
||||
<p><?= $h($groupDn) ?></p>
|
||||
</span>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="um-actions">
|
||||
|
||||
Reference in New Issue
Block a user