From 2c7b8d6d8c0c177e8089272140dae66b87852ff7 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 17 Jul 2007 21:59:32 +0000
Subject: [PATCH] Implement support for password history functionality. The password history can be maintained either based on the number of previous passwords to remember (e.g., a user cannot re-use any of his/her last five passwords), or the length of time the previous passwords have been retained (e.g., a user cannot re-use any password he/she has had within the last 365 days), or both.
---
opends/src/server/org/opends/server/tools/ManageAccount.java | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/ManageAccount.java b/opends/src/server/org/opends/server/tools/ManageAccount.java
index 7c9b52d..9ab38c7 100644
--- a/opends/src/server/org/opends/server/tools/ManageAccount.java
+++ b/opends/src/server/org/opends/server/tools/ManageAccount.java
@@ -441,6 +441,23 @@
/**
+ * The name of the subcommand that will be used to get the password history
+ * state values.
+ */
+ private static final String SC_GET_PASSWORD_HISTORY = "get-password-history";
+
+
+
+ /**
+ * The name of the subcommand that will be used to clear the password history
+ * state values.
+ */
+ private static final String SC_CLEAR_PASSWORD_HISTORY =
+ "clear-password-history";
+
+
+
+ /**
* The name of the argument that will be used for holding the value(s) to use
* for the target operation.
*/
@@ -760,6 +777,11 @@
printLabelAndValues(msgID, opValues);
break;
+ case OP_GET_PASSWORD_HISTORY:
+ msgID = MSGID_PWPSTATE_LABEL_PASSWORD_HISTORY;
+ printLabelAndValues(msgID, opValues);
+ break;
+
default:
msgID = MSGID_PWPSTATE_INVALID_RESPONSE_OP_TYPE;
String message = getMessage(msgID, opType);
@@ -1130,6 +1152,13 @@
msgID = MSGID_DESCRIPTION_PWPSTATE_GET_SECONDS_UNTIL_REQUIRED_CHANGE_TIME;
new SubCommand(argParser, SC_GET_SECONDS_UNTIL_REQUIRED_CHANGE_TIME,
msgID);
+
+ msgID = MSGID_DESCRIPTION_PWPSTATE_GET_PASSWORD_HISTORY;
+ new SubCommand(argParser, SC_GET_PASSWORD_HISTORY, msgID);
+
+ msgID = MSGID_DESCRIPTION_PWPSTATE_CLEAR_PASSWORD_HISTORY;
+ sc = new SubCommand(argParser, SC_CLEAR_PASSWORD_HISTORY, msgID);
+ sc.setHidden(true);
}
catch (ArgumentException ae)
{
@@ -1645,6 +1674,14 @@
opElements.add(encode(OP_GET_SECONDS_UNTIL_REQUIRED_CHANGE_TIME,
NO_VALUE));
}
+ else if (subCommandName.equals(SC_GET_PASSWORD_HISTORY))
+ {
+ opElements.add(encode(OP_GET_PASSWORD_HISTORY, NO_VALUE));
+ }
+ else if (subCommandName.equals(SC_CLEAR_PASSWORD_HISTORY))
+ {
+ opElements.add(encode(OP_CLEAR_PASSWORD_HISTORY, NO_VALUE));
+ }
else
{
msgID = MSGID_PWPSTATE_INVALID_SUBCOMMAND;
--
Gitblit v1.10.0