diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java index 21eb543a8..ab5c3c248 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java @@ -33,7 +33,16 @@ public class ConfigurationPropertiesBean { private String defaultJwtSigner; private JWSAlgorithm defaultAlgorithm; - + + private String adminConsoleTopbarTitle; + + private String logoImageUrl; + + private String adminConsoleCopyrightFooter; + + private String adminConsoleLandingPageText; + + public ConfigurationPropertiesBean() { } @@ -80,4 +89,37 @@ public class ConfigurationPropertiesBean { return null; } } + + public String getAdminConsoleTopbarTitle() { + return adminConsoleTopbarTitle; + } + + public void setAdminConsoleTopbarTitle(String adminConsoleTopbarTitle) { + this.adminConsoleTopbarTitle = adminConsoleTopbarTitle; + } + + public String getLogoImageUrl() { + return logoImageUrl; + } + + public void setLogoImageUrl(String logoImageUrl) { + this.logoImageUrl = logoImageUrl; + } + + public String getAdminConsoleCopyrightFooter() { + return adminConsoleCopyrightFooter; + } + + public void setAdminConsoleCopyrightFooter(String adminConsoleCopyrightFooter) { + this.adminConsoleCopyrightFooter = adminConsoleCopyrightFooter; + } + + public String getAdminConsoleLandingPageText() { + return adminConsoleLandingPageText; + } + + public void setAdminConsoleLandingPageText(String adminConsoleLandingPageText) { + this.adminConsoleLandingPageText = adminConsoleLandingPageText; + } + } diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ManagerController.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ManagerController.java index 04a4a5a3e..b9de97fb8 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ManagerController.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ManagerController.java @@ -17,6 +17,7 @@ package org.mitre.openid.connect.web; import java.util.Map; +import org.mitre.openid.connect.config.ConfigurationPropertiesBean; import org.mitre.openid.connect.service.StatsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -33,6 +34,9 @@ public class ManagerController { @Autowired private StatsService statsService; + + @Autowired + private ConfigurationPropertiesBean configBean; @RequestMapping({"", "home", "index"}) public String showHomePage(ModelMap m) { @@ -40,12 +44,22 @@ public class ManagerController { Map summary = statsService.calculateSummaryStats(); m.put("statsSummary", summary); + m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle()); + m.put("landingPageText", configBean.getAdminConsoleLandingPageText()); + m.put("copyright", configBean.getAdminConsoleCopyrightFooter()); + m.put("logoUrl", configBean.getLogoImageUrl()); return "home"; } @RequestMapping({"about", "about/"}) public String showAboutPage(ModelMap m) { + + m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle()); + m.put("landingPageText", configBean.getAdminConsoleLandingPageText()); + m.put("copyright", configBean.getAdminConsoleCopyrightFooter()); + m.put("logoUrl", configBean.getLogoImageUrl()); + return "about"; } @@ -55,20 +69,53 @@ public class ManagerController { Map summary = statsService.calculateSummaryStats(); m.put("statsSummary", summary); + m.put("statsSummary", summary); + m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle()); + m.put("landingPageText", configBean.getAdminConsoleLandingPageText()); + m.put("copyright", configBean.getAdminConsoleCopyrightFooter()); + m.put("logoUrl", configBean.getLogoImageUrl()); return "stats"; } @RequestMapping({"contact", "contact/"}) public String showContactPage(ModelMap m) { + + m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle()); + m.put("landingPageText", configBean.getAdminConsoleLandingPageText()); + m.put("copyright", configBean.getAdminConsoleCopyrightFooter()); + m.put("logoUrl", configBean.getLogoImageUrl()); + return "contact"; } @PreAuthorize("hasRole('ROLE_USER')") // TODO: this probably shouldn't be here @RequestMapping("manage/**") - public String showClientManager() { + public String showClientManager(ModelMap m) { // TODO: move view + + m.put("topbarTitle", configBean.getAdminConsoleTopbarTitle()); + m.put("landingPageText", configBean.getAdminConsoleLandingPageText()); + m.put("copyright", configBean.getAdminConsoleCopyrightFooter()); + m.put("logoUrl", configBean.getLogoImageUrl()); + return "admin/manage"; } + public StatsService getStatsService() { + return statsService; + } + + public void setStatsService(StatsService statsService) { + this.statsService = statsService; + } + + public ConfigurationPropertiesBean getConfigBean() { + return configBean; + } + + public void setConfigBean(ConfigurationPropertiesBean configBean) { + this.configBean = configBean; + } + } diff --git a/openid-connect-server/src/main/webapp/WEB-INF/server-config.xml b/openid-connect-server/src/main/webapp/WEB-INF/server-config.xml index 5a4649d39..de803dc0e 100644 --- a/openid-connect-server/src/main/webapp/WEB-INF/server-config.xml +++ b/openid-connect-server/src/main/webapp/WEB-INF/server-config.xml @@ -16,6 +16,10 @@ + + + + diff --git a/openid-connect-server/src/main/webapp/WEB-INF/tags/topbar.tag b/openid-connect-server/src/main/webapp/WEB-INF/tags/topbar.tag index 2e69c3a5c..6bb963d9d 100644 --- a/openid-connect-server/src/main/webapp/WEB-INF/tags/topbar.tag +++ b/openid-connect-server/src/main/webapp/WEB-INF/tags/topbar.tag @@ -1,4 +1,5 @@ <%@attribute name="pageName" required="false" %> +<%@attribute name="title" required="true" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %> @@ -33,7 +34,7 @@ - OpenID Connect Server + ${title}