X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=security%2Fruntime%2Forg.argeo.security.ldap%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fsecurity%2Fldap%2Fjcr%2FJcrLdapSynchronizer.java;h=632ea58c8778e8c92fab438744faf1cfc98885be;hb=6a3abb7baeb17b06ab05fb9a35056e3e224698ad;hp=0f59f1ee528c11561e8d9a67b6d4a3c13bb4b1d0;hpb=0e0128a5937cd74efd5b64e422727e6cc3284c40;p=lgpl%2Fargeo-commons.git diff --git a/security/runtime/org.argeo.security.ldap/src/main/java/org/argeo/security/ldap/jcr/JcrLdapSynchronizer.java b/security/runtime/org.argeo.security.ldap/src/main/java/org/argeo/security/ldap/jcr/JcrLdapSynchronizer.java index 0f59f1ee5..632ea58c8 100644 --- a/security/runtime/org.argeo.security.ldap/src/main/java/org/argeo/security/ldap/jcr/JcrLdapSynchronizer.java +++ b/security/runtime/org.argeo.security.ldap/src/main/java/org/argeo/security/ldap/jcr/JcrLdapSynchronizer.java @@ -229,7 +229,7 @@ public class JcrLdapSynchronizer implements UserDetailsContextMapper, * * @return path to user profile */ - protected String mapLdapToJcr(DirContextAdapter ctx) { + protected synchronized String mapLdapToJcr(DirContextAdapter ctx) { Session session = securitySession; try { // process @@ -238,6 +238,20 @@ public class JcrLdapSynchronizer implements UserDetailsContextMapper, Node userProfile; // = userHome.getNode(ARGEO_PROFILE); if (userHome.hasNode(ARGEO_PROFILE)) { userProfile = userHome.getNode(ARGEO_PROFILE); + + // compatibility with legacy, will be removed + if (!userProfile.hasProperty(ARGEO_ENABLED)) { + session.getWorkspace().getVersionManager() + .checkout(userProfile.getPath()); + userProfile.setProperty(ARGEO_ENABLED, true); + userProfile.setProperty(ARGEO_ACCOUNT_NON_EXPIRED, true); + userProfile.setProperty(ARGEO_ACCOUNT_NON_LOCKED, true); + userProfile + .setProperty(ARGEO_CREDENTIALS_NON_EXPIRED, true); + session.save(); + session.getWorkspace().getVersionManager() + .checkin(userProfile.getPath()); + } } else { userProfile = JcrUtils.createUserProfile(securitySession, username);