fix login.ftl page

This commit is contained in:
Bill Burke 2014-03-03 16:30:09 -05:00
parent e307916233
commit d783c6200e
2 changed files with 9 additions and 1 deletions

View file

@ -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 @@
</div>
</#if>
<#if social.providers??>
<div id="kc-social-providers">
<ul>
<#list social.providers as p>
@ -64,5 +65,6 @@
</#list>
</ul>
</div>
</#if>
</#if>
</@layout.registrationLayout>

View file

@ -39,8 +39,10 @@ public class SocialBean {
private boolean displaySocial;
private List<SocialProvider> providers;
private RealmModel realm;
public SocialBean(RealmModel realm, URI baseURI) {
this.realm = realm;
Map<String, String> 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;
}