From 187b3cf38ce88550c89e693d532a07efc45e2017 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 10 Aug 2006 20:39:49 +0000
Subject: [PATCH] Fix a problem in which the "must change password" flag in the client connection session was not cleared when a user changed their password.  In addition, the state attribute in the user's entry was not being cleared for modify operations.

---
 opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java b/opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java
index eedeaa2..59e8eb5 100644
--- a/opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java
+++ b/opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java
@@ -928,6 +928,17 @@
         ASN1Sequence valueSequence = new ASN1Sequence(valueElements);
         operation.setResponseValue(new ASN1OctetString(valueSequence.encode()));
       }
+
+
+      // If this was a self password change, and the client is authenticated as
+      // the user whose password was changed, then clear the "must change
+      // password" flag in the client connection.  Note that we're using the
+      // authentication DN rather than the authorization DN in this case to
+      // avoid mistakenly clearing the flag for the wrong user.
+      if (selfChange && (authInfo.getAuthenticationDN().equals(userDN)))
+      {
+        operation.getClientConnection().setMustChangePassword(false);
+      }
     }
     finally
     {

--
Gitblit v1.10.0