diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java index 599af231d..b68c1b529 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java @@ -12,6 +12,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import edu.cornell.mannlib.vedit.beans.LoginStatusBean; +import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Route; import edu.cornell.mannlib.vitro.webapp.controller.login.LoginProcessBean; import edu.cornell.mannlib.vitro.webapp.controller.login.LoginProcessBean.State; @@ -45,6 +47,8 @@ public class LoginWidget extends Widget { FORM_ACTION("formAction"), INFO_MESSAGE("infoMessage"), ERROR_MESSAGE("errorMessage"), + EXTERNAL_AUTH_NAME("externalAuthName"), + EXTERNAL_AUTH_URL("externalAuthUrl"), CANCEL_URL("cancelUrl"); private final String variableName; @@ -113,6 +117,14 @@ public class LoginWidget extends Widget { WidgetTemplateValues values = new WidgetTemplateValues(Macro.LOGIN.toString()); values.put(TemplateVariable.FORM_ACTION.toString(), getAuthenticateUrl(request)); values.put(TemplateVariable.LOGIN_NAME.toString(), bean.getUsername()); + + String externalAuthServerUrl = ConfigurationProperties.getProperty("externalAuth.serverUrl"); + externalAuthServerUrl = UrlBuilder.getUrl(externalAuthServerUrl); + if (externalAuthServerUrl != null) { + values.put(TemplateVariable.EXTERNAL_AUTH_URL.toString(), externalAuthServerUrl); + values.put(TemplateVariable.EXTERNAL_AUTH_NAME.toString(), + ConfigurationProperties.getProperty("externalAuth.serverName")); + } String infoMessage = bean.getInfoMessage(); if (!infoMessage.isEmpty()) { diff --git a/webapp/web/css/login.css b/webapp/web/css/login.css index 981235ec3..fd23b7865 100644 --- a/webapp/web/css/login.css +++ b/webapp/web/css/login.css @@ -41,6 +41,10 @@ p.request-account { float:left; } +#log-in-form p.external-auth { + margin-left: 36px; +} + #errorAlert { color:#900; padding:0px; diff --git a/webapp/web/templates/freemarker/widgets/widget-login.ftl b/webapp/web/templates/freemarker/widgets/widget-login.ftl index e298e7fff..7d3311fd7 100644 --- a/webapp/web/templates/freemarker/widgets/widget-login.ftl +++ b/webapp/web/templates/freemarker/widgets/widget-login.ftl @@ -44,13 +44,17 @@
- - - - - + + + + <#if externalAuthUrl??> + + #if> +