Package main.boundary.account
Class ChangeAccountPassword
java.lang.Object
main.boundary.account.ChangeAccountPassword
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
askToRetry
(UserType userType, String userID) This method is called when the user enters an incorrect password and wants to retry the password change.static void
changePassword
(UserType userType, String userID) This method is called to change the password for a given user account.
-
Constructor Details
-
ChangeAccountPassword
public ChangeAccountPassword()
-
-
Method Details
-
askToRetry
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 aPageBackException
if the user chooses to go back.- Parameters:
userType
- the type of user who wants to change their passworduserID
- the ID of the user who wants to change their password- Throws:
PageBackException
- if the user chooses to go back
-
changePassword
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 aPageBackException
to return to the previous page.- Parameters:
userType
- the type of user who wants to change their passworduserID
- the ID of the user who wants to change their password- Throws:
PageBackException
- if the user chooses to go back
-