src/index.jsp
changeset 12524 3bf5295a7f03
parent 12425 0f8274676fcf
child 12927 0fa43a9749aa
equal deleted inserted replaced
12523:b1d467810763 12524:3bf5295a7f03
     1 <%@ page import="java.util.Properties" %>
     1 <%@ page import="java.util.Properties" %>
     2 <%@ page import="org.openbravo.base.HttpBaseServlet" %>
     2 <%@ page import="org.openbravo.base.HttpBaseServlet" %>
     3 <%@ page import="org.openbravo.base.util.OBClassLoader" %>
     3 <%@ page import="org.openbravo.base.util.OBClassLoader" %>
     4 <%@ page import="org.openbravo.base.session.OBPropertiesProvider" %>
     4 <%@ page import="org.openbravo.base.session.OBPropertiesProvider" %>
     5 <%@ page import="org.openbravo.authentication.AuthenticationManager" %>
     5 <%@ page import="org.openbravo.authentication.AuthenticationManager" %>
       
     6 <%@ page import="org.apache.log4j.Logger" %>
     6 <%@ page contentType="text/html; charset=UTF-8" %>
     7 <%@ page contentType="text/html; charset=UTF-8" %>
     7 <%
     8 <%
     8 /*
     9 /*
     9  *************************************************************************
    10  *************************************************************************
    10  * The contents of this file are subject to the Openbravo  Public  License
    11  * The contents of this file are subject to the Openbravo  Public  License
    21  * All portions are Copyright (C) 2011 Openbravo SLU
    22  * All portions are Copyright (C) 2011 Openbravo SLU
    22  * All Rights Reserved. 
    23  * All Rights Reserved. 
    23  * Contributor(s):  ______________________________________.
    24  * Contributor(s):  ______________________________________.
    24  ************************************************************************
    25  ************************************************************************
    25  */
    26  */
    26  
    27 
       
    28 Logger log = Logger.getLogger(org.openbravo.authentication.AuthenticationManager.class); 
    27 Properties obProperties = OBPropertiesProvider.getInstance().getOpenbravoProperties();
    29 Properties obProperties = OBPropertiesProvider.getInstance().getOpenbravoProperties();
    28 String authClass = obProperties.getProperty("authentication.class");
    30 String authClass = obProperties.getProperty("authentication.class");
    29 
    31 
    30 if(authClass == null || authClass.equals("")) {
    32 if(authClass == null || authClass.equals("")) {
    31   authClass = "org.openbravo.authentication.basic.DefaultAuthenticationManager";
    33   authClass = "org.openbravo.authentication.basic.DefaultAuthenticationManager";
    32 }
    34 }
    33 
    35 
    34 AuthenticationManager authManager = (AuthenticationManager) OBClassLoader.getInstance().loadClass(authClass).newInstance();
    36 AuthenticationManager authManager = null;
       
    37 try {
       
    38   authManager = (AuthenticationManager) OBClassLoader.getInstance().loadClass(authClass).newInstance();
       
    39 } catch (ClassNotFoundException cnfe) {
       
    40   log.error("Defined authentication manager cannot be loaded. Verify the 'authentication.class' entry in Openbravo.properties");
       
    41   authManager = new org.openbravo.authentication.basic.DefaultAuthenticationManager();
       
    42 }
    35 
    43 
    36 HttpBaseServlet s = new HttpBaseServlet(); // required for ConnectionProvider
    44 HttpBaseServlet s = new HttpBaseServlet(); // required for ConnectionProvider
    37 s.init(getServletConfig());
    45 s.init(getServletConfig());
    38 s.initialize(request, response);
    46 s.initialize(request, response);
    39 
    47