svn commit: r431026 - /incubator/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java

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

svn commit: r431026 - /incubator/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java

jonesde
Author: jonesde
Date: Sat Aug 12 05:49:13 2006
New Revision: 431026

URL: http://svn.apache.org/viewvc?rev=431026&view=rev
Log:
Changed userLogin service to work with or without a partyId

Modified:
    incubator/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java

Modified: incubator/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=431026&r1=431025&r2=431026&view=diff
==============================================================================
--- incubator/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java (original)
+++ incubator/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java Sat Aug 12 05:49:13 2006
@@ -34,6 +34,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.serialize.XmlSerializer;
 import org.ofbiz.entity.transaction.GenericTransactionException;
 import org.ofbiz.entity.transaction.TransactionUtil;
@@ -265,8 +266,12 @@
     
                                     if (createHistory) {
                                         Map ulhCreateMap = UtilMisc.toMap("userLoginId", username, "visitId", visitId,
-                                                "fromDate", UtilDateTime.nowTimestamp(),
-                                                "partyId", userLogin.get("partyId"), "successfulLogin", successfulLogin);
+                                                "fromDate", UtilDateTime.nowTimestamp(), "successfulLogin", successfulLogin);
+                                        
+                                        ModelEntity modelUserLogin = userLogin.getModelEntity();
+                                        if (modelUserLogin.isField("partyId")) {
+                                            ulhCreateMap.put("partyId", userLogin.get("partyId"));
+                                        }
     
                                         // ONLY save the password if it was incorrect
                                         if ("N".equals(successfulLogin) && !"false".equals(UtilProperties.getPropertyValue("security.properties", "store.login.history.incorrect.password"))) {