You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2018/09/17 10:12:06 UTC
[3/3] syncope git commit: [SYNCOPE-1372] Restoring check before
insertion into password history
[SYNCOPE-1372] Restoring check before insertion into password history
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/3e0c0035
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/3e0c0035
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/3e0c0035
Branch: refs/heads/master
Commit: 3e0c00355bec768d3c798b44111b57dfc709ea16
Parents: b8d4010
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Sep 17 12:08:08 2018 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Sep 17 12:11:50 2018 +0200
----------------------------------------------------------------------
.../org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/3e0c0035/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
index cbe6159..b85147f 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
@@ -320,7 +320,9 @@ public class JPAUserDAO extends AbstractAnyDAO<User> implements UserDAO {
}
// update user's password history with encrypted password
- if (maxPPSpecHistory > 0 && user.getPassword() != null) {
+ if (maxPPSpecHistory > 0 && user.getPassword() != null
+ && !user.getPasswordHistory().contains(user.getPassword())) {
+
user.getPasswordHistory().add(user.getPassword());
}
// keep only the last maxPPSpecHistory items in user's password history