public class EditAccountController extends ControllerWithMenu
Modifier and Type | Field and Description |
---|---|
private UserDB |
database |
private EditAccountView |
view |
master
Constructor and Description |
---|
EditAccountController(ControllerMaster master) |
Modifier and Type | Method and Description |
---|---|
private boolean |
isPasswordCorrect(java.lang.String password)
Checks if the password match with the one of the logged in user
|
void |
updateAccountInformation(java.lang.String newUserName,
java.lang.String currentPassword,
java.lang.String newPassword,
java.lang.String newPasswordConfirm)
Checks if the new informations are correct, then update the account informations
|
private java.lang.String |
updatePassword(java.lang.String newPassword)
Updates the password of the logged in User.
|
private void |
updateUsername(java.lang.String newUserName)
Updates the user name in the database and in the session.
|
onHelpViewStatusChanged, onLogout, onShowAllGroceryLists, onShowAllRecipes, onShowEditProfile, onShowHelp, onShowMap, setView
isHelpOpen
private UserDB database
private EditAccountView view
public EditAccountController(ControllerMaster master)
public void updateAccountInformation(java.lang.String newUserName, java.lang.String currentPassword, java.lang.String newPassword, java.lang.String newPasswordConfirm)
newUserName
- currentPassword
- newPassword
- newPasswordConfirm
- private void updateUsername(java.lang.String newUserName) throws UserNameTakenException
newUserName
- StringUserNameTakenException
private boolean isPasswordCorrect(java.lang.String password) throws DatabaseException
DatabaseException
private java.lang.String updatePassword(java.lang.String newPassword) throws UserCreationException, DatabaseException
newPassword
- StringUserCreationException
DatabaseException