Clean up unused code.
This commit is contained in:
parent
579ce5fdd8
commit
dfa7e6e2ea
1 changed files with 35 additions and 53 deletions
|
@ -45,9 +45,6 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
|
|||
public static final String BODY_ERROR_MESSAGE = "errorMessage";
|
||||
public static final String BODY_CANCEL_URL = "cancelUrl";
|
||||
|
||||
/** If no portal is specified in the request, use this one. */
|
||||
private static final int DEFAULT_PORTAL_ID = 1;
|
||||
|
||||
public LoginTemplateHelper(HttpServletRequest req) {
|
||||
super(req);
|
||||
}
|
||||
|
@ -56,7 +53,6 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
|
|||
public String showLoginPage(HttpServletRequest request) {
|
||||
VitroRequest vreq = new VitroRequest(request);
|
||||
try {
|
||||
|
||||
State state = getCurrentLoginState(vreq);
|
||||
log.debug("State on exit: " + state);
|
||||
|
||||
|
@ -70,7 +66,7 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
return doTemplate(vreq, showError(request, e));
|
||||
return doTemplate(vreq, showError(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,19 +82,18 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
|
|||
case LOGGED_IN:
|
||||
return null;
|
||||
case FORCED_PASSWORD_CHANGE:
|
||||
//return doTemplate(vreq, showPasswordChangeScreen(vreq), body, config);
|
||||
// return doTemplate(vreq, showPasswordChangeScreen(vreq), body, config);
|
||||
return showPasswordChangeScreen(vreq);
|
||||
default:
|
||||
//return doTemplate(vreq, showLoginScreen(vreq), body, config);
|
||||
// return doTemplate(vreq, showLoginScreen(vreq), body, config);
|
||||
return showLoginScreen(vreq);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
return showError(vreq, e);
|
||||
return showError(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User is just starting the login process. Be sure that we have a
|
||||
* {@link LoginProcessBean} with the correct status. Show them the login
|
||||
|
@ -147,7 +142,7 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
|
|||
return trv;
|
||||
}
|
||||
|
||||
private TemplateResponseValues showError(HttpServletRequest request, Exception e) {
|
||||
private TemplateResponseValues showError(Exception e) {
|
||||
TemplateResponseValues trv = new TemplateResponseValues(
|
||||
TEMPLATE_SERVER_ERROR);
|
||||
trv.put(BODY_ERROR_MESSAGE, "Internal server error:<br /> " + e);
|
||||
|
@ -155,8 +150,8 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* We processed a response, and want to show a template.
|
||||
* Version for JSP page.
|
||||
* We processed a response, and want to show a template. Version for JSP
|
||||
* page.
|
||||
*/
|
||||
private String doTemplate(VitroRequest vreq, TemplateResponseValues values) {
|
||||
// Set it up like FreeMarkerHttpServlet.doGet() would do.
|
||||
|
@ -171,7 +166,6 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
|
|||
return mergeMapToTemplate(values.getTemplateName(), body, config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Where are we in the process? Logged in? Not? Somewhere in between?
|
||||
*/
|
||||
|
@ -213,16 +207,4 @@ public class LoginTemplateHelper extends LoginTemplateHelperBase {
|
|||
String urlParams = "?login=block&cancel=true";
|
||||
return contextPath + "/authenticate" + urlParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* What portal are we currently in?
|
||||
*/
|
||||
private String getPortalIdString(HttpServletRequest request) {
|
||||
String portalIdParameter = request.getParameter("home");
|
||||
if (portalIdParameter == null) {
|
||||
return String.valueOf(DEFAULT_PORTAL_ID);
|
||||
} else {
|
||||
return portalIdParameter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue