NIHVIVO-736 transitioning from LoginFormBean to LoginStatusBean.
This commit is contained in:
parent
5a2af2f97d
commit
4dbf19c9c0
10 changed files with 24 additions and 38 deletions
|
@ -53,7 +53,7 @@ public class LoginStatusBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the bean from this request, or a dummy bean if the user is not logged
|
* Get the bean from this request, or a dummy bean if the user is not logged
|
||||||
* in.
|
* in. Never returns null.
|
||||||
*/
|
*/
|
||||||
public static LoginStatusBean getBean(HttpServletRequest request) {
|
public static LoginStatusBean getBean(HttpServletRequest request) {
|
||||||
if (request == null) {
|
if (request == null) {
|
||||||
|
@ -70,7 +70,7 @@ public class LoginStatusBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the bean from this session, or a dummy bean if the user is not logged
|
* Get the bean from this session, or a dummy bean if the user is not logged
|
||||||
* in.
|
* in. Never returns null.
|
||||||
*/
|
*/
|
||||||
public static LoginStatusBean getBean(HttpSession session) {
|
public static LoginStatusBean getBean(HttpSession session) {
|
||||||
if (session == null) {
|
if (session == null) {
|
||||||
|
|
|
@ -15,8 +15,7 @@
|
||||||
<%@ page import="org.apache.commons.logging.Log" %>
|
<%@ page import="org.apache.commons.logging.Log" %>
|
||||||
<%@ page import="org.apache.commons.logging.LogFactory" %>
|
<%@ page import="org.apache.commons.logging.LogFactory" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||||
<jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session" />
|
|
||||||
<%!
|
<%!
|
||||||
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.dashboardPropsList.jsp");
|
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.dashboardPropsList.jsp");
|
||||||
%>
|
%>
|
||||||
|
@ -29,7 +28,7 @@ if( VitroRequestPrep.isSelfEditing(request) ) {
|
||||||
} else {
|
} else {
|
||||||
log.debug("self editing inactive");
|
log.debug("self editing inactive");
|
||||||
}
|
}
|
||||||
if (loginHandler!=null && loginHandler.getLoginStatus()=="authenticated" && Integer.parseInt(loginHandler.getLoginRole())>=loginHandler.getEditor()) {
|
if (LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.EDITOR)) {
|
||||||
showCuratorEdits=true;
|
showCuratorEdits=true;
|
||||||
log.debug("curator editing active");
|
log.debug("curator editing active");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.RdfLiteralHash" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.RdfLiteralHash" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
final String DEFAULT_VITRO_NS_FORM = "defaultVitroNsDataPropForm.jsp";
|
final String DEFAULT_VITRO_NS_FORM = "defaultVitroNsDataPropForm.jsp";
|
||||||
final String DEFAULT_ERROR_FORM = "error.jsp";
|
final String DEFAULT_ERROR_FORM = "error.jsp";
|
||||||
|
|
||||||
if (!VitroRequestPrep.isSelfEditing(request) && !LoginFormBean.loggedIn(request, LoginFormBean.NON_EDITOR)) {
|
if (!VitroRequestPrep.isSelfEditing(request) && !LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR)) {
|
||||||
%> <c:redirect url="<%= Controllers.LOGIN %>" /> <%
|
%> <c:redirect url="<%= Controllers.LOGIN %>" /> <%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.Controllers" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Portal" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Portal" %>
|
||||||
<%@ page import="java.util.HashMap" %>
|
<%@ page import="java.util.HashMap" %>
|
||||||
|
@ -40,10 +40,8 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
|
||||||
final String DEFAULT_ERROR_FORM = "error.jsp";
|
final String DEFAULT_ERROR_FORM = "error.jsp";
|
||||||
final String DEFAULT_ADD_INDIVIDUAL = "defaultAddMissingIndividualForm.jsp";
|
final String DEFAULT_ADD_INDIVIDUAL = "defaultAddMissingIndividualForm.jsp";
|
||||||
|
|
||||||
request.getSession(true);
|
|
||||||
|
|
||||||
if (!VitroRequestPrep.isSelfEditing(request)
|
if (!VitroRequestPrep.isSelfEditing(request)
|
||||||
&& !LoginFormBean.loggedIn(request, LoginFormBean.NON_EDITOR)) {
|
&& !LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR)) {
|
||||||
%> <c:redirect url="<%= Controllers.LOGIN %>" /> <%
|
%> <c:redirect url="<%= Controllers.LOGIN %>" /> <%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%@ page import="com.hp.hpl.jena.rdf.model.Literal" %>
|
<%@ page import="com.hp.hpl.jena.rdf.model.Literal" %>
|
||||||
<%@ page import="com.hp.hpl.jena.rdf.model.Property" %>
|
<%@ page import="com.hp.hpl.jena.rdf.model.Property" %>
|
||||||
|
|
||||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataProperty" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataProperty" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement" %>
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Utils"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Utils"%>
|
||||||
|
@ -23,9 +23,7 @@
|
||||||
<%
|
<%
|
||||||
org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("edu.cornell.mannlib.vitro.jsp.edit.forms.datapropStmtDelete");
|
org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("edu.cornell.mannlib.vitro.jsp.edit.forms.datapropStmtDelete");
|
||||||
|
|
||||||
if( session == null)
|
if (!VitroRequestPrep.isSelfEditing(request) && !LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR)) {%>
|
||||||
throw new Error("need to have session");
|
|
||||||
if (!VitroRequestPrep.isSelfEditing(request) && !LoginFormBean.loggedIn(request, LoginFormBean.NON_EDITOR)) {%>
|
|
||||||
|
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StandardModelSelector"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StandardModelSelector"%>
|
||||||
<%@page import="com.hp.hpl.jena.shared.Lock"%>
|
<%@page import="com.hp.hpl.jena.shared.Lock"%>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.SelfEditingIdentifierFactory"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.SelfEditingIdentifierFactory"%>
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.RoleIdentifier"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.auth.identifier.RoleIdentifier"%>
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Utils"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Utils"%>
|
||||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement"%>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement"%>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty"%>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty"%>
|
||||||
|
@ -48,11 +48,9 @@ public WebappDaoFactory getUnfilteredDaoFactory() {
|
||||||
</c:url>
|
</c:url>
|
||||||
|
|
||||||
<%
|
<%
|
||||||
if( session == null) {
|
|
||||||
throw new Error("need to have session");
|
|
||||||
}
|
|
||||||
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
||||||
if (!selfEditing && !LoginFormBean.loggedIn(request, LoginFormBean.NON_EDITOR)) {%>
|
boolean isLoggedIn = LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
||||||
|
if (!selfEditing && !isLoggedIn) {%>
|
||||||
<c:redirect url="<%= Controllers.LOGIN %>" />
|
<c:redirect url="<%= Controllers.LOGIN %>" />
|
||||||
<% }
|
<% }
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||||
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
||||||
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
||||||
|
@ -40,12 +40,9 @@ and set a flag in the request to indicate "back button confusion"
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
log.debug("Starting datapropertyBackButtonProblems.jsp");
|
log.debug("Starting datapropertyBackButtonProblems.jsp");
|
||||||
|
|
||||||
if( session == null)
|
|
||||||
throw new Error("need to have session");
|
|
||||||
%>
|
%>
|
||||||
<%
|
<%
|
||||||
if (!VitroRequestPrep.isSelfEditing(request) && !LoginFormBean.loggedIn(request, LoginFormBean.CURATOR)) {
|
if (!VitroRequestPrep.isSelfEditing(request) && !LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.CURATOR)) {
|
||||||
%><c:redirect url="<%= Controllers.LOGIN %>" /><%
|
%><c:redirect url="<%= Controllers.LOGIN %>" /><%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||||
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
||||||
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Generator" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Generator" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission" %>
|
||||||
|
@ -49,10 +49,9 @@
|
||||||
|
|
||||||
--%>
|
--%>
|
||||||
<%
|
<%
|
||||||
if( session == null)
|
|
||||||
throw new Error("need to have session");
|
|
||||||
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
||||||
if (!selfEditing && !LoginFormBean.loggedIn(request, LoginFormBean.NON_EDITOR)) {
|
boolean isLoggedIn = LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
||||||
|
if (!selfEditing && !isLoggedIn) {
|
||||||
%><c:redirect url="<%= Controllers.LOGIN %>" /><%
|
%><c:redirect url="<%= Controllers.LOGIN %>" /><%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||||
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
||||||
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
|
||||||
|
@ -68,11 +68,9 @@ and set a flag in the request to indicate "back button confusion"
|
||||||
<%
|
<%
|
||||||
log.debug("Starting processDatapropRdfForm.jsp");
|
log.debug("Starting processDatapropRdfForm.jsp");
|
||||||
|
|
||||||
if( session == null)
|
|
||||||
throw new Error("need to have session");
|
|
||||||
|
|
||||||
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
||||||
if (!selfEditing && !LoginFormBean.loggedIn(request, LoginFormBean.NON_EDITOR)) {
|
boolean isLoggedIn = LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
||||||
|
if (!selfEditing && !isLoggedIn) {
|
||||||
%><c:redirect url="<%= Controllers.LOGIN %>" /><%
|
%><c:redirect url="<%= Controllers.LOGIN %>" /><%
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
<%@ page import="com.hp.hpl.jena.shared.Lock" %>
|
||||||
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
<%@ page import="com.thoughtworks.xstream.XStream" %>
|
||||||
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
<%@ page import="com.thoughtworks.xstream.io.xml.DomDriver" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
|
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Generator" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditN3Generator" %>
|
||||||
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission" %>
|
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission" %>
|
||||||
|
@ -54,10 +54,9 @@ The optional n3 blocks will proccessed if their variables are bound and
|
||||||
are well formed.
|
are well formed.
|
||||||
--%>
|
--%>
|
||||||
<%
|
<%
|
||||||
if( session == null)
|
|
||||||
throw new Error("need to have session");
|
|
||||||
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
boolean selfEditing = VitroRequestPrep.isSelfEditing(request);
|
||||||
if (!selfEditing && !LoginFormBean.loggedIn(request, LoginFormBean.NON_EDITOR)) {
|
boolean isLoggedIn = LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.NON_EDITOR);
|
||||||
|
if (!selfEditing && !isLoggedIn) {
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.jena.DependentResourceDeleteJena"%>
|
<%@page import="edu.cornell.mannlib.vitro.webapp.dao.jena.DependentResourceDeleteJena"%>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue