From 6a8604cfddb8f6d80773da800b989b59729268d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 3 May 2016 13:45:08 +0200 Subject: [PATCH] renamed controller as there are now 2 logins + converted CRLF->LF MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../contact/PizzaContactWebSessionBean.java | 16 +-- .../login/PizzaUserLoginWebSessionBean.java | 11 +- .../PizzaUserProfileWebRequestBean.java | 2 +- .../password/PizzaUserPasswordValidator.java | 7 +- .../templates.dist/guest_login_page.xhtml | 3 +- .../admin/cellphone/admin_cellphone_data.tpl | 114 +++++++++--------- .../templates/guest/guest_login_form.tpl | 2 +- web/WEB-INF/templates/login/login_base.tpl | 19 ++- .../login/login_enter_current_password.tpl | 27 +++++ web/imprint.xhtml | 2 +- web/login/login_add_addressbook.xhtml | 51 ++++++++ web/login/login_change_email_address.xhtml | 83 +++++++++++++ web/login/login_change_password.xhtml | 71 +++++++++++ web/login/login_change_personal_data.xhtml | 45 +++++++ web/login/login_contact_data_saved.xhtml | 4 +- web/login/login_data_saved.xhtml | 30 +++++ web/login/login_edit_user_data.xhtml | 50 ++++++++ web/login/login_index.xhtml | 28 +++++ web/login/login_own_addressbooks.xhtml | 67 ++++++++++ web/login/login_user_data_saved.xhtml | 4 +- web/privacy.xhtml | 2 +- web/terms.xhtml | 2 +- web/user/show_addressbook.xhtml | 56 +++++++++ web/user/user_list.xhtml | 39 ++++++ web/user/user_profile.xhtml | 48 ++++++++ 25 files changed, 699 insertions(+), 84 deletions(-) create mode 100644 web/WEB-INF/templates/login/login_enter_current_password.tpl create mode 100644 web/login/login_add_addressbook.xhtml create mode 100644 web/login/login_change_email_address.xhtml create mode 100644 web/login/login_change_password.xhtml create mode 100644 web/login/login_change_personal_data.xhtml create mode 100644 web/login/login_data_saved.xhtml create mode 100644 web/login/login_edit_user_data.xhtml create mode 100644 web/login/login_index.xhtml create mode 100644 web/login/login_own_addressbooks.xhtml create mode 100644 web/user/show_addressbook.xhtml create mode 100644 web/user/user_list.xhtml create mode 100644 web/user/user_profile.xhtml diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java index 0ab69d5b..da24b417 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaContactWebSessionBean.java @@ -176,7 +176,7 @@ public class PizzaContactWebSessionBean implements PizzaContactWebSessionControl * Login bean (controller) */ @Inject - private PizzaUserLoginWebSessionController loginController; + private PizzaUserLoginWebSessionController userLoginController; /** * Phone number area code @@ -512,24 +512,24 @@ public class PizzaContactWebSessionBean implements PizzaContactWebSessionControl @Override public String doChangePersonalContactData () { // This method shall only be called if the user is logged-in - if (!this.loginController.isUserLoggedIn()) { + if (!this.userLoginController.isUserLoggedIn()) { // Not logged-in throw new IllegalStateException("User is not logged-in"); //NOI18N } else if (!this.isRequiredChangePersonalDataSet()) { // Not all required fields are set throw new FaceletException("Not all required fields are set."); //NOI18N - } else if (!this.loginController.ifCurrentPasswordMatches()) { + } else if (!this.userLoginController.ifCurrentPasswordMatches()) { // Password not matching - throw new FaceletException(new UserPasswordMismatchException(this.loginController.getLoggedInUser())); + throw new FaceletException(new UserPasswordMismatchException(this.userLoginController.getLoggedInUser())); } // Get contact instance - Contact contact = this.loginController.getLoggedInUser().getUserContact(); + Contact contact = this.userLoginController.getLoggedInUser().getUserContact(); // It should be there, so run some tests on it - assert (contact instanceof Contact) : "Instance loginController.loggedInUser.userContact is null"; //NOI18N - assert (contact.getContactId() instanceof Long) : "Instance loginController.userContact.contactId is null"; //NOI18N - assert (contact.getContactId() > 0) : MessageFormat.format("Instance loginController.userContact.contactId={0} is invalid", contact.getContactId()); //NOI18N + assert (contact instanceof Contact) : "Instance userLoginController.loggedInUser.userContact is null"; //NOI18N + assert (contact.getContactId() instanceof Long) : "Instance userLoginController.userContact.contactId is null"; //NOI18N + assert (contact.getContactId() > 0) : MessageFormat.format("Instance userLoginController.userContact.contactId={0} is invalid", contact.getContactId()); //NOI18N // Update all fields contact.setContactGender(this.getGender()); diff --git a/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java index c8ea10b6..0c8a886e 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java @@ -103,7 +103,7 @@ public class PizzaUserLoginWebSessionBean implements PizzaUserLoginWebSessionCon Context context = new InitialContext(); // Try to lookup - this.loginBean = (UserLoginSessionBeanRemote) context.lookup("java:global/PizzaService-ejb/login!org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote"); //NOI18N + this.loginBean = (UserLoginSessionBeanRemote) context.lookup("java:global/jrecruiter-ejb/login!org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote"); //NOI18N } catch (final NamingException ex) { // Continue to throw throw new FaceletException(ex); @@ -141,7 +141,7 @@ public class PizzaUserLoginWebSessionBean implements PizzaUserLoginWebSessionCon @Override public String getCurrentPassword () { - return this.currentPassword; + return currentPassword; } @Override @@ -206,11 +206,16 @@ public class PizzaUserLoginWebSessionBean implements PizzaUserLoginWebSessionCon @Override public boolean isUserLoggedIn () { + // Trace message + // NOISY-DEBUG System.out.println(MessageFormat.format("RecruiterUserLoginWebSessionBean:isUserLoggedIn: this.loggedInUser={0},this.templateType={1} - CALLED!", this.getLoggedInUser(), this.getTemplateType())); + // Compare instance this.userLoggedIn = ((this.getLoggedInUser() instanceof User) && (Objects.equals(this.getLoggedInUser().getUserAccountStatus(), UserAccountStatus.CONFIRMED))); + // Trace message + // NOISY-DEBUG System.out.println(MessageFormat.format("RecruiterUserLoginWebSessionBean:isUserLoggedIn: this.userLoggedIn={0} - EXIT!", this.userLoggedIn)); + // Return it return this.userLoggedIn; } - } diff --git a/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestBean.java index 19123e6e..1e0c3f2b 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/profile/PizzaUserProfileWebRequestBean.java @@ -111,6 +111,6 @@ public class PizzaUserProfileWebRequestBean implements PizzaUserProfileWebReques // Check all conditions (except for admin) // TODO: Add admin role somehow? return ((profileMode.equals(ProfileMode.PUBLIC)) || - (this.loginController.isUserLoggedIn()) && (profileMode.equals(ProfileMode.MEMBERS))); + (this.userLoginController.isUserLoggedIn()) && (profileMode.equals(ProfileMode.MEMBERS))); } } diff --git a/src/java/org/mxchange/pizzaapplication/validators/password/PizzaUserPasswordValidator.java b/src/java/org/mxchange/pizzaapplication/validators/password/PizzaUserPasswordValidator.java index 7b86c4a4..d46aa765 100644 --- a/src/java/org/mxchange/pizzaapplication/validators/password/PizzaUserPasswordValidator.java +++ b/src/java/org/mxchange/pizzaapplication/validators/password/PizzaUserPasswordValidator.java @@ -56,7 +56,7 @@ public class PizzaUserPasswordValidator extends BaseStringValidator implements V /** * User login controller */ - private PizzaUserLoginWebSessionController loginController; + private PizzaUserLoginWebSessionController userLoginController; /** * Default constructor @@ -87,10 +87,10 @@ public class PizzaUserPasswordValidator extends BaseStringValidator implements V super.preValidate(context, component, value, requiredFields, false); // value is known to be an entered password, so instance login container - LoginContainer container = new UserLoginContainer(this.loginController.getLoggedInUser(), (String) value); + LoginContainer container = new UserLoginContainer(this.userLoginController.getLoggedInUser(), (String) value); // Test it here - if (!UserUtils.ifPasswordMatches(container, this.loginController.getLoggedInUser())) { + if (!UserUtils.ifPasswordMatches(container, this.userLoginController.getLoggedInUser())) { // Password mismatches throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Password mismatching.", "The password the user has entered does not match the stored password.")); //NOI18N } @@ -98,4 +98,5 @@ public class PizzaUserPasswordValidator extends BaseStringValidator implements V // Trace message this.loggerBeanLocal.logTrace("validate: EXIT!"); //NOI18N } + } diff --git a/web/WEB-INF/templates.dist/guest_login_page.xhtml b/web/WEB-INF/templates.dist/guest_login_page.xhtml index c24c17cc..e3d7e7d6 100644 --- a/web/WEB-INF/templates.dist/guest_login_page.xhtml +++ b/web/WEB-INF/templates.dist/guest_login_page.xhtml @@ -2,14 +2,13 @@ - + #{msg.PAGE_TITLE_INDEX_FOO} diff --git a/web/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl b/web/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl index b1435389..db480479 100644 --- a/web/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl +++ b/web/WEB-INF/templates/admin/cellphone/admin_cellphone_data.tpl @@ -1,57 +1,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
-
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+
+
+
diff --git a/web/WEB-INF/templates/guest/guest_login_form.tpl b/web/WEB-INF/templates/guest/guest_login_form.tpl index f6384692..ca1c0737 100644 --- a/web/WEB-INF/templates/guest/guest_login_form.tpl +++ b/web/WEB-INF/templates/guest/guest_login_form.tpl @@ -41,7 +41,7 @@ diff --git a/web/WEB-INF/templates/login/login_base.tpl b/web/WEB-INF/templates/login/login_base.tpl index 23c86ca2..21b46931 100644 --- a/web/WEB-INF/templates/login/login_base.tpl +++ b/web/WEB-INF/templates/login/login_base.tpl @@ -2,7 +2,22 @@ + xmlns:ui="http://xmlns.jcp.org/jsf/facelets" + xmlns:h="http://xmlns.jcp.org/jsf/html"> - Benutzerbereich - + #{msg.PAGE_TITLE_LOGIN_AREA} - + + + + + + + + + + + +======= diff --git a/web/WEB-INF/templates/login/login_enter_current_password.tpl b/web/WEB-INF/templates/login/login_enter_current_password.tpl new file mode 100644 index 00000000..392dcbcb --- /dev/null +++ b/web/WEB-INF/templates/login/login_enter_current_password.tpl @@ -0,0 +1,27 @@ + + + +
+
+ #{msg.LOGIN_ENTER_CURRENT_PASSWORD_CONFIRMATION_LEGEND} +
+
+ +
+ +
+ + + + +
+ +
+
+
+
+
diff --git a/web/imprint.xhtml b/web/imprint.xhtml index 115f6ff3..25c8180f 100644 --- a/web/imprint.xhtml +++ b/web/imprint.xhtml @@ -8,7 +8,7 @@ xmlns:f="http://xmlns.jcp.org/jsf/core" > - + #{msg.PAGE_TITLE_INDEX_IMPRINT} diff --git a/web/login/login_add_addressbook.xhtml b/web/login/login_add_addressbook.xhtml new file mode 100644 index 00000000..8df345f9 --- /dev/null +++ b/web/login/login_add_addressbook.xhtml @@ -0,0 +1,51 @@ + + + + + + #{msg.PAGE_TITLE_LOGIN_ADD_ADDRESSBOOK} + + + #{msg.CONTENT_TITLE_LOGIN_ADD_ADDRESSBOOK} + + + + + +
+
+ #{msg.FORM_LOGIN_ADD_ADDRESSBOOK_TITLE} +
+ +
+
+ +
+ +
+ + + +
+
+ + +
+
+
+ + + + +
+
+ diff --git a/web/login/login_change_email_address.xhtml b/web/login/login_change_email_address.xhtml new file mode 100644 index 00000000..2f0541fd --- /dev/null +++ b/web/login/login_change_email_address.xhtml @@ -0,0 +1,83 @@ + + + + + + #{msg.PAGE_TITLE_LOGIN_CHANGE_EMAIL_ADDRESS} + + + #{msg.CONTENT_TITLE_LOGIN_CHANGE_EMAIL_ADDRESS} + + + + +
+
+ #{msg.LOGIN_CHANGE_EMAIL_ADDRESS_TITLE} +
+ + +
+
+ #{msg.LOGIN_CHANGE_EMAIL_LEGEND} + +
+
+ #{msg.LOGIN_CHANGE_EMAIL_OLD_ADDRESS} +
+ +
+ #{userController.emailAddress} +
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+
+
+
+ + + + +
+
+
+ + + + +
+
+ diff --git a/web/login/login_change_password.xhtml b/web/login/login_change_password.xhtml new file mode 100644 index 00000000..1d873882 --- /dev/null +++ b/web/login/login_change_password.xhtml @@ -0,0 +1,71 @@ + + + + + + #{msg.PAGE_TITLE_LOGIN_CHANGE_PASSWORD} + + + #{msg.CONTENT_TITLE_LOGIN_CHANGE_PASSWORD} + + + + +
+
+ #{msg.LOGIN_CHANGE_PASSWORD_TITLE} +
+ + +
+
+ #{msg.LOGIN_CHANGE_PASSWORD_LEGEND} + +
+
+ +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+
+
+
+ + + + +
+
+
+ + + + +
+
+ diff --git a/web/login/login_change_personal_data.xhtml b/web/login/login_change_personal_data.xhtml new file mode 100644 index 00000000..10985be3 --- /dev/null +++ b/web/login/login_change_personal_data.xhtml @@ -0,0 +1,45 @@ + + + + + + #{msg.PAGE_TITLE_LOGIN_CHANGE_PERSONAL_DATA} + + + #{msg.CONTENT_TITLE_LOGIN_CHANGE_PERSONAL_DATA} + + + + +
+
+ #{msg.LOGIN_CHANGE_PERSONAL_DATA_TITLE} +
+ + + + + + + + + + +
+
+ + + + +
+
+ diff --git a/web/login/login_contact_data_saved.xhtml b/web/login/login_contact_data_saved.xhtml index 25b69679..b0414b3c 100644 --- a/web/login/login_contact_data_saved.xhtml +++ b/web/login/login_contact_data_saved.xhtml @@ -16,13 +16,13 @@
- + - + diff --git a/web/login/login_data_saved.xhtml b/web/login/login_data_saved.xhtml new file mode 100644 index 00000000..bd6b87e6 --- /dev/null +++ b/web/login/login_data_saved.xhtml @@ -0,0 +1,30 @@ + + + + + + #{msg.PAGE_TITLE_LOGIN_DATA_SAVED} + + + #{msg.CONTENT_TITLE_LOGIN_DATA_SAVED} + + + + + + + + + + + + + + + diff --git a/web/login/login_edit_user_data.xhtml b/web/login/login_edit_user_data.xhtml new file mode 100644 index 00000000..261571cb --- /dev/null +++ b/web/login/login_edit_user_data.xhtml @@ -0,0 +1,50 @@ + + + + + + #{msg.PAGE_TITLE_LOGIN_EDIT_USER_DATA} + + + #{msg.CONTENT_TITLE_LOGIN_EDIT_USER_DATA} + + + + +
+
+ #{msg.LOGIN_EDIT_USER_DATA_TITLE} +
+ +
+ +
+ +
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+
+
+ + + + +
+
+ diff --git a/web/login/login_index.xhtml b/web/login/login_index.xhtml new file mode 100644 index 00000000..92d6b8f7 --- /dev/null +++ b/web/login/login_index.xhtml @@ -0,0 +1,28 @@ + + + + + + #{msg.PAGE_TITLE_LOGIN_HOME} + + + #{msg.CONTENT_TITLE_LOGIN_HOME} + + + + + Here goes your content. + + + + + + + + diff --git a/web/login/login_own_addressbooks.xhtml b/web/login/login_own_addressbooks.xhtml new file mode 100644 index 00000000..235cb072 --- /dev/null +++ b/web/login/login_own_addressbooks.xhtml @@ -0,0 +1,67 @@ + + + + + + #{msg.PAGE_TITLE_LOGIN_OWN_ADDRESSBOOKS} + + + #{msg.CONTENT_TITLE_LOGIN_OWN_ADDRESSBOOKS} + + + + +
+
+ #{msg.TABLE_HEADER_LIST_OWN_ADDRESSBOOKS} +
+ +
+ + + #{msg.ADDRESSBOOK_NAME} + + + + + + + + + #{msg.ADDRESSBOOK_TOTAL_ENTRIES} + + + + + + + + + #{msg.ADDRESSBOOK_CREATED} + + + + + + +
+ + +
+
+ + + + +
+
+ diff --git a/web/login/login_user_data_saved.xhtml b/web/login/login_user_data_saved.xhtml index e42c555f..a98fbcbe 100644 --- a/web/login/login_user_data_saved.xhtml +++ b/web/login/login_user_data_saved.xhtml @@ -16,13 +16,13 @@
- + - + diff --git a/web/privacy.xhtml b/web/privacy.xhtml index aaaafb93..86df2feb 100644 --- a/web/privacy.xhtml +++ b/web/privacy.xhtml @@ -8,7 +8,7 @@ xmlns:f="http://xmlns.jcp.org/jsf/core" > - + #{msg.PAGE_TITLE_INDEX_PRIVACY} diff --git a/web/terms.xhtml b/web/terms.xhtml index 3c66fbbd..f46e4cf8 100644 --- a/web/terms.xhtml +++ b/web/terms.xhtml @@ -8,7 +8,7 @@ xmlns:f="http://xmlns.jcp.org/jsf/core" > - + #{msg.PAGE_TITLE_INDEX_TERMS} diff --git a/web/user/show_addressbook.xhtml b/web/user/show_addressbook.xhtml new file mode 100644 index 00000000..3b02ff9d --- /dev/null +++ b/web/user/show_addressbook.xhtml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + #{msg.PAGE_TITLE_USER_SHOW_ADDRESSBOOK} + #{msg.PAGE_TITLE_INDEX_SHOW_ADDRESSBOOK} + + + #{msg.CONTENT_TITLE_USER_SHOW_ADDRESSBOOK} + + + + + #{msg.TABLE_HEADER_SHOW_ADDRESSBOOK} + + #{msg.ADDRESSBOOK_NAME} + + + #{msg.ADDRESSBOOK_OWNER} + + + + + #{msg.ADDRESSBOOK_CREATED} + + + + + #{msg.ADDRESSBOOK_STATUS} + + + + + + + + + + + + + + diff --git a/web/user/user_list.xhtml b/web/user/user_list.xhtml new file mode 100644 index 00000000..64b21a7c --- /dev/null +++ b/web/user/user_list.xhtml @@ -0,0 +1,39 @@ + + + + + + #{msg.PAGE_TITLE_USER_LIST} + + + #{msg.CONTENT_TITLE_USER_LIST} + + + +
+
+ #{msg.TABLE_HEADER_USER_LIST} +
+ + + + #{msg.USER_NAME} + + + + + + + #{msg.USER_CREATED} + + + +
+
+
+ diff --git a/web/user/user_profile.xhtml b/web/user/user_profile.xhtml new file mode 100644 index 00000000..fe0a4efa --- /dev/null +++ b/web/user/user_profile.xhtml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + #{msg.PAGE_TITLE_LOGIN_USER_PROFILE} + #{msg.PAGE_TITLE_INDEX_USER_PROFILE} + + + #{msg.CONTENT_TITLE_INDEX_USER_PROFILE} + + + + + + + + + +
+ + + #{msg.PUBLIC_USER_PROFILE} + + +
+
+ + + #{msg.ERROR_PROFILE_NOT_VISIBLE} + +
+
+
+ -- 2.39.5