svn commit: r590757 - /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: r590757 - /ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java

jaz-3
Author: jaz
Date: Wed Oct 31 10:21:17 2007
New Revision: 590757

URL: http://svn.apache.org/viewvc?rev=590757&view=rev
Log:
applied patch which changes the check for existing userLoginId to be case insensitive

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

Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=590757&r1=590756&r2=590757&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java Wed Oct 31 10:21:17 2007
@@ -39,6 +39,7 @@
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityConditionList;
 import org.ofbiz.entity.condition.EntityExpr;
 import org.ofbiz.entity.condition.EntityOperator;
@@ -450,7 +451,8 @@
         userLoginToCreate.set("currentPassword", useEncryption ? getPasswordHash(currentPassword) : currentPassword);
 
         try {
-            if (delegator.findByPrimaryKey(userLoginToCreate.getPrimaryKey()) != null) {
+            EntityCondition condition = new EntityExpr("userLoginId", true, EntityOperator.EQUALS, userLoginId, true);
+            if (UtilValidate.isNotEmpty(delegator.findByCondition("UserLogin", condition, null, null))) {
                 Map messageMap = UtilMisc.toMap("userLoginId", userLoginId);
                 errMsg = UtilProperties.getMessage(resource,"loginservices.could_not_create_login_user_with_ID_exists", messageMap, locale);
                 errorMessageList.add(errMsg);