~ someone removed the password parameter
Signed-off-by: Johannes Theiner <j.theiner@live.de> #SPM-25: add work 20m testing
This commit is contained in:
parent
e24a6147a5
commit
441cf59a4f
@ -27,7 +27,7 @@ public class ShoppingTimes implements Analysis<Map<DayHour, Integer>> {
|
||||
/**
|
||||
* 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<DayHour, Integer> getResult() {
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user