diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetAllClasses.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetAllClasses.java index af660aef0..56981ef68 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetAllClasses.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetAllClasses.java @@ -56,31 +56,10 @@ public class GetAllClasses extends BaseEditController { } catch (Exception e) { e.printStackTrace(); } + if( !checkLoginStatus(request, response) ) + return; VitroRequest vreq = new VitroRequest(request); - Object obj = vreq.getSession().getAttribute("loginHandler"); - LoginFormBean loginHandler = null; - if (obj != null && obj instanceof LoginFormBean) - loginHandler = ((LoginFormBean) obj); - if (loginHandler == null - || !"authenticated".equalsIgnoreCase(loginHandler - .getLoginStatus()) || - // rjy7 Allows any editor (including self-editors) access to - // this servlet. - // This servlet is now requested via Ajax from some custom - // forms, so anyone - // using the custom form needs access rights. - Integer.parseInt(loginHandler.getLoginRole()) < LoginFormBean.NON_EDITOR) { - 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; - } // EditProcessObject epo = super.createEpo(request); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetAllPrefix.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetAllPrefix.java index be1d84866..84a07f5e8 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetAllPrefix.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetAllPrefix.java @@ -60,31 +60,10 @@ public class GetAllPrefix extends BaseEditController { } catch (Exception e) { e.printStackTrace(); } + if( !checkLoginStatus(request, response) ) + return; VitroRequest vreq = new VitroRequest(request); - Object obj = vreq.getSession().getAttribute("loginHandler"); - LoginFormBean loginHandler = null; - if (obj != null && obj instanceof LoginFormBean) - loginHandler = ((LoginFormBean) obj); - if (loginHandler == null - || !"authenticated".equalsIgnoreCase(loginHandler - .getLoginStatus()) || - // rjy7 Allows any editor (including self-editors) access to - // this servlet. - // This servlet is now requested via Ajax from some custom - // forms, so anyone - // using the custom form needs access rights. - Integer.parseInt(loginHandler.getLoginRole()) < LoginFormBean.NON_EDITOR) { - 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; - } // EditProcessObject epo = super.createEpo(request); OntologyDao daoObj = vreq.getFullWebappDaoFactory().getOntologyDao(); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzDataProperties.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzDataProperties.java index 53a4cbaa0..5c3cc825c 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzDataProperties.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzDataProperties.java @@ -54,32 +54,11 @@ public class GetClazzDataProperties extends BaseEditController { } catch (Exception e) { e.printStackTrace(); } - + if( !checkLoginStatus(request, response) ) + return; VitroRequest vreq = new VitroRequest(request); - Object obj = vreq.getSession().getAttribute("loginHandler"); - LoginFormBean loginHandler = null; - if (obj != null && obj instanceof LoginFormBean) - loginHandler = ((LoginFormBean) obj); - if (loginHandler == null - || !"authenticated".equalsIgnoreCase(loginHandler - .getLoginStatus()) || - // rjy7 Allows any editor (including self-editors) access to - // this servlet. - // This servlet is now requested via Ajax from some custom - // forms, so anyone - // using the custom form needs access rights. - Integer.parseInt(loginHandler.getLoginRole()) < LoginFormBean.NON_EDITOR) { - 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; - } + String vClassURI = vreq.getParameter("vClassURI"); if (vClassURI == null || vClassURI.trim().equals("")) { diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzObjectProperties.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzObjectProperties.java index c125b947b..e666f948d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzObjectProperties.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzObjectProperties.java @@ -49,32 +49,10 @@ public class GetClazzObjectProperties extends BaseEditController { } catch (Exception e) { e.printStackTrace(); } - + if( !checkLoginStatus(request, response) ) + return; VitroRequest vreq = new VitroRequest(request); - Object obj = vreq.getSession().getAttribute("loginHandler"); - LoginFormBean loginHandler = null; - if (obj != null && obj instanceof LoginFormBean) - loginHandler = ((LoginFormBean) obj); - if (loginHandler == null - || !"authenticated".equalsIgnoreCase(loginHandler - .getLoginStatus()) || - // rjy7 Allows any editor (including self-editors) access to - // this servlet. - // This servlet is now requested via Ajax from some custom - // forms, so anyone - // using the custom form needs access rights. - Integer.parseInt(loginHandler.getLoginRole()) < LoginFormBean.NON_EDITOR) { - 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; - } String vClassURI = vreq.getParameter("vClassURI"); if (vClassURI == null || vClassURI.trim().equals("")) { diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetObjectClasses.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetObjectClasses.java index 673bc2ed1..9b4f2eb23 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetObjectClasses.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetObjectClasses.java @@ -58,31 +58,10 @@ public class GetObjectClasses extends BaseEditController { } catch (Exception e) { e.printStackTrace(); } + if( !checkLoginStatus(request, response) ) + return; VitroRequest vreq = new VitroRequest(request); - Object obj = vreq.getSession().getAttribute("loginHandler"); - LoginFormBean loginHandler = null; - if (obj != null && obj instanceof LoginFormBean) - loginHandler = ((LoginFormBean) obj); - if (loginHandler == null - || !"authenticated".equalsIgnoreCase(loginHandler - .getLoginStatus()) || - // rjy7 Allows any editor (including self-editors) access to - // this servlet. - // This servlet is now requested via Ajax from some custom - // forms, so anyone - // using the custom form needs access rights. - Integer.parseInt(loginHandler.getLoginRole()) < LoginFormBean.NON_EDITOR) { - 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; - } String predicate = vreq.getParameter("predicate"); if (predicate == null || predicate.trim().equals("")) {