details:   https://code.openbravo.com/erp/devel/pi/rev/2b257cd7a647
changeset: 13750:2b257cd7a647
user:      Stefan Hühner <stefan.huehner <at> openbravo.com>
date:      Sun Sep 11 16:08:32 2011 +0200
summary:   Fixed 18410. Small improvements to error handling
- Fix typo in error message in HttpSecureAppServlet
- Sync load auth-manager loading code from HSAS -> LoginHandler
  - use DefaultAuthManager if class not defined (to be exact also if property
    defined but with empty value)
  - Sync error message to advise admin on what to check

diffstat:

 src/org/openbravo/base/secureApp/HttpSecureAppServlet.java |  2 +-
 src/org/openbravo/base/secureApp/LoginHandler.java         |  9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r c0e7fedd7966 -r 2b257cd7a647 
src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
--- a/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java        Sun Sep 
11 14:55:11 2011 +0200
+++ b/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java        Sun Sep 
11 16:08:32 2011 +0200
@@ -145,7 +145,7 @@
       try {
         m_AuthManager = new DefaultAuthenticationManager(this);
       } catch (AuthenticationException e1) {
-        log4j.error("Error trying to initilize Authentication Manager", e1);
+        log4j.error("Error trying to initialize Authentication Manager", e1);
         return;
       }
     }
diff -r c0e7fedd7966 -r 2b257cd7a647 
src/org/openbravo/base/secureApp/LoginHandler.java
--- a/src/org/openbravo/base/secureApp/LoginHandler.java        Sun Sep 11 
14:55:11 2011 +0200
+++ b/src/org/openbravo/base/secureApp/LoginHandler.java        Sun Sep 11 
16:08:32 2011 +0200
@@ -91,13 +91,18 @@
           AuthenticationManager authManager;
           String authClass = 
OBPropertiesProvider.getInstance().getOpenbravoProperties()
               .getProperty("authentication.class", DEFAULT_AUTH_CLASS);
-
+          if (authClass == null || authClass.equals("")) {
+            // If not defined, load default
+            authClass = 
"org.openbravo.authentication.basic.DefaultAuthenticationManager";
+          }
           try {
             authManager = (AuthenticationManager) 
OBClassLoader.getInstance().loadClass(authClass)
                 .newInstance();
             authManager.init(this);
           } catch (Exception e) {
-            log4j.error("Error trying to instantiate auth-manager class: " + 
e.getMessage(), e);
+            log4j
+                .error("Defined authentication manager cannot be loaded. 
Verify the 'authentication.class' entry in Openbravo.properties");
+
             authManager = new DefaultAuthenticationManager(this);
           }
 

------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage 
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to