N°3936 - Add config parameter to disable theme selection in the user preferences ("user_preferences.allow_backoffice_theme_override")

This commit is contained in:
Molkobain
2021-04-09 09:01:33 +02:00
parent 0bc9aed3fe
commit d6695d3ad8
3 changed files with 17 additions and 3 deletions

View File

@@ -93,11 +93,15 @@ class ThemeHandler
*/
public static function GetCurrentUserThemeId(): string
{
$sThemeId = null;
try {
$sThemeId = appUserPreferences::GetPref('backoffice_theme', null);
if (true === MetaModel::GetConfig()->Get('user_preferences.allow_backoffice_theme_override')) {
$sThemeId = appUserPreferences::GetPref('backoffice_theme', null);
}
}
catch (Exception $oException) {
$sThemeId = null;
// Do nothing, already handled by $sThemeId null by default
}
// Fallback on the app. theme