NIHVIVO-736 transitioning from LoginFormBean to LoginStatusBean.
This commit is contained in:
parent
53bb8d38c5
commit
cd437cfab5
1 changed files with 4 additions and 38 deletions
|
@ -40,7 +40,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vedit.beans.LoginFormBean;
|
|
||||||
import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
import edu.cornell.mannlib.vedit.controller.BaseEditController;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
import edu.cornell.mannlib.vitro.webapp.beans.Portal;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
import edu.cornell.mannlib.vitro.webapp.controller.Controllers;
|
||||||
|
@ -70,9 +69,12 @@ public class DummyVisClientController extends BaseEditController {
|
||||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException
|
throws ServletException, IOException
|
||||||
{
|
{
|
||||||
|
if (!checkLoginStatus(request, response))
|
||||||
|
return;
|
||||||
|
|
||||||
super.doGet(request, response);
|
super.doGet(request, response);
|
||||||
|
|
||||||
VitroRequest vreq = handleLoginAuthentication(request, response);
|
VitroRequest vreq = new VitroRequest(request);
|
||||||
prepareVisualizationQueryResponse(request, response, vreq);
|
prepareVisualizationQueryResponse(request, response, vreq);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -99,40 +101,4 @@ public class DummyVisClientController extends BaseEditController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private VitroRequest handleLoginAuthentication(HttpServletRequest request,
|
|
||||||
HttpServletResponse response) throws IOException {
|
|
||||||
// This might not be required
|
|
||||||
/*
|
|
||||||
* why are there multiple places where the login is checked? shud be abtracted into
|
|
||||||
* new methoid?
|
|
||||||
* */
|
|
||||||
// if( !checkLoginStatus(request, response) )
|
|
||||||
// return null;
|
|
||||||
|
|
||||||
VitroRequest vreq = new VitroRequest(request);
|
|
||||||
|
|
||||||
Object obj = vreq.getSession().getAttribute("loginHandler");
|
|
||||||
LoginFormBean loginHandler = null;
|
|
||||||
|
|
||||||
if( obj != null && obj instanceof LoginFormBean )
|
|
||||||
loginHandler = ((LoginFormBean)obj);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* what is the speciality of 5 in the conditions?
|
|
||||||
*
|
|
||||||
if( loginHandler == null ||
|
|
||||||
! "authenticated".equalsIgnoreCase(loginHandler.getLoginStatus()) ||
|
|
||||||
Integer.parseInt(loginHandler.getLoginRole()) <= 5 ){
|
|
||||||
HttpSession session = request.getSession(true);
|
|
||||||
|
|
||||||
session.setAttribute("postLoginRequest",
|
|
||||||
vreq.getRequestURI()+( vreq.getQueryString()!=null?('?' + vreq.getQueryString()):"" ));
|
|
||||||
String redirectURL = request.getContextPath() + Controllers.SITE_ADMIN + "?login=block";
|
|
||||||
response.sendRedirect(redirectURL);
|
|
||||||
return null;
|
|
||||||
}*/
|
|
||||||
return vreq;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue