Package app.controller.user
Class UserAccountManagementController
java.lang.Object
app.controller.user.UserAccountManagementController
The
UserAccountManagementController class manages user account
operations within the system.
It includes methods for changing passwords, retrieving forgotten passwords,
and verifying user credentials.
Key functionalities include:
- Changing a user's password.
- Handling forgotten password scenarios.
- Verifying user passwords and emails.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanPlaceholder method for account security checks.static booleanchangePassword(String username, String oldPassword, String newPassword) Changes a user's password if the old password provided is correct.static StringforgetPassword(String username, String email) Retrieves the user's password if the provided email matches the one associated with the username.static booleanverifyEmail(String username, String email) Verifies if the given email matches the email of the specified user.static booleanverifyPassword(String username, String password) Verifies if the given password matches the password of the specified user.
-
Method Details
-
changePassword
Changes a user's password if the old password provided is correct.- Parameters:
username- The username of the user whose password is being changed.oldPassword- The current password of the user for verification.newPassword- The new password to set for the user.- Returns:
- boolean True if the password change is successful, false if the old password is incorrect.
-
forgetPassword
Retrieves the user's password if the provided email matches the one associated with the username. Used in scenarios where a user forgets their password.- Parameters:
username- The username of the user who forgot their password.email- The email to be validated against the user's email.- Returns:
- String The user's password if the email matches, or null if it does not.
-
verifyPassword
Verifies if the given password matches the password of the specified user.- Parameters:
username- The username of the user whose password is to be verified.password- The password to check against the user's actual password.- Returns:
- boolean True if the provided password matches the user's password, false otherwise.
-
verifyEmail
Verifies if the given email matches the email of the specified user.- Parameters:
username- The username of the user whose email is to be verified.email- The email to check against the user's actual email.- Returns:
- boolean True if the provided email matches the user's email, false otherwise.
-
AccountSecurity
public static boolean AccountSecurity()Placeholder method for account security checks. Currently, it always returns true.- Returns:
- boolean Always returns true.
-