major update
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user