Remove some vestigial Login artifacts.

This commit is contained in:
jeb228 2010-12-09 15:58:00 +00:00
parent d30abaea5f
commit 224c21b077
5 changed files with 4 additions and 90 deletions

View file

@ -1087,11 +1087,6 @@
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.Authenticate</servlet-class>
</servlet>
<servlet>
<servlet-name>login</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.Login</servlet-class>
</servlet>
<servlet>
<servlet-name>loginExternalAuthSetup</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.authenticate.LoginExternalAuthSetup</servlet-class>
@ -1280,16 +1275,6 @@
<servlet-name>authenticate</servlet-name>
<url-pattern>/authenticate</url-pattern>
</servlet-mapping>
<!--
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
-->
<servlet-mapping>
<servlet-name>loginShibboleth</servlet-name>
<url-pattern>/loginShibboleth</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>loginExternalAuthSetup</servlet-name>
<url-pattern>/loginExternalAuth</url-pattern>

View file

@ -34,16 +34,15 @@ public class Controllers {
public static final String SITE_ADMIN = "/siteAdmin";
public static final String LOGIN = "/login";
public static final String LOGOUT = "/logout";
public static final String AUTHENTICATE = "/authenticate";
public static final String EXPORT_RDF = "/export";
public static final String EXPORT_RDF = "/export";
// jsps go here:
public static final String TAB = "/index.jsp";
public static final String LOGIN_JSP = "/login";
public static final String LOGOUT_JSP = "/logout";
public static final String BASIC_JSP = "/templates/page/basicPage.jsp";
public static final String DEBUG_JSP = "/templates/page/debug.jsp";

View file

@ -1,70 +0,0 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.controller.edit;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
import edu.cornell.mannlib.vitro.webapp.controller.login.LoginProcessBean;
/**
* Provide a means for programmatic login (replaces old login_process.jsp). If
* they provide the right parameters, send them to be authenticated.
*/
public class Login extends HttpServlet {
private final static int DEFAULT_PORTAL_ID = 1;
public static final String PARAM_USERNAME = "loginName";
public static final String PARAM_PASSWORD = "loginPassword";
@Override
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String username = request.getParameter(PARAM_USERNAME);
String password = request.getParameter(PARAM_PASSWORD);
/*
* If either the username or password are empty, send them to the site
* admin page.
*/
if ((username == null) || (username.equals("")) || (password == null)
|| (password.equals(""))) {
response.sendRedirect(request.getContextPath()
+ Controllers.SITE_ADMIN + "?home="
+ getPortalIdString(request));
return;
}
/*
* Otherwise, set up as if they had filled in the login form, and send
* them to authenticate it.
*/
LoginProcessBean bean = LoginProcessBean.getBean(request);
bean.setState(LoginProcessBean.State.LOGGING_IN);
request.getRequestDispatcher(Controllers.AUTHENTICATE).forward(request,
response);
}
private final String getPortalIdString(HttpServletRequest request) {
String pId = (String) request.getAttribute("home");
if (pId == null) {
pId = request.getParameter("home");
}
if (pId == null) {
pId = String.valueOf(DEFAULT_PORTAL_ID);
}
return pId;
}
@Override
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
}

View file

@ -47,7 +47,7 @@
<%-- A user is logged in --%>
<% if (isLoggedIn) { %>
<c:url var="logoutHref" value="<%= Controllers.LOGOUT_JSP %>">
<c:url var="logoutHref" value="<%= Controllers.LOGOUT %>">
<c:param name="home" value="${currentPortal}" />
</c:url>

View file

@ -71,7 +71,7 @@ portal.getRootBreadCrumbURL() : request.getContextPath()+"/";
<%-- A user is logged in --%>
<% if (isLoggedIn) { %>
<c:url var="logoutHref" value="<%= Controllers.LOGOUT_JSP %>">
<c:url var="logoutHref" value="<%= Controllers.LOGOUT %>">
<c:param name="home" value="${currentPortal}" />
</c:url>