mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
19.29.2008 4ad2fdaa1e21efab8c6698202036539af2edb79f
Fix for issue 3624 (Equivalent command-line of 'Reset User Password' should be ldappasswordmodify instead of ldapmodify)

2 files modified
34 ■■■■■ changed files
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/ResetUserPasswordTask.java 32 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/admin_tool.properties 2 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/ResetUserPasswordTask.java
@@ -55,6 +55,7 @@
import org.opends.server.types.DN;
import org.opends.server.types.OpenDsException;
import org.opends.server.util.ServerConstants;
import org.opends.server.util.cli.CommandBuilder;
/**
 * The task called when we want to reset the password of the user.
@@ -210,7 +211,7 @@
      {
        public void run()
        {
          printEquivalentCommandToModify(dn, modifications, useAdminCtx);
          printEquivalentCommand(dn, newPassword, useAdminCtx);
          getProgressDialog().appendProgressHtml(
              Utilities.getProgressWithPoints(
                  INFO_CTRL_PANEL_RESETTING_USER_PASSWORD.get(node.getDN()),
@@ -248,4 +249,33 @@
      state = State.FINISHED_WITH_ERROR;
    }
  }
  /**
   * Prints the equivalent modify command line in the progress dialog.
   * @param dn the dn of the modified entry.
   * @param newPassword the new password.
   * @param useAdminCtx use the administration connector.
   */
  private void printEquivalentCommand(DN dn, char[] newPassword,
      boolean useAdminCtx)
  {
    ArrayList<String> args = new ArrayList<String>();
    args.add(getCommandLinePath("ldappasswordmodify"));
    args.add("--authzID");
    args.add("dn:"+dn);
    args.add("--newPassword");
    args.add(Utilities.OBFUSCATED_VALUE);
    args.addAll(getObfuscatedCommandLineArguments(
        getConnectionCommandLineArguments(useAdminCtx, true)));
    args.add(getNoPropertiesFileArgument());
    StringBuilder sb = new StringBuilder();
    for (String arg : args)
    {
      sb.append(" "+CommandBuilder.escapeValue(arg));
    }
    getProgressDialog().appendProgressHtml(Utilities.applyFont(
        INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_RESET_PASSWORD.get().toString()+
        "<br><b>"+sb.toString()+"</b><br><br>",
        ColorAndFontConstants.progressFont));
  }
}
opendj-sdk/opends/src/messages/messages/admin_tool.properties
@@ -962,6 +962,8 @@
INFO_CTRL_PANEL_RESET_USER_PASSWORD_TASK_DESCRIPTION=Reset password for entry \
'%s'.
INFO_CTRL_PANEL_RESETTING_USER_PASSWORD=Updating password of entry '%s'
INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_RESET_PASSWORD=Equivalent command line to \
 reset the password:
INFO_CTRL_PANEL_RESTART_SERVER_TASK_DESCRIPTION=Restart Server.
INFO_CTRL_PANEL_START_SERVER_TASK_DESCRIPTION=Start Server.