Modify wording on login widget to include sitename

This commit is contained in:
rjy7 2011-01-04 18:23:11 +00:00
parent 23b0487c4a
commit bc2a2dbc1a
2 changed files with 9 additions and 4 deletions

View file

@ -51,7 +51,8 @@ public class LoginWidget extends Widget {
ERROR_MESSAGE("errorMessage"), ERROR_MESSAGE("errorMessage"),
EXTERNAL_AUTH_NAME("externalAuthName"), EXTERNAL_AUTH_NAME("externalAuthName"),
EXTERNAL_AUTH_URL("externalAuthUrl"), EXTERNAL_AUTH_URL("externalAuthUrl"),
CANCEL_URL("cancelUrl"); CANCEL_URL("cancelUrl"),
SITE_NAME("siteName");
private final String variableName; private final String variableName;
@ -77,6 +78,8 @@ public class LoginWidget extends Widget {
State state = getCurrentLoginState(request); State state = getCurrentLoginState(request);
log.debug("State on exit: " + state); log.debug("State on exit: " + state);
String siteName = env.getDataModel().get("siteName").toString();
switch (state) { switch (state) {
case LOGGED_IN: case LOGGED_IN:
// On the login page itself, show a message that the user is already logged in. // On the login page itself, show a message that the user is already logged in.
@ -92,7 +95,7 @@ public class LoginWidget extends Widget {
values = showPasswordChangeScreen(request); values = showPasswordChangeScreen(request);
break; break;
default: default:
values = showLoginScreen(request); values = showLoginScreen(request, siteName);
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e); log.error(e);
@ -108,7 +111,7 @@ public class LoginWidget extends Widget {
/** /**
* User is starting the login process. Show them the login screen. * User is starting the login process. Show them the login screen.
*/ */
private WidgetTemplateValues showLoginScreen(HttpServletRequest request) private WidgetTemplateValues showLoginScreen(HttpServletRequest request, String siteName)
throws IOException { throws IOException {
LoginProcessBean bean = LoginProcessBean.getBean(request); LoginProcessBean bean = LoginProcessBean.getBean(request);
log.trace("Going to login screen: " + bean); log.trace("Going to login screen: " + bean);
@ -134,6 +137,8 @@ public class LoginWidget extends Widget {
values.put(TemplateVariable.ERROR_MESSAGE.toString(), errorMessage); values.put(TemplateVariable.ERROR_MESSAGE.toString(), errorMessage);
} }
values.put(TemplateVariable.SITE_NAME.toString(), siteName);
return values; return values;
} }

View file

@ -39,7 +39,7 @@
<p class="external-auth"><a class="blue button" href="${externalAuthUrl}">${externalAuthName}</a></p> <p class="external-auth"><a class="blue button" href="${externalAuthUrl}">${externalAuthName}</a></p>
<p class="or-auth">or</p> <p class="or-auth">or</p>
<h3 class="internal-auth" >Login using a different account</h3> <h3 class="internal-auth" >Log in using your ${siteName} account</h3>
</#if> </#if>
<label for="email">Email</label> <label for="email">Email</label>