From d783c6200ec790a38b904cb9dd7905fd69105d52 Mon Sep 17 00:00:00 2001 From: Bill Burke Date: Mon, 3 Mar 2014 16:30:09 -0500 Subject: [PATCH] fix login.ftl page --- .../src/main/resources/theme/login/base/login.ftl | 4 +++- .../org/keycloak/login/freemarker/model/SocialBean.java | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/forms/common-themes/src/main/resources/theme/login/base/login.ftl b/forms/common-themes/src/main/resources/theme/login/base/login.ftl index eed02575fb..abf4652667 100755 --- a/forms/common-themes/src/main/resources/theme/login/base/login.ftl +++ b/forms/common-themes/src/main/resources/theme/login/base/login.ftl @@ -1,5 +1,5 @@ <#import "template.ftl" as layout> -<@layout.registrationLayout displayInfo=social.displaySocialProviders; section> +<@layout.registrationLayout displayInfo=social.displayInfo; section> <#if section = "title"> ${rb.loginTitle} ${realm.name} <#elseif section = "header"> @@ -57,6 +57,7 @@ + <#if social.providers??>
+ diff --git a/forms/login-freemarker/src/main/java/org/keycloak/login/freemarker/model/SocialBean.java b/forms/login-freemarker/src/main/java/org/keycloak/login/freemarker/model/SocialBean.java index c9f1feee8d..3ee40b2fdb 100755 --- a/forms/login-freemarker/src/main/java/org/keycloak/login/freemarker/model/SocialBean.java +++ b/forms/login-freemarker/src/main/java/org/keycloak/login/freemarker/model/SocialBean.java @@ -39,8 +39,10 @@ public class SocialBean { private boolean displaySocial; private List providers; + private RealmModel realm; public SocialBean(RealmModel realm, URI baseURI) { + this.realm = realm; Map socialConfig = realm.getSocialConfig(); if (realm.isSocial() && !socialConfig.isEmpty()) { displaySocial = true; @@ -60,6 +62,10 @@ public class SocialBean { return providers; } + public boolean isDisplayInfo() { + return realm.isRegistrationAllowed() || displaySocial; + } + public boolean isDisplaySocialProviders() { return displaySocial; }