From 917486172bc419d0265b8041e8ef7cf63b0ab027 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 7 Oct 2015 12:13:58 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20added=20list=20for=20already=20?= =?utf8?q?registered=20email=20addresses=20-=20added=20fields=20for=20repe?= =?utf8?q?ated=20email=20address=20and=20password=20-=20added=20field=20fo?= =?utf8?q?r=20user=20id=20-=20added=20missing=20language=20elements=20-=20?= =?utf8?q?introduced=20new=20method=20addUserNameEmailAddress()=20-=20intr?= =?utf8?q?oduced=20new=20method=20clearData()=20-=20added=20copying=20of?= =?utf8?q?=20missing=20fields=20-=20added=20@PostConstruct=20method=20init?= =?utf8?q?()=20for=20initializing=20email=20address/user=20name=20lists=20?= =?utf8?q?-=20introduced=20isEmailAddressRegistered()=20and=20isUserNameRe?= =?utf8?q?gistered()=20-=20rewrote=20isRequiredPersonalDataSet()=20a=20lit?= =?utf8?q?tle=20(better=20readable=20now)=20-=20introduced=20isSameEmailAd?= =?utf8?q?dressEntered()=20and=20isSamePasswordEntered()=20for=20checking?= =?utf8?q?=20if=20repeated=20email=20address/password=20matches=20-=20adde?= =?utf8?q?d=20some=20missing=20language=20elements=20-=20added=20missing?= =?utf8?q?=20value=3D"#{blaController.blub}"=20(really=20required,=20else?= =?utf8?q?=20no=20data=20is=20copied)=20-=20added=20a=20lot=20pre-checks?= =?utf8?q?=20for=20registration=20and=20newly=20added=20UserUtils.encryptP?= =?utf8?q?assword()=20for=20securely=20encryption=20of=20the=20password=20?= =?utf8?q?-=20added=20field=20loggedInUser=20which=20holds=20the=20logged-?= =?utf8?q?in=20user=20instance=20-=20sorted=20members=20a=20bit=20-=20upda?= =?utf8?q?tes=20jars=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcontacts-business-core.jar | Bin 38314 -> 38557 bytes lib/jcontacts-core.jar | Bin 18101 -> 18203 bytes lib/jcontacts-lib.jar | Bin 372 -> 363 bytes lib/juser-core.jar | Bin 15206 -> 16582 bytes lib/juser-lib.jar | Bin 3782 -> 3749 bytes .../beans/login/UserLoginWebBean.java | 24 ++- .../beans/login/UserLoginWebController.java | 15 ++ .../beans/register/UserRegisterWebBean.java | 26 ++- .../addressbook/beans/user/UserWebBean.java | 159 +++++++++++++--- .../beans/user/UserWebController.java | 174 ++++++++++++------ .../localization/bundle_de_DE.properties | 5 +- .../localization/bundle_en_US.properties | 5 +- .../templates/guest/guest_personal_data.tpl | 12 ++ .../guest/guest_registration_form.tpl | 6 +- 14 files changed, 331 insertions(+), 95 deletions(-) diff --git a/lib/jcontacts-business-core.jar b/lib/jcontacts-business-core.jar index ffd6685dbe3c8fe2c2d28f4848a2438fc4085c96..a121a7c8c98731270e214beb9bcaa855691d76e7 100644 GIT binary patch delta 2421 zcmaKte{2**6vw~2N4tB=mHW}s0t?<%v@NC5EA$5xODRyU20U5>sR+W+mec;?=#{p# z1=@sGfnM9|l=z3i0GgOeh?tAf@CPx`M8#lB{KH@jA)09TLnToYe+7Iqd-PmL*<|L; zzS(*6KJ(tZefNTV=AxWZy~#3515}{3(ict1NolF{`94Vto(Td7M%Vc>3RAT8Z4H6; zhWe-09WM10EGt>&-BVl=y_9X?OTKjr@ox?nEL$oSvR>LCRM zsT(BeSZsS*MY2@JUSE(^olctoR&0ciBpESW`AWRpiKn{AV0Q{!yG7tg950H-snWpF61HTBsowA z%{~@JC%WPTGth?x9s}s>24Br`g5iw=EoLK*WOi+5D*L;@ZXeZV_|C=lv)ppg0DP(jfuULEdw?E-Z{g z9j4jEVRWM>J}^P~{#fAdsIvieY)e&5aZrN|I~BaBVi(W4-B!%TOT62|yS=;%DA=cw ztW!|0ph3ZYLdc2Tt-6*pGr|}Ci%Epgxh)ZwQmiHyd0c9+RUkY^Z!)%FyO7UgE=eAj z9W%bH*)+eOY@;otbPRkj^viOlQ^W!j0G)vc~Sri67FvGO; z-Li=4SAG0hNyO`;o4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~v^F9RP~6(a*b0|RmhxVtY{w|_wj&@muvJ6VxQb+Q2m%jC73 zf|Kp}*e35|=L9)Wh@AoCuFV(OEf^Ma9OATxgblJfK~`V zEfWM;#>gbX3=8ndKe#M`AwJod+W{1mrQ8M}YB@JJm>+RFgLvvZo*=4-#~(x;<_Q8( z;=F!nfnLO$q5z5pcwhqE?+dgS29`7e-Sv=1W3n8dF<2prM`5af^pZv{j>(05{%j{f HA;tgzSORk~ delta 526 zcmZ1~drX!mz?+$ci-CcIfg#L!B9A6hsPjbg=}bWO1qBfKNfSs;mSr>sQ9+EBAgY(q z9z>mEbOKRAOm@6s&hGB+YdOu8m>3w8CdV?x^K$0or)TDc7N-_5GH6epz^cUmhuwfaD%AnZFikx^mteICxqe|gm>XR~s039&QqvNQ0pGw@HYV=ZP8U}q5A z9LiS3$jCVP0=tMI0}}%$0|SucV&DeSYz&MHJPZuT-f(w+@_oq%9cBgw5VoDH$fP=1 zk4toNJO@9QG&_SBJA*hogT&?v4hu#Fo}$$B%;J*NB8XGDTq}}O3raHc^NQISB-t6H zCa>e%KiPnNJ|o-YYAy>47Dfg>23DYz{9vn@7z7vufld(uJ4l#81nMABkb@YRM3`YA zJNY`7B`|0w3voMu!YqW_07SKMgTwP6w=;;x#^VX10(tyF)FPfB5cQ464=r>9c~cZH s0ug903@m9p$uju>j|MP2jll|00t2QBNH1wjW}h6u=g;;E=t>3#0ETvN#sB~S diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebBean.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebBean.java index 88cb0319..7c22e547 100644 --- a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebBean.java @@ -39,6 +39,11 @@ import org.mxchange.jusercore.model.user.User; @SessionScoped public class UserLoginWebBean implements UserLoginWebController { + /** + * Serial number + */ + private static final long serialVersionUID = 47_828_986_719_691_592L; + /** * Reemote register session bean */ @@ -51,9 +56,9 @@ public class UserLoginWebBean implements UserLoginWebController { private UserWebController userController; /** - * Serial number + * Logged-in user instance */ - private static final long serialVersionUID = 47_828_986_719_691_592L; + private User loggedInUser; /** * Default constructor @@ -78,10 +83,23 @@ public class UserLoginWebBean implements UserLoginWebController { try { // Call bean - this.loginBean.loginUser(user); + User confirmedUser = this.loginBean.validateUserAccountStatus(user); + + // All fine here so set it here + this.setLoggedInUser(confirmedUser); } catch (final UserNotFoundException | UserStatusLockedException | UserStatusUnconfirmedException ex) { // Throw again throw new FaceletException(ex); } } + + @Override + public User getLoggedInUser () { + return this.loggedInUser; + } + + @Override + public void setLoggedInUser (final User loggedInUser) { + this.loggedInUser = loggedInUser; + } } diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebController.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebController.java index 81d90ba8..f02bae1b 100644 --- a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebController.java +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebController.java @@ -17,6 +17,7 @@ package org.mxchange.addressbook.beans.login; import java.io.Serializable; +import org.mxchange.jusercore.model.user.User; /** * An interface for registration web controllers @@ -29,4 +30,18 @@ public interface UserLoginWebController extends Serializable { * Logins the user, if the account is found, confirmed and unlocked. */ public void doLogin (); + + /** + * Getter for logged-in user instance + *

+ * @return Logged-in user instance + */ + public User getLoggedInUser (); + + /** + * Setter for logged-in user instance + *

+ * @param loggedInUser Logged-in user instance + */ + public void setLoggedInUser (final User loggedInUser); } diff --git a/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java index 24dddcb4..6edf2af6 100644 --- a/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java @@ -16,6 +16,7 @@ */ package org.mxchange.addressbook.beans.register; +import java.text.MessageFormat; import javax.enterprise.context.SessionScoped; import javax.faces.view.facelets.FaceletException; import javax.inject.Inject; @@ -24,10 +25,12 @@ import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.addressbook.beans.user.UserWebController; +import org.mxchange.jusercore.exceptions.DataRepeatMismatchException; import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote; import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.UserUtils; import org.mxchange.jusercore.model.user.status.UserAccountStatus; /** @@ -77,14 +80,29 @@ public class UserRegisterWebBean implements UserRegisterWebController { User user = this.userController.createUserInstance(); // Is the user already used? - if (this.userController.isUserNameRegistered(user.getUserName())) { + if (!this.userController.isRequiredPersonalDataSet()) { + // Not all required fields are set + throw new FaceletException("Not all required fields are set."); + } else if (this.userController.isUserNameRegistered(user.getUserName())) { // User name is already used throw new FaceletException(new UserNameAlreadyRegisteredException(user)); } else if (this.userController.isEmailAddressRegistered(user.getUserContact().getEmailAddress())) { // Email address has already been taken throw new FaceletException(new EmailAddressAlreadyRegisteredException(user)); + } else if (!this.userController.isSameEmailAddressEntered()) { + // Not same email address entered + throw new FaceletException(new DataRepeatMismatchException(MessageFormat.format("Email addresses not matching: {0} != {1}", this.userController.getEmailAddress(), this.userController.getEmailAddressRepeat()))); + } else if (!this.userController.isSamePasswordEntered()) { + // Not same password entered + throw new FaceletException(new DataRepeatMismatchException("Passwords not matching.")); } + // Encrypt password + String encryptedPassword = UserUtils.encryptPassword(this.userController.getUserPassword()); + + // Set it here + user.setUserEncryptedPassword(encryptedPassword); + // For debugging/programming only: user.setUserAccountStatus(UserAccountStatus.CONFIRMED); @@ -95,6 +113,12 @@ public class UserRegisterWebBean implements UserRegisterWebController { // Copy all data from registered->user this.userController.copyUser(registeredUser); + // Add user name and email address + this.userController.addUserNameEmailAddress(registeredUser); + + // Clear all data + this.userController.clearData(); + // All fine, redirect to proper page return "register_done"; //NOI18N } catch (final UserNameAlreadyRegisteredException | EmailAddressAlreadyRegisteredException ex) { diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java index de5c6e05..ab9f5b65 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java @@ -16,8 +16,11 @@ */ package org.mxchange.addressbook.beans.user; +import java.text.MessageFormat; import java.util.Date; +import java.util.GregorianCalendar; import java.util.List; +import java.util.Objects; import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; import javax.faces.view.facelets.FaceletException; @@ -77,6 +80,16 @@ public class UserWebBean implements UserWebController { */ private String emailAddress; + /** + * Email address list + */ + private List emailAddressList; + + /** + * Email address repeated + */ + private String emailAddressRepeat; + /** * Family name */ @@ -102,11 +115,6 @@ public class UserWebBean implements UserWebController { */ private Short houseNumber; - /** - * User id - */ - private Long userId; - /** * Phone number */ @@ -122,30 +130,35 @@ public class UserWebBean implements UserWebController { */ private final UserSessionBeanRemote userBean; + /** + * User id + */ + private Long userId; + /** * User name */ private String userName; /** - * User password (unencrypted from web form) + * User name list */ - private String userPassword; + private List userNameList; /** - * ZIP code + * User password (unencrypted from web form) */ - private Integer zipCode; + private String userPassword; /** - * Email address list + * User password repeated (unencrypted from web form) */ - private List emailAddressList; + private String userPasswordRepeat; /** - * User name list + * ZIP code */ - private List userNameList; + private Integer zipCode; /** * Default constructor @@ -160,7 +173,7 @@ public class UserWebBean implements UserWebController { Context context = new InitialContext(); // Try to lookup - this.userBean = (UserSessionBeanRemote) context.lookup("ejb/stateless-user"); + this.userBean = (UserSessionBeanRemote) context.lookup("ejb/stateless-user"); //NOI18N } catch (final NamingException e) { // Throw again throw new FaceletException(e); @@ -168,22 +181,49 @@ public class UserWebBean implements UserWebController { } @Override - public boolean isEmailAddressRegistered (String emailAddress) { - return ((this.emailAddressList instanceof List) && (this.emailAddressList.contains(emailAddress))); + public void addUserNameEmailAddress (final User user) { + // Make sure the entry is not added yet + if (this.userNameList.contains(user.getUserName())) { + // Abort here + throw new IllegalArgumentException(MessageFormat.format("User name {0} already added.", user.getUserName())); + } else if (this.emailAddressList.contains(user.getUserContact().getEmailAddress())) { + // Already added + throw new IllegalArgumentException(MessageFormat.format("Email address {0} already added.", user.getUserContact().getEmailAddress())); + } + + // Add user name + this.userNameList.add(user.getUserName()); + + // Add email addres + this.emailAddressList.add(user.getUserContact().getEmailAddress()); } @Override - public boolean isUserNameRegistered (final String userName) { - return ((this.userNameList instanceof List) && (this.userNameList.contains(userName))); - } + public void clearData () { + // Clear all data + // - personal data + this.setUserId(null); + this.setGender(Gender.UNKNOWN); + this.setFirstName(null); + this.setFamilyName(null); + this.setStreet(null); + this.setHouseNumber(null); + this.setZipCode(null); + this.setCity(null); + this.setCountryCode(null); - @PostConstruct - public void init () { - // Get full user name list for reducing EJB calls - this.userNameList = this.userBean.getUserNameList(); + // - contact data + this.setEmailAddress(null); + this.setEmailAddressRepeat(null); + this.setPhoneNumber(null); + this.setCellphoneNumber(null); + this.setFaxNumber(null); - // Get full email address list for reducing EJB calls - this.emailAddressList = this.userBean.getEmailAddressList(); + // - other data + this.setBirthday(null); + this.setComment(null); + this.setUserPassword(null); + this.setUserPasswordRepeat(null); } @Override @@ -229,14 +269,21 @@ public class UserWebBean implements UserWebController { contact.setHouseNumber(this.getHouseNumber()); contact.setZipCode(this.getZipCode()); contact.setCity(this.getCity()); + contact.setCountryCode(this.getCountryCode()); + contact.setEmailAddress(this.getEmailAddress()); contact.setPhoneNumber(this.getPhoneNumber()); contact.setFaxNumber(this.getFaxNumber()); contact.setCellphoneNumber(this.getCellphoneNumber()); contact.setBirthday(this.getBirthday()); contact.setComment(this.getComment()); + // Created timestamp and ownContact + contact.setCreated(new GregorianCalendar()); + contact.setOwnContact(Boolean.TRUE); + // Set contact in user user.setUserContact(contact); + user.setUserCreated(new GregorianCalendar()); // Trace message //this.getLogger().logTrace(MessageFormat.format("createUserInstance: user={0} - EXIT!", user)); @@ -304,6 +351,16 @@ public class UserWebBean implements UserWebController { this.emailAddress = emailAddress; } + @Override + public String getEmailAddressRepeat () { + return this.emailAddressRepeat; + } + + @Override + public void setEmailAddressRepeat (final String emailAddressRepeat) { + this.emailAddressRepeat = emailAddressRepeat; + } + @Override public String getFamilyName () { return this.familyName; @@ -404,6 +461,16 @@ public class UserWebBean implements UserWebController { this.userPassword = userPassword; } + @Override + public String getUserPasswordRepeat () { + return this.userPasswordRepeat; + } + + @Override + public void setUserPasswordRepeat (final String userPasswordRepeat) { + this.userPasswordRepeat = userPasswordRepeat; + } + @Override public Integer getZipCode () { return this.zipCode; @@ -414,8 +481,48 @@ public class UserWebBean implements UserWebController { this.zipCode = zipCode; } + @PostConstruct + public void init () { + // Get full user name list for reducing EJB calls + this.userNameList = this.userBean.getUserNameList(); + + // Get full email address list for reducing EJB calls + this.emailAddressList = this.userBean.getEmailAddressList(); + } + + @Override + public boolean isEmailAddressRegistered (final String emailAddress) { + return ((this.emailAddressList instanceof List) && (this.emailAddressList.contains(emailAddress))); + } + @Override public boolean isRequiredPersonalDataSet () { - return ((this.getUserName() != null) && (this.getGender() != null) && (this.getFirstName() != null) && (this.getFamilyName() != null) && (this.getStreet() != null) && (this.getHouseNumber() != null) && (this.getZipCode() != null) && (this.getCity() != null)); + return ((this.getUserName() != null) + && (this.getGender() != null) + && (this.getFirstName() != null) + && (this.getFamilyName() != null) + && (this.getStreet() != null) + && (this.getHouseNumber() != null) + && (this.getZipCode() != null) + && (this.getCity() != null) + && (this.getEmailAddress() != null) + && (this.getEmailAddressRepeat() != null) + && (this.getUserPassword() != null) + && (this.getUserPasswordRepeat() != null)); + } + + @Override + public boolean isSameEmailAddressEntered () { + return (Objects.equals(this.getEmailAddress(), this.getEmailAddressRepeat())); + } + + @Override + public boolean isSamePasswordEntered () { + return (Objects.equals(this.getUserPassword(), this.getUserPasswordRepeat())); + } + + @Override + public boolean isUserNameRegistered (final String userName) { + return ((this.userNameList instanceof List) && (this.userNameList.contains(userName))); } } diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebController.java b/src/java/org/mxchange/addressbook/beans/user/UserWebController.java index cc7c9d16..b93bf115 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebController.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebController.java @@ -29,34 +29,30 @@ import org.mxchange.jusercore.model.user.User; public interface UserWebController extends Serializable { /** - * Copies given user into the controller + * Adds user's name and email address to bean's internal list *

* @param user User instance */ - public void copyUser (final User user); + public void addUserNameEmailAddress (final User user); /** - * Creates an instance from all properties - *

- * @return A user instance + * Clears all data in this bean */ - public User createUserInstance (); + public void clearData (); /** - * Checks whether given user name is used + * Copies given user into the controller *

- * @param userName User name to check - * @return Whether it is already used + * @param user User instance */ - public boolean isUserNameRegistered (final String userName); + public void copyUser (final User user); /** - * Checks whether given email address is used + * Creates an instance from all properties *

- * @param emailAddress Email address to check - * @return Whether it is already used + * @return A user instance */ - public boolean isEmailAddressRegistered (final String emailAddress); + public User createUserInstance (); /** * Getter for birth day @@ -114,48 +110,6 @@ public interface UserWebController extends Serializable { */ public void setComment (final String comment); - /** - * Getter for user id - *

- * @return User id - */ - public Long getUserId (); - - /** - * Setter for user id - *

- * @param userId User id - */ - public void setUserId (final Long userId); - - /** - * Getter for user name - *

- * @return User name - */ - public String getUserName (); - - /** - * Setter for user name - *

- * @param userName User name - */ - public void setUserName (final String userName); - - /** - * Getter for unencrypted user password - *

- * @return Unencrypted user password - */ - public String getUserPassword (); - - /** - * Setter for unencrypted user password - *

- * @param userPassword Unencrypted user password - */ - public void setUserPassword (final String userPassword); - /** * Country code *

@@ -171,19 +125,33 @@ public interface UserWebController extends Serializable { public void setCountryCode (final String countryCode); /** - * Email address + * Getter for email address *

- * @return the emailAddress + * @return Email address */ public String getEmailAddress (); /** - * Email address + * Setter for email address *

- * @param emailAddress the emailAddress to set + * @param emailAddress Email address */ public void setEmailAddress (final String emailAddress); + /** + * Getter for email address, repeated + *

+ * @return the emailAddress, repeated + */ + public String getEmailAddressRepeat (); + + /** + * Setter for email address repeated + *

+ * @param emailAddressRepeat the emailAddress to set + */ + public void setEmailAddressRepeat (final String emailAddressRepeat); + /** * Family name *

@@ -282,6 +250,62 @@ public interface UserWebController extends Serializable { */ public void setStreet (final String street); + /** + * Getter for user id + *

+ * @return User id + */ + public Long getUserId (); + + /** + * Setter for user id + *

+ * @param userId User id + */ + public void setUserId (final Long userId); + + /** + * Getter for user name + *

+ * @return User name + */ + public String getUserName (); + + /** + * Setter for user name + *

+ * @param userName User name + */ + public void setUserName (final String userName); + + /** + * Getter for unencrypted user password + *

+ * @return Unencrypted user password + */ + public String getUserPassword (); + + /** + * Setter for unencrypted user password + *

+ * @param userPassword Unencrypted user password + */ + public void setUserPassword (final String userPassword); + + /** + * Getter for unencrypted user password repeated + *

+ * @return Unencrypted user password repeated + */ + public String getUserPasswordRepeat (); + + /** + * Setter for unencrypted user password repeated + *

+ * @param userPasswordRepeat Unencrypted user password repeated + */ + public void setUserPasswordRepeat (final String userPasswordRepeat); + /** * ZIP code *

@@ -296,10 +320,40 @@ public interface UserWebController extends Serializable { */ public void setZipCode (final Integer zipCode); + /** + * Checks whether given email address is used + *

+ * @param emailAddress Email address to check + * @return Whether it is already used + */ + public boolean isEmailAddressRegistered (final String emailAddress); + /** * Checks whether all required personal data is set *

* @return Whether the required personal data is set */ public boolean isRequiredPersonalDataSet (); + + /** + * Checks whether same email addresses have been entered + *

+ * @return Whether same email addresses have been entered + */ + public boolean isSameEmailAddressEntered (); + + /** + * Checks whether same passwords has been entered + *

+ * @return Whether same passwords has been entered + */ + public boolean isSamePasswordEntered (); + + /** + * Checks whether given user name is used + *

+ * @param userName User name to check + * @return Whether it is already used + */ + public boolean isUserNameRegistered (final String userName); } diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index ab0c613c..01d4628b 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -109,4 +109,7 @@ BUTTON_CONTINUE_STEP_2=Weiter zu Schritt 2 GUEST_REGISTRATION_ENTER_USER_NAME=Benutzernamen eingeben: GUEST_REGISTRATION_USER_NAME_NOTICE=Der Benutzername darf nur einmal vorkommen. LINK_GUEST_RESENT_CONFIRMATION_LINK=Nochmals den Best\u00e4tigungslink aussenden? -GUEST_REGISTRATION_COMPLETED=Die Anmeldung ist abgeschlossen und Ihr Account wartet auf Freischaltung. Es ist eine Email mit einem entsprechenden Best\u00e4tigungslink zu Ihnen unterwegs. Diesen m\u00fcssen Sie einmal anklicken oder in die Adresszeile des Browsers kopieren und dann aufrufen lassen. Danach ist Ihr Account freigegeben. +GUEST_USER_REGISTRATION_COMPLETED=Die Anmeldung ist abgeschlossen und Ihr Account wartet auf Freischaltung. Es ist eine Email mit einem entsprechenden Best\u00e4tigungslink zu Ihnen unterwegs. Diesen m\u00fcssen Sie einmal anklicken oder in die Adresszeile des Browsers kopieren und dann aufrufen lassen. Danach ist Ihr Account freigegeben. +PERSONAL_DATA_COUNTRY_CODE=L\u00e4ndercode: +PAGE_TITLE_USER_REGISTER_DONE=Anmeldung abgeschlossen +SUB_TITLE_USER_REGISTER_DONE=Die Anmeldung ist abgeschlossen: diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 2f6c7127..761a8817 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -109,4 +109,7 @@ BUTTON_CONTINUE_STEP_2=Weiter zu Schritt 2 GUEST_REGISTRATION_ENTER_USER_NAME=Enter user name: GUEST_REGISTRATION_USER_NAME_NOTICE=The user name must only exist once. LINK_GUEST_RESENT_CONFIRMATION_LINK=Resend again the confirmation link? -GUEST_REGISTRATION_COMPLETED=The registration is completed and your account is pending confirmation. An email has been sent to you. There you will find a confirmation link which you have to click once or copy it into your browser's address bar and call it. +GUEST_USER_REGISTRATION_COMPLETED=The registration is completed and your account is pending confirmation. An email has been sent to you. There you will find a confirmation link which you have to click once or copy it into your browser's address bar and call it. +PERSONAL_DATA_COUNTRY_CODE=Country code: +PAGE_TITLE_USER_REGISTER_DONE=Registration completed +SUB_TITLE_USER_REGISTER_DONE=Registration is completed: diff --git a/web/WEB-INF/templates/guest/guest_personal_data.tpl b/web/WEB-INF/templates/guest/guest_personal_data.tpl index 4496e88d..a59ab7cf 100644 --- a/web/WEB-INF/templates/guest/guest_personal_data.tpl +++ b/web/WEB-INF/templates/guest/guest_personal_data.tpl @@ -107,6 +107,18 @@

+
+
+ +
+ +
+ +
+ +
+
+
diff --git a/web/WEB-INF/templates/guest/guest_registration_form.tpl b/web/WEB-INF/templates/guest/guest_registration_form.tpl index 30fad999..c92e59bd 100644 --- a/web/WEB-INF/templates/guest/guest_registration_form.tpl +++ b/web/WEB-INF/templates/guest/guest_registration_form.tpl @@ -48,7 +48,7 @@
- +
@@ -62,7 +62,7 @@
- +
@@ -74,7 +74,7 @@
- +
-- 2.39.5