Commits

farkas  committed a1f1f08

Issue number: USER-64
Case sensitivity problems when retrieving users from the database.

  • Participants
  • Parent commits cfbcf63

Comments (0)

Files changed (2)

File src/java/com/opensymphony/user/provider/ofbiz/OFBizAbstractProvider.java

             user = EntityUtil.getOnly(getDelegator().findByAnd(userEntity, UtilMisc.toMap("name", name)));
 
             if (exclusiveAccess && (user != null)) {
-                nameCache.put(name, user);
+                // Store the really name instead of the one the user entered (USER-64)
+                nameCache.put(user.getString("name"), user);
             }
         }
 

File src/java/com/opensymphony/user/provider/ofbiz/OFBizCredentialsProvider.java

 
 /**
  * Takes same properties as OFBizAbstractProvider with one addition:
- *
+ * <p/>
  * userSequence - the name of the sequence used to generate user IDs (default: "OSUser")
  *
  * @author <a href="mailto:salaman@qoretech.com">Victor Salaman</a>
  * @author <a href="mailto:mike@atlassian.com">Mike Cannon-Brookes</a>
- * $Revision: 1.1.1.1 $
+ *         $Revision: 1.2 $
  */
 public class OFBizCredentialsProvider extends OFBizAbstractProvider implements CredentialsProvider {
     //~ Static fields/initializers /////////////////////////////////////////////
             LOG.debug("name = " + name);
         }
 
-        accessor.setMutable(true);
+        try {
+            // Retrieve the user from the database and set the name from the database (USER-64)
+            GenericValue user = findUser(name);
+            accessor.setName(user.getString("name"));
+            accessor.setMutable(true);
 
-        return true;
+            return true;
+        } catch (GenericEntityException e) {
+            return false;
+        }
     }
 
     public boolean remove(String name) {