refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use MintyPHP\Buffer;
|
|
|
|
|
use MintyPHP\Http\SessionStoreInterface;
|
|
|
|
|
use MintyPHP\Router;
|
|
|
|
|
use MintyPHP\Service\Access\SettingsAuthorizationPolicy;
|
feat(user-lifecycle): cockpit foundation — KPI row + aside quick actions
Phase 1 of the Stripe-style policy-cockpit redesign for the user-lifecycle
settings page. Pure server-rendering — no async, no JS components, no
sparklines yet (those land in later phases).
Adds a four-tile KPI row above the configuration form (Last run,
Deactivated/30d, Deleted/30d, Pending deletion/7d), populates the
previously empty aside with three quick actions (Run policy now,
Purge logs, Policy reference link), and surfaces a relative-time +
status hint under the existing Run-Now collapsible.
Module-isolation is preserved through a new read-side contract:
* core/Service/Audit/UserLifecycleAuditDashboardInterface — read-only
pendant to the existing write-side UserLifecycleAuditInterface.
Methods: lastRun(), summaryByAction(int days), countActionInWindow(...).
* core/Service/Audit/NullUserLifecycleAuditDashboard — fail-closed
default when the audit module is disabled. KPI tiles 1-3 then
render "—"; tile 4 (pending deletion) keeps working because it
lives in the core domain.
* modules/audit/.../Service/UserLifecycleAuditDashboardService — the
module's implementation; reads through the existing
UserLifecycleAuditRepository (extended with three new aggregation
queries: lastRun, countByActionStatusSinceTimestamp, countSinceTimestamp).
* AuditContainerRegistrar binds the interface to the module impl;
registerContainer.php registers the Null fallback before module
bindings, mirroring how the write-side audit interface is wired.
The new core service UserLifecyclePolicyDashboardService computes
the pending-deletion-window count from the users table directly
(no audit dependency) — defensive when both policy days are 0
(returns 0 rather than running an unbounded query).
New shared template partial templates/partials/app-kpi-row.phtml is
generic — accepts a $kpiTiles array of {label, count, icon, iconTone,
href, tooltip} and reuses the existing app-tile primitive. Other
settings pages can pick it up without ceremony.
Includes:
* PHPUnit tests for both new services (happy path + Null-fallback +
policy-disabled edge cases).
* AuditModuleIsolationContractTest allowlist extended for the new
interface and module service.
* 14 new translation keys in both default_de.json and default_en.json
(i18n parity verified).
All six quality gates green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 20:36:28 +02:00
|
|
|
use MintyPHP\Service\Audit\NullUserLifecycleAuditDashboard;
|
|
|
|
|
use MintyPHP\Service\Audit\UserLifecycleAuditDashboardInterface;
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
use MintyPHP\Service\Settings\AdminSettingsService;
|
feat(user-lifecycle): cockpit foundation — KPI row + aside quick actions
Phase 1 of the Stripe-style policy-cockpit redesign for the user-lifecycle
settings page. Pure server-rendering — no async, no JS components, no
sparklines yet (those land in later phases).
Adds a four-tile KPI row above the configuration form (Last run,
Deactivated/30d, Deleted/30d, Pending deletion/7d), populates the
previously empty aside with three quick actions (Run policy now,
Purge logs, Policy reference link), and surfaces a relative-time +
status hint under the existing Run-Now collapsible.
Module-isolation is preserved through a new read-side contract:
* core/Service/Audit/UserLifecycleAuditDashboardInterface — read-only
pendant to the existing write-side UserLifecycleAuditInterface.
Methods: lastRun(), summaryByAction(int days), countActionInWindow(...).
* core/Service/Audit/NullUserLifecycleAuditDashboard — fail-closed
default when the audit module is disabled. KPI tiles 1-3 then
render "—"; tile 4 (pending deletion) keeps working because it
lives in the core domain.
* modules/audit/.../Service/UserLifecycleAuditDashboardService — the
module's implementation; reads through the existing
UserLifecycleAuditRepository (extended with three new aggregation
queries: lastRun, countByActionStatusSinceTimestamp, countSinceTimestamp).
* AuditContainerRegistrar binds the interface to the module impl;
registerContainer.php registers the Null fallback before module
bindings, mirroring how the write-side audit interface is wired.
The new core service UserLifecyclePolicyDashboardService computes
the pending-deletion-window count from the users table directly
(no audit dependency) — defensive when both policy days are 0
(returns 0 rather than running an unbounded query).
New shared template partial templates/partials/app-kpi-row.phtml is
generic — accepts a $kpiTiles array of {label, count, icon, iconTone,
href, tooltip} and reuses the existing app-tile primitive. Other
settings pages can pick it up without ceremony.
Includes:
* PHPUnit tests for both new services (happy path + Null-fallback +
policy-disabled edge cases).
* AuditModuleIsolationContractTest allowlist extended for the new
interface and module service.
* 14 new translation keys in both default_de.json and default_en.json
(i18n parity verified).
All six quality gates green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 20:36:28 +02:00
|
|
|
use MintyPHP\Service\User\UserLifecyclePolicyDashboardService;
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
use MintyPHP\Support\Flash;
|
|
|
|
|
use MintyPHP\Support\Guard;
|
|
|
|
|
|
|
|
|
|
$session = app(SessionStoreInterface::class)->all();
|
|
|
|
|
Guard::requireLogin();
|
|
|
|
|
$request = requestInput();
|
|
|
|
|
|
|
|
|
|
$currentUserId = (int) ($session['user']['id'] ?? 0);
|
|
|
|
|
$authorizationService = app(\MintyPHP\Service\Access\AuthorizationService::class);
|
|
|
|
|
$viewDecision = $authorizationService->authorize(SettingsAuthorizationPolicy::ABILITY_ADMIN_SETTINGS_VIEW, [
|
|
|
|
|
'actor_user_id' => $currentUserId,
|
|
|
|
|
]);
|
|
|
|
|
if (!$viewDecision->isAllowed()) {
|
|
|
|
|
Guard::deny();
|
|
|
|
|
}
|
|
|
|
|
$viewCapabilities = $viewDecision->attribute('capabilities', []);
|
|
|
|
|
$canUpdateSettings = is_array($viewCapabilities) ? (bool) ($viewCapabilities['can_update_settings'] ?? false) : false;
|
|
|
|
|
|
|
|
|
|
$adminSettingsService = app(AdminSettingsService::class);
|
|
|
|
|
$pageData = $adminSettingsService->buildPageData();
|
|
|
|
|
$values = is_array($pageData['values'] ?? null) ? $pageData['values'] : [];
|
|
|
|
|
$settings = is_array($pageData['settings'] ?? null) ? $pageData['settings'] : [];
|
|
|
|
|
|
2026-04-25 08:50:05 +02:00
|
|
|
if ($request->isMethod('POST') && !actionRequireCsrf('admin/settings/user-lifecycle', 'admin/settings/user-lifecycle', 'csrf_expired')) {
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($request->isMethod('POST')) {
|
|
|
|
|
$updateDecision = $authorizationService->authorize(SettingsAuthorizationPolicy::ABILITY_ADMIN_SETTINGS_UPDATE, [
|
|
|
|
|
'actor_user_id' => $currentUserId,
|
|
|
|
|
]);
|
|
|
|
|
if (!$updateDecision->isAllowed()) {
|
|
|
|
|
Guard::deny();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$sectionKeys = [
|
|
|
|
|
'user_inactivity_deactivate_days',
|
|
|
|
|
'user_inactivity_delete_days',
|
|
|
|
|
];
|
|
|
|
|
$mergedPost = settingsSectionMergePost($values, $request->bodyAll(), $sectionKeys);
|
|
|
|
|
|
|
|
|
|
$updateResult = $adminSettingsService->updateFromAdmin($mergedPost);
|
|
|
|
|
$errorBag = formErrors();
|
|
|
|
|
foreach ((array) ($updateResult['errors'] ?? []) as $error) {
|
|
|
|
|
if (is_array($error)) {
|
|
|
|
|
$message = trim((string) ($error['message'] ?? ''));
|
|
|
|
|
$field = trim((string) ($error['field'] ?? 'input'));
|
|
|
|
|
if ($message !== '') {
|
|
|
|
|
$errorBag->add($field !== '' ? $field : 'input', $message);
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$message = trim((string) $error);
|
|
|
|
|
if ($message !== '') {
|
|
|
|
|
$errorBag->addGlobal($message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($errorBag->hasAny()) {
|
2026-04-25 08:50:05 +02:00
|
|
|
flashFormErrors($errorBag, 'admin/settings/user-lifecycle', 'settings_update_error');
|
|
|
|
|
Router::redirect('admin/settings/user-lifecycle');
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$redirectTarget = ((string) $request->body('action', 'save') === 'save_close')
|
|
|
|
|
? 'admin/settings'
|
2026-04-25 08:50:05 +02:00
|
|
|
: 'admin/settings/user-lifecycle';
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
Flash::success('Settings updated', $redirectTarget, 'settings_updated');
|
|
|
|
|
Router::redirect($redirectTarget);
|
|
|
|
|
}
|
|
|
|
|
|
feat(user-lifecycle): cockpit foundation — KPI row + aside quick actions
Phase 1 of the Stripe-style policy-cockpit redesign for the user-lifecycle
settings page. Pure server-rendering — no async, no JS components, no
sparklines yet (those land in later phases).
Adds a four-tile KPI row above the configuration form (Last run,
Deactivated/30d, Deleted/30d, Pending deletion/7d), populates the
previously empty aside with three quick actions (Run policy now,
Purge logs, Policy reference link), and surfaces a relative-time +
status hint under the existing Run-Now collapsible.
Module-isolation is preserved through a new read-side contract:
* core/Service/Audit/UserLifecycleAuditDashboardInterface — read-only
pendant to the existing write-side UserLifecycleAuditInterface.
Methods: lastRun(), summaryByAction(int days), countActionInWindow(...).
* core/Service/Audit/NullUserLifecycleAuditDashboard — fail-closed
default when the audit module is disabled. KPI tiles 1-3 then
render "—"; tile 4 (pending deletion) keeps working because it
lives in the core domain.
* modules/audit/.../Service/UserLifecycleAuditDashboardService — the
module's implementation; reads through the existing
UserLifecycleAuditRepository (extended with three new aggregation
queries: lastRun, countByActionStatusSinceTimestamp, countSinceTimestamp).
* AuditContainerRegistrar binds the interface to the module impl;
registerContainer.php registers the Null fallback before module
bindings, mirroring how the write-side audit interface is wired.
The new core service UserLifecyclePolicyDashboardService computes
the pending-deletion-window count from the users table directly
(no audit dependency) — defensive when both policy days are 0
(returns 0 rather than running an unbounded query).
New shared template partial templates/partials/app-kpi-row.phtml is
generic — accepts a $kpiTiles array of {label, count, icon, iconTone,
href, tooltip} and reuses the existing app-tile primitive. Other
settings pages can pick it up without ceremony.
Includes:
* PHPUnit tests for both new services (happy path + Null-fallback +
policy-disabled edge cases).
* AuditModuleIsolationContractTest allowlist extended for the new
interface and module service.
* 14 new translation keys in both default_de.json and default_en.json
(i18n parity verified).
All six quality gates green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 20:36:28 +02:00
|
|
|
// ── KPI cockpit data (server-rendered, no async) ─────────────────────
|
|
|
|
|
$deactivateDays = (int) ($values['user_inactivity_deactivate_days'] ?? 0);
|
|
|
|
|
$deleteDays = (int) ($values['user_inactivity_delete_days'] ?? 0);
|
|
|
|
|
|
|
|
|
|
$dashboardService = app(UserLifecyclePolicyDashboardService::class);
|
|
|
|
|
$auditDashboard = app(UserLifecycleAuditDashboardInterface::class);
|
|
|
|
|
$auditDashboardActive = !($auditDashboard instanceof NullUserLifecycleAuditDashboard);
|
|
|
|
|
|
|
|
|
|
$lastRun = $auditDashboard->lastRun();
|
|
|
|
|
$summary = $auditDashboard->summaryByAction(30);
|
|
|
|
|
$pendingCount = $dashboardService->pendingDeletionCount($deactivateDays, $deleteDays, 7);
|
|
|
|
|
|
|
|
|
|
$lastRunAt = $lastRun !== null ? (string) ($lastRun['created_at'] ?? '') : null;
|
|
|
|
|
$lastRunStatus = $lastRun !== null ? (string) ($lastRun['status'] ?? '') : null;
|
|
|
|
|
if ($lastRunAt !== null && $lastRunAt === '') {
|
|
|
|
|
$lastRunAt = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Build relative-time + status suffix for the Run-Now <details> summary line and the KPI tile.
|
|
|
|
|
$lastRunRelative = '—';
|
|
|
|
|
$lastRunStatusLabel = '';
|
|
|
|
|
if ($lastRunAt !== null) {
|
|
|
|
|
try {
|
|
|
|
|
$createdUtc = (new \DateTimeImmutable($lastRunAt, new \DateTimeZone('UTC')))->getTimestamp();
|
|
|
|
|
$diffDays = (int) floor((time() - $createdUtc) / 86400);
|
|
|
|
|
if ($diffDays <= 0) {
|
|
|
|
|
$lastRunRelative = t('today');
|
|
|
|
|
} elseif ($diffDays === 1) {
|
|
|
|
|
$lastRunRelative = t('yesterday');
|
|
|
|
|
} else {
|
|
|
|
|
$lastRunRelative = sprintf(t('%d days ago'), $diffDays);
|
|
|
|
|
}
|
|
|
|
|
} catch (\Throwable) {
|
|
|
|
|
$lastRunRelative = '—';
|
|
|
|
|
}
|
|
|
|
|
if ($lastRunStatus !== null && $lastRunStatus !== '') {
|
|
|
|
|
// Status enum tokens are translated via existing 'Success'/'Failed'/'Skipped' keys.
|
|
|
|
|
$statusKey = ucfirst(strtolower($lastRunStatus));
|
|
|
|
|
$lastRunStatusLabel = t($statusKey);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lastRunSummary = '';
|
|
|
|
|
if ($lastRunAt !== null) {
|
|
|
|
|
$lastRunSummary = sprintf(
|
|
|
|
|
'%s: %s%s',
|
|
|
|
|
t('Last run'),
|
|
|
|
|
$lastRunRelative,
|
|
|
|
|
$lastRunStatusLabel !== '' ? ' · ' . $lastRunStatusLabel : ''
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
$lastRunSummary = t('No runs yet');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lastRunTooltip = $lastRunStatusLabel !== '' ? $lastRunStatusLabel : t('No runs yet');
|
|
|
|
|
$pendingDisabled = ($deactivateDays <= 0 || $deleteDays <= 0);
|
|
|
|
|
|
|
|
|
|
/** @var array<int, array<string, mixed>> $kpiTiles */
|
|
|
|
|
$kpiTiles = [
|
|
|
|
|
[
|
|
|
|
|
'label' => t('Last run'),
|
|
|
|
|
'count' => $lastRunAt !== null ? $lastRunRelative : '—',
|
|
|
|
|
'icon' => 'bi bi-clock-history',
|
|
|
|
|
'iconTone' => 'blue',
|
|
|
|
|
'href' => 'admin/settings/user-lifecycle',
|
|
|
|
|
'tooltip' => $lastRunTooltip,
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'label' => t('Deactivated'),
|
|
|
|
|
'count' => $auditDashboardActive ? (string) ((int) ($summary['deactivate'] ?? 0)) : '—',
|
|
|
|
|
'icon' => 'bi bi-person-dash',
|
|
|
|
|
'iconTone' => 'amber',
|
|
|
|
|
'href' => 'admin/settings/user-lifecycle',
|
|
|
|
|
'tooltip' => t('Last 30 days'),
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'label' => t('Deleted'),
|
|
|
|
|
'count' => $auditDashboardActive ? (string) ((int) ($summary['delete'] ?? 0)) : '—',
|
|
|
|
|
'icon' => 'bi bi-person-x',
|
|
|
|
|
'iconTone' => 'red',
|
|
|
|
|
'href' => 'admin/settings/user-lifecycle',
|
|
|
|
|
'tooltip' => t('Last 30 days'),
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'label' => t('Pending deletion'),
|
|
|
|
|
'count' => $pendingDisabled ? '—' : (string) $pendingCount,
|
|
|
|
|
'icon' => 'bi bi-exclamation-triangle',
|
|
|
|
|
'iconTone' => 'orange',
|
|
|
|
|
'href' => 'admin/users',
|
|
|
|
|
'tooltip' => t('Next 7 days'),
|
|
|
|
|
],
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// ── Aside quick actions ──────────────────────────────────────────────
|
|
|
|
|
/** @var array<int, array<string, mixed>> $asideActions */
|
|
|
|
|
$asideActions = [];
|
|
|
|
|
if ($canUpdateSettings) {
|
|
|
|
|
$asideActions[] = [
|
|
|
|
|
'type' => 'form',
|
|
|
|
|
'label' => t('Run policy now'),
|
|
|
|
|
'action' => 'admin/settings/run-user-lifecycle',
|
|
|
|
|
'method' => 'POST',
|
|
|
|
|
'class' => 'secondary outline small',
|
|
|
|
|
'tone' => 'danger',
|
|
|
|
|
'confirm' => t('Run user lifecycle now?'),
|
|
|
|
|
'detailActionKind' => 'danger',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
if ($canUpdateSettings && $auditDashboardActive) {
|
|
|
|
|
$asideActions[] = [
|
|
|
|
|
'type' => 'form',
|
|
|
|
|
'label' => t('Purge logs'),
|
|
|
|
|
'action' => 'admin/settings/user-lifecycle/audit-purge',
|
|
|
|
|
'method' => 'POST',
|
|
|
|
|
'class' => 'secondary outline small',
|
|
|
|
|
'tone' => 'danger',
|
|
|
|
|
'confirm' => t('Purge old user lifecycle audit log entries?'),
|
|
|
|
|
'detailActionKind' => 'purge',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
$asideActions[] = [
|
|
|
|
|
'type' => 'link',
|
|
|
|
|
'label' => t('Policy reference'),
|
|
|
|
|
'href' => 'docs/reference-benutzer-lifecycle-policy.md',
|
|
|
|
|
'class' => 'secondary outline small',
|
|
|
|
|
'target' => '_blank',
|
|
|
|
|
'rel' => 'noopener',
|
|
|
|
|
];
|
|
|
|
|
|
2026-04-25 08:50:05 +02:00
|
|
|
Buffer::set('title', t('User lifecycle settings'));
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
|
|
|
|
|
$breadcrumbs = [
|
|
|
|
|
['label' => t('Home'), 'path' => 'admin'],
|
|
|
|
|
['label' => t('Settings'), 'path' => 'admin/settings'],
|
2026-04-25 08:50:05 +02:00
|
|
|
['label' => t('User lifecycle')],
|
refactor(settings): split admin/settings into hub + per-section subpages
Splits the 755-line monolithic settings page into a tile-based landing hub
and six focused subpages (general, security, email, api, sso, branding),
each with its own form, CSRF scope and POST handler. Each subpage offers
Save / Save & close buttons plus a Cancel/back link to the hub.
Backend (AdminSettingsService, gateways, policies, DB schema) unchanged.
A new settingsSectionMergePost() helper overlays section POSTs onto the
current DB values so partial saves don't wipe unrelated fields (the
service defaults missing keys to 0/empty).
Sub-action files (logo/favicon/tokens/lifecycle) redirect to the matching
subpage, and architecture contracts now check the subpage files instead
of the removed monolithic index.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 22:43:12 +02:00
|
|
|
];
|