From 5bc3ee0e8c3bfda09f8d9ff1ff462dfaf95a26f3 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Tue, 16 Feb 2016 18:05:06 +0100 Subject: [PATCH] KEYCLOAK-2493 Set default theme based on product name --- common/src/main/java/org/keycloak/common/Version.java | 2 -- .../content/standalone/configuration/keycloak-server.json | 1 - .../main/java/org/keycloak/theme/ExtendingThemeManager.java | 3 ++- .../base/src/test/resources/META-INF/keycloak-server.json | 1 - .../src/test/resources/META-INF/keycloak-server.json | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/org/keycloak/common/Version.java b/common/src/main/java/org/keycloak/common/Version.java index b1b9705385..42ba52a816 100755 --- a/common/src/main/java/org/keycloak/common/Version.java +++ b/common/src/main/java/org/keycloak/common/Version.java @@ -17,8 +17,6 @@ package org.keycloak.common; -import org.keycloak.common.util.Time; - import java.io.IOException; import java.io.InputStream; import java.util.Properties; diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/content/standalone/configuration/keycloak-server.json b/distribution/feature-packs/server-feature-pack/src/main/resources/content/standalone/configuration/keycloak-server.json index 41dab8565d..407f0c003a 100755 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/content/standalone/configuration/keycloak-server.json +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/content/standalone/configuration/keycloak-server.json @@ -37,7 +37,6 @@ }, "theme": { - "default": "keycloak", "staticMaxAge": 2592000, "cacheTemplates": true, "cacheThemes": true, diff --git a/services/src/main/java/org/keycloak/theme/ExtendingThemeManager.java b/services/src/main/java/org/keycloak/theme/ExtendingThemeManager.java index 7b5e1f3247..f1912705b7 100755 --- a/services/src/main/java/org/keycloak/theme/ExtendingThemeManager.java +++ b/services/src/main/java/org/keycloak/theme/ExtendingThemeManager.java @@ -19,6 +19,7 @@ package org.keycloak.theme; import org.jboss.logging.Logger; import org.keycloak.Config; +import org.keycloak.common.Version; import org.keycloak.models.KeycloakSession; import java.io.IOException; @@ -42,7 +43,7 @@ public class ExtendingThemeManager implements ThemeProvider { public ExtendingThemeManager(KeycloakSession session, ConcurrentHashMap themeCache) { this.session = session; this.themeCache = themeCache; - this.defaultTheme = Config.scope("theme").get("default", "keycloak"); + this.defaultTheme = Config.scope("theme").get("default", Version.NAME.toLowerCase()); } private List getProviders() { diff --git a/testsuite/integration-arquillian/tests/base/src/test/resources/META-INF/keycloak-server.json b/testsuite/integration-arquillian/tests/base/src/test/resources/META-INF/keycloak-server.json index 5cef402653..e26f6107dc 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/resources/META-INF/keycloak-server.json +++ b/testsuite/integration-arquillian/tests/base/src/test/resources/META-INF/keycloak-server.json @@ -42,7 +42,6 @@ }, "theme": { - "default": "keycloak", "staticMaxAge": "${keycloak.theme.staticMaxAge:2592000}", "cacheTemplates": "${keycloak.theme.cacheTemplates:true}", "cacheThemes": "${keycloak.theme.cacheThemes:true}", diff --git a/testsuite/integration/src/test/resources/META-INF/keycloak-server.json b/testsuite/integration/src/test/resources/META-INF/keycloak-server.json index a2f93cde96..9329cde8d0 100755 --- a/testsuite/integration/src/test/resources/META-INF/keycloak-server.json +++ b/testsuite/integration/src/test/resources/META-INF/keycloak-server.json @@ -37,7 +37,6 @@ }, "theme": { - "default": "keycloak", "staticMaxAge": "${keycloak.theme.staticMaxAge:2592000}", "cacheTemplates": "${keycloak.theme.cacheTemplates:true}", "cacheThemes": "${keycloak.theme.cacheThemes:true}",