backed out previous changesets
authorAsier Lostalé <asier.lostale@openbravo.com>
Thu, 26 May 2016 15:55:44 +0200
changeset 29589 6b69927ae231
parent 29588 c3c6476b093d
child 29590 65a012587054
backed out previous changesets

accidentally commited to pi
README
modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
src/org/openbravo/base/secureApp/LoginUtils.java
--- a/README	Thu May 26 09:50:08 2016 +0200
+++ b/README	Thu May 26 15:55:44 2016 +0200
@@ -1,4 +1,4 @@
-  This is the development trunk of Openbravo ERP.
+ This is the development trunk of Openbravo ERP.
 
 * Installation
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java	Thu May 26 09:50:08 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java	Thu May 26 15:55:44 2016 +0200
@@ -473,10 +473,6 @@
               toSaveStr(language.getLanguage()), (language.isRTLLanguage() ? "Y" : "N"),
               toSaveStr(roleId), toSaveStr(clientId), toSaveStr(organizationId),
               toSaveStr(warehouseId));
-
-      log4j.info("Session reset. Session Id: " + sessionID + " - user: " + sessionUser
-          + " - role: " + roleId + " - client: " + clientId + " - org: " + organizationId);
-
       if (!result) {
         throw new IllegalArgumentException("Error when saving default values");
       }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Thu May 26 09:50:08 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Thu May 26 15:55:44 2016 +0200
@@ -1574,7 +1574,11 @@
     return ret;
   },
 
-  updateRowCountDisplay: function () {
+  updateRowCountDisplay: function (delayed) {
+    if (!delayed) {
+      this.delayCall('updateRowCountDisplay', [true], 100);
+      return;
+    }
     var newValue = '',
         length = isc.isA.Tree(this.data) ? this.countGroupContent() : this.data.getLength();
     if (length > this.dataPageSize) {
--- a/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java	Thu May 26 09:50:08 2016 +0200
+++ b/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java	Thu May 26 15:55:44 2016 +0200
@@ -32,6 +32,8 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import net.sf.jasperreports.engine.JRDataSource;
+
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.authentication.AuthenticationManager;
@@ -70,8 +72,6 @@
 import org.openbravo.utils.Replace;
 import org.openbravo.xmlEngine.XmlDocument;
 
-import net.sf.jasperreports.engine.JRDataSource;
-
 public class HttpSecureAppServlet extends HttpBaseServlet {
   private static final long serialVersionUID = 1L;
   protected boolean boolHist = true;
@@ -270,7 +270,7 @@
             strWarehouse = "";
           } else {
             RoleDefaults defaults = LoginUtils.getLoginDefaults(strUserAuth, variables.getRole(),
-                this, request);
+                this);
             strRole = defaults.role;
             strClient = defaults.client;
             strOrg = defaults.org;
--- a/src/org/openbravo/base/secureApp/LoginUtils.java	Thu May 26 09:50:08 2016 +0200
+++ b/src/org/openbravo/base/secureApp/LoginUtils.java	Thu May 26 15:55:44 2016 +0200
@@ -21,7 +21,6 @@
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.openbravo.base.HttpBaseUtils;
 import org.openbravo.base.exception.OBException;
@@ -36,7 +35,6 @@
 import org.openbravo.erpCommon.utility.PropertyException;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.ad.access.RoleOrganization;
-import org.openbravo.model.ad.access.Session;
 import org.openbravo.model.ad.domain.Preference;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.service.db.DalConnectionProvider;
@@ -134,52 +132,16 @@
     return valid;
   }
 
-  private static boolean validRoleOrg(ConnectionProvider conn, String role, String org,
-      HttpServletRequest request) throws ServletException {
+  static boolean validRoleOrg(ConnectionProvider conn, String role, String org)
+      throws ServletException {
     boolean valid = SeguridadData.isLoginRoleOrg(conn, role, org);
     if (!valid) {
       log4j.error("Login organization is not in role organizations list. Role: " + role + ", Org: "
-          + org);
-
-      if (request != null) {
-
-        String sessionId = (String) request.getSession().getAttribute("#AD_SESSION_ID");
-
-        log4j.error("SessionId: " + sessionId + " - loggging in: "
-            + request.getSession().getAttribute("#LOGGINGIN") + " - forceLogin: "
-            + request.getSession().getAttribute("forceLogin"));
-
-        log4j.error("request URI: " + request.getRequestURI());
-
-        if (StringUtils.isNotBlank(sessionId)) {
-          OBContext.setAdminMode(false);
-          try {
-            Session session = OBDal.getInstance().get(Session.class, sessionId);
-            if (session != null) {
-              log4j.error("Session: [ active:" + session.isActive() + " - session_active:"
-                  + session.isSessionActive() + " - status: " + session.getLoginStatus()
-                  + " - user:" + session.getUsername() + " - " + session.getCreationDate() + " ]");
-            } else {
-              log4j.error("No session in DB");
-            }
-          } catch (Exception e) {
-            log4j.error("Couldn't log info", e);
-          } finally {
-            OBContext.restorePreviousMode();
-          }
-        }
-      }
-
-      log4j.error("stack trace", new Exception());
+          + org, new Exception("stack trace"));
     }
     return valid;
   }
 
-  static boolean validRoleOrg(ConnectionProvider conn, String role, String org)
-      throws ServletException {
-    return validRoleOrg(conn, role, org, null);
-  }
-
   public static List<RoleOrganization> loadRoleOrganization(String strRol) {
 
     OBContext.setAdminMode();
@@ -422,17 +384,9 @@
   /**
    * Obtains defaults defined for a user and throws DefaultValidationException in case they are not
    * correct.
-   * 
-   * @param variables
    */
   public static RoleDefaults getLoginDefaults(String strUserAuth, String role, ConnectionProvider cp)
       throws ServletException, DefaultValidationException {
-    return getLoginDefaults(strUserAuth, role, cp, null);
-  }
-
-  public static RoleDefaults getLoginDefaults(String strUserAuth, String role,
-      ConnectionProvider cp, HttpServletRequest request) throws ServletException,
-      DefaultValidationException {
     String strRole = role;
     if (strRole.equals("")) {
       // use default role
@@ -446,7 +400,7 @@
 
     String strOrg = DefaultOptionsData.defaultOrg(cp, strUserAuth);
     // use default org
-    if (strOrg == null || !LoginUtils.validRoleOrg(cp, strRole, strOrg, request)) {
+    if (strOrg == null || !LoginUtils.validRoleOrg(cp, strRole, strOrg)) {
       // if default not set or not valid take any one
       strOrg = DefaultOptionsData.getDefaultOrg(cp, strRole);
     }
@@ -658,5 +612,4 @@
     }
     return strWarehouse;
   }
-
 }