Author: jonesde
Date: Sat Aug 12 05:57:37 2006
New Revision: 431028
URL:
http://svn.apache.org/viewvc?rev=431028&view=revLog:
Fixed package in login events; in LoginWorker changed to work with or without the party component
Modified:
incubator/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java
incubator/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
Modified: incubator/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java?rev=431028&r1=431027&r2=431028&view=diff==============================================================================
--- incubator/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java (original)
+++ incubator/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java Sat Aug 12 05:57:37 2006
@@ -31,6 +31,7 @@
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.common.login.LoginServices;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
Modified: incubator/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java?rev=431028&r1=431027&r2=431028&view=diff==============================================================================
--- incubator/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java (original)
+++ incubator/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java Sat Aug 12 05:57:37 2006
@@ -41,6 +41,7 @@
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.model.ModelEntity;
import org.ofbiz.entity.transaction.GenericTransactionException;
import org.ofbiz.entity.transaction.TransactionUtil;
import org.ofbiz.security.Security;
@@ -346,13 +347,17 @@
HttpSession session = request.getSession();
session.setAttribute("userLogin", userLogin);
- try {
- GenericValue person = userLogin.getRelatedOne("Person");
- GenericValue partyGroup = userLogin.getRelatedOne("PartyGroup");
- if (person != null) session.setAttribute("person", person);
- if (partyGroup != null) session.setAttribute("partyGroup", partyGroup);
- } catch (GenericEntityException e) {
- Debug.logError(e, "Error getting person/partyGroup info for session, ignoring...", module);
+ ModelEntity modelUserLogin = userLogin.getModelEntity();
+ if (modelUserLogin.isField("partyId")) {
+ // if partyId is a field, then we should have these relations defined
+ try {
+ GenericValue person = userLogin.getRelatedOne("Person");
+ GenericValue partyGroup = userLogin.getRelatedOne("PartyGroup");
+ if (person != null) session.setAttribute("person", person);
+ if (partyGroup != null) session.setAttribute("partyGroup", partyGroup);
+ } catch (GenericEntityException e) {
+ Debug.logError(e, "Error getting person/partyGroup info for session, ignoring...", module);
+ }
}
// let the visit know who the user is