From 94c29c40c5ac835fcfd3bd5274fb784b95106638 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Fri, 22 Jul 2011 15:09:27 +0000
Subject: [PATCH] Fix issue OPENDJ-242. Make sure PasswordPolicyState internal state is updated as the operational attributes are in the user entry. Also in the Password Policy State Extended Operation, retrieve the state from the modified entry after the update.
---
opends/src/server/org/opends/server/core/PasswordPolicyState.java | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/opends/src/server/org/opends/server/core/PasswordPolicyState.java b/opends/src/server/org/opends/server/core/PasswordPolicyState.java
index f66e2ee..118fb3a 100644
--- a/opends/src/server/org/opends/server/core/PasswordPolicyState.java
+++ b/opends/src/server/org/opends/server/core/PasswordPolicyState.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
+ * Portions Copyright 2011 ForgeRock AS
*/
package org.opends.server.core;
@@ -1386,19 +1387,17 @@
return;
}
- long highestFailureTime = -1;
- for (Long l : authFailureTimes)
- {
- highestFailureTime = Math.max(l, highestFailureTime);
- }
-
AttributeType type =
DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_FAILURE_TIME_LC,
true);
+ this.authFailureTimes = authFailureTimes;
AttributeBuilder builder = new AttributeBuilder(type);
+ long highestFailureTime = -1;
+
for (Long l : authFailureTimes)
{
+ highestFailureTime = Math.max(l, highestFailureTime);
builder
.add(AttributeValues.create(type, GeneralizedTimeSyntax.format(l)));
}
@@ -2724,6 +2723,8 @@
if (getRequiredChangeTime() != requiredChangeTime)
{
+ this.requiredChangeTime = requiredChangeTime;
+
AttributeType type = DirectoryServer.getAttributeType(
OP_ATTR_PWPOLICY_CHANGED_BY_REQUIRED_TIME, true);
@@ -2757,6 +2758,8 @@
userDNString);
}
+ this.requiredChangeTime = Long.MIN_VALUE;
+
AttributeType type = DirectoryServer.getAttributeType(
OP_ATTR_PWPOLICY_CHANGED_BY_REQUIRED_TIME, true);
if (updateEntry)
@@ -3077,6 +3080,8 @@
userDNString);
}
+ this.graceLoginTimes = graceLoginTimes;
+
AttributeType type =
DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME_LC,
true);
--
Gitblit v1.10.0