add composer-unused, comprehensive docs, and project restructure
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks - Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists - Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services - Add Microsoft OIDC SSO, API token management, and user lifecycle features - Add swagger-ui vendor integration and OpenAPI spec - Add production Docker setup and bin/ scripts - Update composer dependencies, config, templates, and frontend assets throughout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
|
||||
use MintyPHP\Support\Guard;
|
||||
use MintyPHP\Http\Request;
|
||||
use MintyPHP\Router;
|
||||
use MintyPHP\Service\Access\PermissionService;
|
||||
use MintyPHP\Service\User\UserService;
|
||||
use MintyPHP\Service\User\UserAccessTemplateService;
|
||||
use MintyPHP\Service\Mail\MailService;
|
||||
use MintyPHP\I18n;
|
||||
|
||||
Guard::requireLogin();
|
||||
|
||||
@@ -92,32 +91,10 @@ function handleSendAccess(array $uuids, int $currentUserId): void
|
||||
continue;
|
||||
}
|
||||
|
||||
$locale = $user['locale'] ?? (I18n::$locale ?? I18n::$defaultLocale);
|
||||
$name = trim(($user['first_name'] ?? '') . ' ' . ($user['last_name'] ?? ''));
|
||||
$isGerman = strpos((string) $locale, 'de') === 0;
|
||||
$greeting = $isGerman ? 'Hallo' : 'Hello';
|
||||
if ($name !== '') {
|
||||
$greeting .= ' ' . $name;
|
||||
}
|
||||
$greeting .= ',';
|
||||
|
||||
$loginUrl = appUrl(Request::withLocale('login', $locale));
|
||||
$resetUrl = appUrl(Request::withLocale('password/forgot', $locale));
|
||||
$previousLocale = I18n::$locale ?? null;
|
||||
I18n::$locale = $locale;
|
||||
$subject = t('Your access details');
|
||||
I18n::$locale = $previousLocale;
|
||||
|
||||
$vars = [
|
||||
'app_name' => appTitle(),
|
||||
'app_logo_url' => appLogoUrlAbsolute(128),
|
||||
'imprint_url' => appUrl(Request::withLocale('imprint', $locale)),
|
||||
'privacy_url' => appUrl(Request::withLocale('privacy', $locale)),
|
||||
'greeting' => $greeting,
|
||||
'username' => (string) ($user['email'] ?? ''),
|
||||
'login_url' => $loginUrl,
|
||||
'reset_url' => $resetUrl,
|
||||
];
|
||||
$context = UserAccessTemplateService::buildContext($user);
|
||||
$locale = (string) ($context['locale'] ?? '');
|
||||
$subject = (string) ($context['subject'] ?? t('Your access details'));
|
||||
$vars = is_array($context['vars'] ?? null) ? $context['vars'] : [];
|
||||
|
||||
$result = MailService::sendTemplate('access_info', $vars, (string) $user['email'], $subject, $locale);
|
||||
if ($result['ok'] ?? false) {
|
||||
|
||||
Reference in New Issue
Block a user