From b795c946b176c49bbdd70353d6ab57eb7d02f187 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 4 Mar 2016 21:08:31 +0100 Subject: [PATCH] Some improvements: - added currentPassword field in loginController - simply copy all user data to the userController instance and you can use it again in forms --- .../beans/login/UserLoginWebSessionBean.java | 17 ++++++++++++++++- .../login/UserLoginWebSessionController.java | 14 ++++++++++++++ .../beans/user/UserWebSessionBean.java | 3 +++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java index d01bba70..dd516430 100644 --- a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java @@ -54,13 +54,18 @@ public class UserLoginWebSessionBean implements UserLoginWebSessionController { */ private static final long serialVersionUID = 47_828_986_719_691_592L; + /** + * Current password + */ + private String currentPassword; + /** * Logged-in user instance */ private User loggedInUser; /** - * Reemote register session bean + * Remote register session bean */ private UserLoginSessionBeanRemote loginBean; @@ -133,6 +138,16 @@ public class UserLoginWebSessionBean implements UserLoginWebSessionController { } } + @Override + public String getCurrentPassword () { + return currentPassword; + } + + @Override + public void setCurrentPassword (final String currentPassword) { + this.currentPassword = currentPassword; + } + @Override public User getLoggedInUser () { return this.loggedInUser; diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java index 31d9b212..0ef4c8e3 100644 --- a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java @@ -81,4 +81,18 @@ public interface UserLoginWebSessionController extends Serializable { * @return Whether the currently logged-in user is invisible */ boolean isInvisible (); + + /** + * Setter for current password (clear text) + *

+ * @param currentPassword Current password + */ + void setCurrentPassword (final String currentPassword); + + /** + * Getter for current password (clear text) + *

+ * @return Current password + */ + String getCurrentPassword (); } diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/user/UserWebSessionBean.java index 83272cac..5a770521 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebSessionBean.java @@ -309,6 +309,9 @@ public class UserWebSessionBean implements UserWebSessionController { // Re-initialize list this.visibleUserList = this.userBean.allMemberPublicVisibleUsers(); + // Copy all data to this bean + this.copyUser(event.getUser()); + // Trace message System.out.println(MessageFormat.format("UserWebBean:afterUserLogin: this.visibleUserList.size()={0} - EXIT!", this.visibleUserList.size())); //NOI18N } -- 2.39.5