Class ChangeAccountPassword

java.lang.Object
main.boundary.account.ChangeAccountPassword

public class ChangeAccountPassword extends Object
This class is responsible for handling the change password feature for a given user account. It contains two methods, changePassword and askToRetry, that are used for this purpose.
  • Constructor Details

    • ChangeAccountPassword

      public ChangeAccountPassword()
  • Method Details

    • askToRetry

      public static void askToRetry(UserType userType, String userID) throws PageBackException
      This method is called when the user enters an incorrect password and wants to retry the password change. It prompts the user to either go back or try again, and throws a PageBackException if the user chooses to go back.
      Parameters:
      userType - the type of user who wants to change their password
      userID - the ID of the user who wants to change their password
      Throws:
      PageBackException - if the user chooses to go back
    • changePassword

      public static void changePassword(UserType userType, String userID) throws PageBackException
      This method is called to change the password for a given user account. It prompts the user for their old password and verifies it, then prompts the user for their new password and verifies that it is entered correctly. If successful, it updates the user's password and displays a success message before throwing a PageBackException to return to the previous page.
      Parameters:
      userType - the type of user who wants to change their password
      userID - the ID of the user who wants to change their password
      Throws:
      PageBackException - if the user chooses to go back