syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmarte...@apache.org
Subject [1/3] syncope git commit: [SYNCOPE-646] fix on branch 1_2_X
Date Fri, 20 Feb 2015 10:46:48 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 9cbeffd39 -> fecf301a8


[SYNCOPE-646] fix on branch 1_2_X


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/1012e616
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/1012e616
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/1012e616

Branch: refs/heads/master
Commit: 1012e616598d3ff8e42460d4a2eb8f0eeca6504e
Parents: 583e839
Author: fmartelli <fabio.martelli@gmail.com>
Authored: Fri Feb 20 10:51:59 2015 +0100
Committer: fmartelli <fabio.martelli@gmail.com>
Committed: Fri Feb 20 10:51:59 2015 +0100

----------------------------------------------------------------------
 .../propagation/impl/PropagationManager.java    |  2 +-
 .../activiti/ActivitiUserWorkflowAdapter.java   | 11 ++++++++
 .../syncope/core/rest/UserSelfTestITCase.java   |  2 +-
 .../syncope/core/rest/UserTestITCase.java       | 28 ++++++++++++++++++++
 4 files changed, 41 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/1012e616/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java
b/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java
index fcd7110..4ec1964 100644
--- a/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java
+++ b/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java
@@ -305,7 +305,7 @@ public class PropagationManager {
         List<PropagationTask> tasks = new ArrayList<PropagationTask>();
         if (userMod.getPwdPropRequest() == null) {
             // a. no specific password propagation request: generate propagation tasks for
any resource associated
-            tasks = getUserUpdateTaskIds(wfResult, true, null);
+            tasks = getUserUpdateTaskIds(wfResult, false, null);
         } else {
             // b. generate the propagation task list in two phases: first the ones containing
password,
             // the the rest (with no password)

http://git-wip-us.apache.org/repos/asf/syncope/blob/1012e616/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java
b/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java
index f6cc322..00fa956 100644
--- a/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java
+++ b/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java
@@ -65,6 +65,7 @@ import org.apache.syncope.common.types.ResourceOperation;
 import org.apache.syncope.common.types.WorkflowFormPropertyType;
 import org.apache.syncope.common.util.BeanUtils;
 import org.apache.syncope.common.SyncopeClientException;
+import org.apache.syncope.common.mod.StatusMod;
 import org.apache.syncope.core.persistence.beans.user.SyncopeUser;
 import org.apache.syncope.core.persistence.dao.NotFoundException;
 import org.apache.syncope.core.persistence.validation.attrvalue.ParsingValidationException;
@@ -879,6 +880,16 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter
{
             userMod = new UserMod();
             userMod.setId(updated.getId());
             userMod.setPassword(clearPassword);
+
+            if (propByRes != null) {
+                final StatusMod st = new StatusMod();
+                userMod.setPwdPropRequest(st);
+
+                st.setOnSyncope(true);
+                for (String res : propByRes.get(ResourceOperation.CREATE)) {
+                    st.getResourceNames().add(res);
+                }
+            }
         }
 
         return new WorkflowResult<UserMod>(userMod, propByRes, postTasks);

http://git-wip-us.apache.org/repos/asf/syncope/blob/1012e616/core/src/test/java/org/apache/syncope/core/rest/UserSelfTestITCase.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/syncope/core/rest/UserSelfTestITCase.java b/core/src/test/java/org/apache/syncope/core/rest/UserSelfTestITCase.java
index 3fa50e2..aaf5347 100644
--- a/core/src/test/java/org/apache/syncope/core/rest/UserSelfTestITCase.java
+++ b/core/src/test/java/org/apache/syncope/core/rest/UserSelfTestITCase.java
@@ -93,7 +93,7 @@ public class UserSelfTestITCase extends AbstractTest {
         membership.setRoleId(3L);
         userTO.getMemberships().add(membership);
         userTO.getResources().add(RESOURCE_NAME_TESTDB);
-
+        
         SyncopeClient anonClient = clientFactory.createAnonymous();
         userTO = anonClient.getService(UserSelfService.class).
                 create(userTO, true).

http://git-wip-us.apache.org/repos/asf/syncope/blob/1012e616/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java b/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
index 3a91aa0..a17e75b 100644
--- a/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
+++ b/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
@@ -1069,6 +1069,11 @@ public class UserTestITCase extends AbstractTest {
         userMod.setId(userTO.getId());
         userMod.setPassword("123password");
         userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
+        
+        final StatusMod st = new StatusMod();
+        st.setOnSyncope(false);
+        st.getResourceNames().add(RESOURCE_NAME_TESTDB);
+        userMod.setPwdPropRequest(st);
 
         userTO = updateUser(userMod);
         assertNotNull(userTO);
@@ -1558,6 +1563,11 @@ public class UserTestITCase extends AbstractTest {
         UserMod userMod = new UserMod();
         userMod.setId(userTO.getId());
         userMod.getResourcesToAdd().add(RESOURCE_NAME_WS1);
+        
+        final StatusMod st = new StatusMod();
+        st.setOnSyncope(false);
+        st.getResourceNames().add(RESOURCE_NAME_WS1);
+        userMod.setPwdPropRequest(st);        
 
         userTO = updateUser(userMod);
         assertNotNull(userTO);
@@ -1588,6 +1598,12 @@ public class UserTestITCase extends AbstractTest {
         UserMod userMod = new UserMod();
         userMod.setId(userTO.getId());
         userMod.getResourcesToAdd().add(RESOURCE_NAME_LDAP);
+
+        final StatusMod st = new StatusMod();
+        st.setOnSyncope(false);
+        st.getResourceNames().add(RESOURCE_NAME_LDAP);
+        userMod.setPwdPropRequest(st);
+        
         userTO = updateUser(userMod);
         assertNotNull(userTO);
 
@@ -2302,6 +2318,12 @@ public class UserTestITCase extends AbstractTest {
         UserMod userMod = new UserMod();
         userMod.setId(user.getId());
         userMod.getResourcesToAdd().add(RESOURCE_NAME_TESTDB);
+
+        final StatusMod st = new StatusMod();
+        st.setOnSyncope(false);
+        st.getResourceNames().add(RESOURCE_NAME_TESTDB);
+        userMod.setPwdPropRequest(st);
+        
         user = updateUser(userMod);
         assertNotNull(user);
         assertEquals(1, user.getResources().size());
@@ -2339,6 +2361,12 @@ public class UserTestITCase extends AbstractTest {
         UserMod userMod = new UserMod();
         userMod.setId(user.getId());
         userMod.getResourcesToAdd().add(RESOURCE_NAME_LDAP);
+        
+        final StatusMod st = new StatusMod();
+        st.setOnSyncope(false);
+        st.getResourceNames().add(RESOURCE_NAME_LDAP);
+        userMod.setPwdPropRequest(st);
+
         user = updateUser(userMod);
         assertNotNull(user);
         assertEquals(1, user.getResources().size());


Mime
View raw message