Auth: Reload entire layout if the locale changes

This commit is contained in:
Johannes Meyer 2021-04-15 16:09:29 +02:00
parent 04b906bff5
commit a87f15c861
1 changed files with 7 additions and 0 deletions

View File

@ -111,6 +111,13 @@ class Auth
} }
} }
// Reload entire layout if the locale changed
if (($locale = $user->getPreferences()->getValue('icingaweb', 'language')) !== null) {
if (setlocale(LC_ALL, 0) !== $locale && $this->getRequest()->isXmlHttpRequest()) {
$this->getResponse()->setHeader('X-Icinga-Redirect-Http', 'yes');
}
}
$this->user = $user; $this->user = $user;
if ($persist) { if ($persist) {
$this->persistCurrentUser(); $this->persistCurrentUser();