NIHVIVO-736 transitioning from LoginFormBean to LoginStatusBean.

This commit is contained in:
jeb228 2010-10-13 15:54:11 +00:00
parent 4dbf19c9c0
commit 02e32428bd
6 changed files with 30 additions and 106 deletions

View file

@ -10,12 +10,12 @@
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.TabWebUtil" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.web.PortalWebUtil" %>
<%@page import="java.util.List"%>
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
<%@ page import="java.util.List"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session" />
<%
/***********************************************
Make the Tab menu list and search block
@ -57,22 +57,15 @@
// application variables not stored in application bean
final String DEFAULT_SEARCH_METHOD = "fulltext";
final int FILTER_SECURITY_LEVEL = 4;
final int VIVO_SEARCHBOX_SIZE = 20;
ApplicationBean appBean = vreq.getAppBean();
PortalWebUtil.populateSearchOptions(portal, appBean, vreq.getWebappDaoFactory().getPortalDao());
PortalWebUtil.populateNavigationChoices(portal, request, appBean, vreq.getWebappDaoFactory().getPortalDao());
HttpSession currentSession = request.getSession();
String currentSessionIdStr = currentSession.getId();
int securityLevel = -1;
String loginName = null;
if (loginHandler.testSessionLevel(request) > -1) {
securityLevel = Integer.parseInt(loginHandler.getLoginRole());
loginName = loginHandler.getLoginName();
}
LoginStatusBean loginBean = LoginStatusBean.getBean(request);
boolean isEditor = loginBean.isLoggedInAtLeast(LoginStatusBean.EDITOR);
String loginName = loginBean.getUsername();
%>
<c:url var="themePath" value="/${themeDir}" />
@ -118,7 +111,7 @@
<div id="searchBlock">
<form id="searchForm" action="${searchURL}" >
<label for="search">Search </label>
<% if (securityLevel>=FILTER_SECURITY_LEVEL && appBean.isFlag1Active()) { %>
<% if (isEditor && appBean.isFlag1Active()) { %>
<select id="search-form-modifier" name="flag1" class="form-item" >
<option value="nofiltering" selected="selected">entire database (<%=loginName%>)</option>
<option value="${currentPortal}"><%=portal.getShortHand()%></option>