NIHVIVO-1368 fill the loginName field with a previously-supplied value, if one exists.

This commit is contained in:
jeb228 2010-12-01 15:39:16 +00:00
parent 49ff09b9d4
commit a645c60e13
2 changed files with 20 additions and 5 deletions

View file

@ -70,7 +70,7 @@ public class Authenticate extends VitroHttpServlet {
try { try {
// Where do we stand in the process? // Where do we stand in the process?
State entryState = getCurrentLoginState(vreq); State entryState = getCurrentLoginState(vreq);
log.debug("State on entry: " + entryState); dumpStateToLog("entry", entryState, vreq);
// Act on any input. // Act on any input.
switch (entryState) { switch (entryState) {
@ -90,7 +90,7 @@ public class Authenticate extends VitroHttpServlet {
// Now where do we stand? // Now where do we stand?
State exitState = getCurrentLoginState(vreq); State exitState = getCurrentLoginState(vreq);
log.debug("State on exit: " + exitState); dumpStateToLog("exit", exitState, vreq);
// Send them on their way. // Send them on their way.
switch (exitState) { switch (exitState) {
@ -162,10 +162,10 @@ public class Authenticate extends VitroHttpServlet {
if ((username == null) || username.isEmpty()) { if ((username == null) || username.isEmpty()) {
bean.setMessage(Message.NO_USERNAME); bean.setMessage(Message.NO_USERNAME);
return; return;
} else {
bean.setUsername(username);
} }
bean.setUsername(username);
User user = getAuthenticator(request).getUserByUsername(username); User user = getAuthenticator(request).getUserByUsername(username);
log.trace("User is " + (user == null ? "null" : user.getURI())); log.trace("User is " + (user == null ? "null" : user.getURI()));
@ -420,6 +420,21 @@ public class Authenticate extends VitroHttpServlet {
jenaOntModel.getBaseModel().notifyEvent(event); jenaOntModel.getBaseModel().notifyEvent(event);
} }
private void dumpStateToLog(String label, State state, VitroRequest vreq) {
log.debug("State on " + label + ": " + state);
if (log.isTraceEnabled()) {
log.trace("Status bean on " + label + ": "
+ LoginStatusBean.getBean(vreq));
LoginProcessBean processBean = null;
if (LoginProcessBean.isBean(vreq)) {
processBean = LoginProcessBean.getBean(vreq);
}
log.trace("Process bean on " + label + ": " + processBean);
}
}
@Override @Override
public void doGet(HttpServletRequest request, HttpServletResponse response) public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException { throws IOException, ServletException {

View file

@ -36,7 +36,7 @@
<form role="form" id="login-form" action="${formAction}" method="post" name="login-form" /> <form role="form" id="login-form" action="${formAction}" method="post" name="login-form" />
<label for="email">Email</label> <label for="email">Email</label>
<input class="text-field" name="loginName" id="loginName" type="text" required /> <input class="text-field" name="loginName" id="loginName" type="text" value="${loginName!}" required />
<label for="password">Password</label> <label for="password">Password</label>
<input class="text-field" name="loginPassword" id="password" type="password" required /> <input class="text-field" name="loginPassword" id="password" type="password" required />