<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core'%> <%@ page language="java" import="org.springframework.security.ui.AbstractProcessingFilter, org.springframework.security.ui.webapp.AuthenticationProcessingFilter, org.springframework.security.ui.savedrequest.SavedRequest, org.springframework.security.AuthenticationException, org.pentaho.platform.uifoundation.component.HtmlComponent, org.pentaho.platform.engine.core.system.PentahoSystem, org.pentaho.platform.util.messages.LocaleHelper, org.pentaho.platform.api.engine.IPentahoSession, org.pentaho.platform.web.http.WebTemplateHelper, org.pentaho.platform.api.engine.IUITemplater, org.pentaho.platform.web.jsp.messages.Messages, java.util.List, java.util.ArrayList, java.util.StringTokenizer, org.apache.commons.lang.StringEscapeUtils, org.pentaho.platform.web.http.PentahoHttpSessionHelper"%> <%! // List of request URL strings to look for to send 401 private List send401RequestList; public void jspInit() { // super.jspInit(); send401RequestList = new ArrayList(); String unauthList = getServletConfig().getInitParameter("send401List"); //$NON-NLS-1$ if (unauthList == null) { send401RequestList.add("AdhocWebService"); //$NON-NLS-1$ } else { StringTokenizer st = new StringTokenizer(unauthList, ","); //$NON-NLS-1$ String requestStr; while (st.hasMoreElements()) { requestStr = st.nextToken(); send401RequestList.add(requestStr.trim()); } } } %> <% response.setCharacterEncoding(LocaleHelper.getSystemEncoding()); String baseUrl = PentahoSystem.getApplicationContext().getBaseUrl(); String path = request.getContextPath(); IPentahoSession userSession = PentahoHttpSessionHelper.getPentahoSession( request ); // SPRING_SECURITY_SAVED_REQUEST_KEY contains the URL the user originally wanted before being redirected to the login page // if the requested url is in the list of URLs specified in the web.xml's init-param send401List, // then return a 401 status now and don't show a login page (401 means not authenticated) Object reqObj = request.getSession().getAttribute(AbstractProcessingFilter.SPRING_SECURITY_SAVED_REQUEST_KEY); String requestedURL = ""; if (reqObj != null) { requestedURL = ((SavedRequest) reqObj).getFullRequestUrl(); String lookFor; for (int i=0; i=0 ) { response.sendError(401); return; } } } boolean loggedIn; String remoteUser = request.getRemoteUser(); if(remoteUser != null && remoteUser != ""){ loggedIn = true; } int year = (new java.util.Date()).getYear() + 1900; %> Pentaho Platform

<% remoteUser = StringEscapeUtils.escapeXml(request.getRemoteUser()); if (null != remoteUser && remoteUser.length() > 0) {%> <% } else { %>
Login
<% } %> <%-- //ArrayList messages = new ArrayList(); //HtmlComponent html = new HtmlComponent( HtmlComponent.TYPE_URL, "http://www.pentaho.org/demo/news1.htm", Messages.getString("UI.USER_OFFLINE"), null, messages); --%> <%--= //html.getContent( "text/html" ) --%>