| 1 12 13 package org.openbravo.authentication.basic; 14 15 import java.io.IOException ; 16 import org.openbravo.authentication.AuthenticationException; 17 import javax.servlet.ServletException ; 18 import javax.servlet.http.HttpServlet ; 19 import javax.servlet.http.HttpServletRequest ; 20 import javax.servlet.http.HttpServletResponse ; 21 import org.openbravo.authentication.AuthenticationManager; 22 import org.openbravo.base.HttpBaseUtils; 23 import org.openbravo.base.secureApp.VariablesHistory; 24 import org.openbravo.database.ConnectionProvider; 25 26 30 public class DefaultAuthenticationManager implements AuthenticationManager { 31 32 private ConnectionProvider conn = null; 33 private String strServletSinIdentificar = null; 34 35 36 public DefaultAuthenticationManager() { 37 } 38 39 public String authenticate(HttpServletRequest request) throws AuthenticationException, ServletException , IOException { 40 41 String sUserId = (String ) request.getSession(true).getAttribute("#Authenticated_user"); 42 43 if (sUserId == null || sUserId.equals("")) return null; 44 else return sUserId; 45 } 46 47 public void logout(HttpServletRequest request, HttpServletResponse response) throws ServletException , IOException { 48 49 request.getSession(true).removeAttribute("#Authenticated_user"); 50 response.sendRedirect(HttpBaseUtils.getLocalAddress(request) + "/security/Menu.html"); 51 } 52 } 53 | Popular Tags |