svn commit: r1040651 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1040651 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java

jonesde
Author: jonesde
Date: Tue Nov 30 17:35:05 2010
New Revision: 1040651

URL: http://svn.apache.org/viewvc?rev=1040651&view=rev
Log:
Undo part of the changes from Hans in rev 1037624 which caused the system to reset the delegator to the base delegator and ignore the user's specified tenant

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java?rev=1040651&r1=1040650&r2=1040651&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ContextFilter.java Tue Nov 30 17:35:05 2010
@@ -299,6 +299,7 @@ public class ContextFilter implements Fi
                     
                     // make that tenant active, setup a new delegator and a new dispatcher
                     String tenantDelegatorName = delegator.getDelegatorBaseName() + "#" + tenantId;
+                    httpRequest.getSession().setAttribute("delegatorName", tenantDelegatorName);
                 
                     // after this line the delegator is replaced with the new per-tenant delegator
                     delegator = DelegatorFactory.getDelegator(tenantDelegatorName);
@@ -323,8 +324,11 @@ public class ContextFilter implements Fi
                     request.setAttribute("tenantId", tenantId);
                 }
                 
-                // always put delegator's name to the session
-                httpRequest.getSession().setAttribute("delegatorName", delegator.getDelegatorName());
+                // NOTE DEJ20101130: do NOT always put the delegator name in the user's session because the user may
+                // have logged in and specified a tenant, and even if no Tenant record with a matching domainName field
+                // is found this will change the user's delegator back to the base one instead of the one for the
+                // tenant specified on login
+                // httpRequest.getSession().setAttribute("delegatorName", delegator.getDelegatorName());
             } catch (GenericEntityException e) {
                 Debug.logWarning(e, "Unable to get Tenant", module);
             }