major update

This commit is contained in:
2026-03-04 15:56:58 +01:00
parent 16759a2732
commit 8f4dd5840d
478 changed files with 24313 additions and 8201 deletions

View File

@@ -2,15 +2,14 @@
use MintyPHP\Http\Request;
use MintyPHP\Router;
use MintyPHP\Service\User\UserServicesFactory;
use MintyPHP\Session;
use MintyPHP\Support\Flash;
use MintyPHP\Support\Guard;
Guard::requireLogin();
$userAccountService = (new UserServicesFactory())->createUserAccountService();
$userAccountService = app(\MintyPHP\Service\User\UserAccountService::class);
$errorBag = formErrors();
if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST') {
if ((requestInput()->method()) !== 'POST') {
Router::redirect('admin');
return;
}
@@ -42,12 +41,13 @@ if (!allowUserTheme()) {
Router::json(['ok' => false, 'error' => 'theme_disabled']);
return;
}
Flash::error(t('Theme change is disabled for this tenant'), 'admin', 'theme_disabled');
$errorBag->addGlobal(t('Theme change is disabled for this tenant'));
flashFormErrors($errorBag, 'admin', 'theme_change');
Router::redirect('admin');
return;
}
$theme = strtolower(trim((string) ($_POST['theme'] ?? '')));
$theme = strtolower(trim((string) (requestInput()->bodyAll()['theme'] ?? '')));
$themes = appThemes();
if ($theme === '' || !isset($themes[$theme])) {
http_response_code(400);