syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1382938 - in /incubator/syncope/trunk: ./ core/src/main/java/org/apache/syncope/core/util/ConnObjectUtil.java
Date Mon, 10 Sep 2012 15:19:22 GMT
Author: ilgrosso
Date: Mon Sep 10 15:19:21 2012
New Revision: 1382938

URL: http://svn.apache.org/viewvc?rev=1382938&view=rev
Log:
Merge from 1_0_X

Modified:
    incubator/syncope/trunk/   (props changed)
    incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnObjectUtil.java

Propchange: incubator/syncope/trunk/
------------------------------------------------------------------------------
  Merged /incubator/syncope/branches/1_0_X:r1382900-1382936

Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnObjectUtil.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnObjectUtil.java?rev=1382938&r1=1382937&r2=1382938&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnObjectUtil.java
(original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnObjectUtil.java
Mon Sep 10 15:19:21 2012
@@ -81,14 +81,14 @@ public class ConnObjectUtil {
      * Build an UserTO out of connector object attributes and schema mapping.
      *
      * @param obj connector object
+     * @param syncTask synchronization task
      * @return UserTO for the user to be created
      */
     @Transactional(readOnly = true)
     public UserTO getUserTO(final ConnectorObject obj, final SyncTask syncTask) {
-
         UserTO userTO = getUserTOFromConnObject(obj, syncTask);
 
-        // 3. if password was not set above, generate a random string
+        // if password was not set above, generate a random string
         if (StringUtils.isBlank(userTO.getPassword())) {
             userTO.setPassword(RandomStringUtils.randomAlphanumeric(16));
         }
@@ -101,6 +101,7 @@ public class ConnObjectUtil {
      *
      * @param userId user to be updated
      * @param obj connector object
+     * @param syncTask synchronization task
      * @return UserMod for the user to be updated
      */
     @Transactional(readOnly = true)
@@ -113,11 +114,9 @@ public class ConnObjectUtil {
         final UserTO updated = getUserTOFromConnObject(obj, syncTask);
         updated.setId(userId);
 
-        if (StringUtils.isNotBlank(updated.getPassword())) {
-            // update password if and only if password has really changed
-            if (userDataBinder.verifyPassword(user, updated.getPassword())) {
-                updated.setPassword(null);
-            }
+        // update password if and only if password is really changed
+        if (StringUtils.isBlank(updated.getPassword()) || userDataBinder.verifyPassword(user,
updated.getPassword())) {
+            updated.setPassword(null);
         }
 
         final UserMod userMod = AttributableOperations.diff(updated, original, true);



Mime
View raw message