diff --git a/.classpath b/.classpath index 0ceb063..27dad70 100644 --- a/.classpath +++ b/.classpath @@ -1,866 +1,248 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/de/superx/saiku/SuperXLDAPAnmeldungFilter.java b/src/de/superx/saiku/SuperXLDAPAnmeldungFilter.java new file mode 100644 index 0000000..a2eb674 --- /dev/null +++ b/src/de/superx/saiku/SuperXLDAPAnmeldungFilter.java @@ -0,0 +1,54 @@ +package de.superx.saiku; + +import java.io.IOException; + +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; +import org.springframework.context.ApplicationContext; +import org.springframework.security.web.authentication.AnonymousAuthenticationFilter; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.context.WebApplicationContext; + +import de.superx.servlet.RequestParameter; +import de.superx.servlet.ServletBasics; +import de.superx.servlet.UserInitializer; + +public class SuperXLDAPAnmeldungFilter extends AnonymousAuthenticationFilter { + public static Logger logger = Logger.getLogger(SuperXLDAPAnmeldungFilter.class); + + public SuperXLDAPAnmeldungFilter(String key) { + super(key); + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + HttpServletRequest req=(HttpServletRequest) request; + if(SecurityContextHolder.getContext().getAuthentication()!=null + && req.getSession().getAttribute("user")==null) + { + String kennungImRequest = SecurityContextHolder.getContext().getAuthentication().getName(); + if (kennungImRequest != null ) { + logger.debug("Gastanmeldung kennung=gast* im Request gefunden"); + UserInitializer ui; + try { + /*ui = new UserInitializer((HttpServletRequest) request); + ui.perform(null, (ApplicationContext) request.getServletContext() + .getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)); + logger.info("Gastanmeldung als " + ui.getUser().getName()+" erfolgreich");*/ + } catch (Exception e) { + e.printStackTrace(); + logger.error("Gastanmeldung fehlgeschlagen " + e); + throw new ServletException("Gastanmeldung fehlgeschlagen " + e); + } + } + } + chain.doFilter(request, response); + } + +} diff --git a/superx/WEB-INF/lib/superx6.0.jar b/superx/WEB-INF/lib/superx6.0.jar index c28bfe9..9cc1e10 100644 Binary files a/superx/WEB-INF/lib/superx6.0.jar and b/superx/WEB-INF/lib/superx6.0.jar differ diff --git a/superx/WEB-INF/saiku/applicationContext-saiku-webapp.xml b/superx/WEB-INF/saiku/applicationContext-saiku-webapp.xml index 09d9d5b..ec54ac1 100644 --- a/superx/WEB-INF/saiku/applicationContext-saiku-webapp.xml +++ b/superx/WEB-INF/saiku/applicationContext-saiku-webapp.xml @@ -78,13 +78,16 @@ + - + + - diff --git a/superx/index.jsp b/superx/index.jsp index 639c0b5..d1bd159 100644 --- a/superx/index.jsp +++ b/superx/index.jsp @@ -114,8 +114,14 @@ if(rs.getObject(1) !=null ) <% -if (request.getParameter("logoff") != null&&request.getSession()!=null) { request.getSession().invalidate(); }; -if (request.getSession()!=null&&request.getSession().getAttribute("sessiontype")!=null&&request.getSession().getAttribute("sessiontype").equals("superx") +if (request.getParameter("logoff") != null&&request.getSession()!=null) +{ + request.getSession().invalidate(); +} + +if (request.getSession()!=null +&&request.getSession().getAttribute("sessiontype")!=null +&&request.getSession().getAttribute("sessiontype").equals("superx") && request.getSession().getAttribute("user")!=null) { %> @@ -235,7 +241,7 @@ username=request.getRemoteUser(); - + <% } %>