diff --git a/src/main/java/de/hsel/spm/baudas/analysis/ShoppingTimes.java b/src/main/java/de/hsel/spm/baudas/analysis/ShoppingTimes.java index 4c4a697..ed99ee2 100644 --- a/src/main/java/de/hsel/spm/baudas/analysis/ShoppingTimes.java +++ b/src/main/java/de/hsel/spm/baudas/analysis/ShoppingTimes.java @@ -27,7 +27,7 @@ public class ShoppingTimes implements Analysis> { /** * get customer count at specific times. * - * @return Map of Day-Hour Combinations and the corresponding customer count + * @return Map of Day-Hour Combinations and the corresponding user count */ @Override public Map getResult() { diff --git a/src/main/java/de/hsel/spm/baudas/web/AuthenticationFilter.java b/src/main/java/de/hsel/spm/baudas/web/AuthenticationFilter.java index aa28ce4..d262553 100644 --- a/src/main/java/de/hsel/spm/baudas/web/AuthenticationFilter.java +++ b/src/main/java/de/hsel/spm/baudas/web/AuthenticationFilter.java @@ -1,18 +1,11 @@ package de.hsel.spm.baudas.web; -import java.io.IOException; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import javax.servlet.*; import javax.servlet.annotation.WebFilter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import java.io.IOException; /** * Filter implementation class AuthenticationFilter. @@ -51,7 +44,7 @@ public class AuthenticationFilter implements Filter{ String url = req.getRequestURI(); if(url.contains("login") || url.contains("logo") || url.contains("js/")){ chain.doFilter(request, response); - } else if (session == null || !((boolean) session.getAttribute("authentication"))) { //checking whether the session exists and if authentication succeded + } else if (session == null || !((boolean) session.getAttribute("authentication"))) { //checking whether the session exists and if authentication succeed this.context.log("Unauthorized access request"); res.sendRedirect(req.getContextPath() + "/login.html"); } else { diff --git a/src/main/java/de/hsel/spm/baudas/web/LoginServlet.java b/src/main/java/de/hsel/spm/baudas/web/LoginServlet.java index e9e2e6c..ce33667 100644 --- a/src/main/java/de/hsel/spm/baudas/web/LoginServlet.java +++ b/src/main/java/de/hsel/spm/baudas/web/LoginServlet.java @@ -1,8 +1,5 @@ package de.hsel.spm.baudas.web; -import java.io.IOException; -import java.io.PrintWriter; - import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; @@ -10,6 +7,8 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import java.io.IOException; +import java.io.PrintWriter; /** * Servlet implementation class LoginServlet. @@ -31,6 +30,7 @@ public class LoginServlet extends HttpServlet { */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String password = request.getParameter("password"); if (this.password.equals(password)) { HttpSession newSession = request.getSession(true); newSession.setAttribute("authentication", true);