]> git.mxchange.org Git - jfinancials-ejb.git/commitdiff
Continued a bit:
authorRoland Häder <roland@mxchange.org>
Sat, 3 Jun 2017 16:18:47 +0000 (18:18 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 3 Jun 2017 16:18:47 +0000 (18:18 +0200)
- updated copyright
- updated jar(s)

Signed-off-by: Roland Häder <roland@mxchange.org>
31 files changed:
lib/jcontacts-business-core.jar
lib/jcontacts-core.jar
lib/jcontacts-lib.jar
lib/jcore-logger-lib.jar
lib/jcoreee.jar
lib/jcountry-core.jar
lib/jcountry-lib.jar
lib/jmailer-ee.jar
lib/jphone-core.jar
lib/jphone-lib.jar
lib/jproduct-core.jar
lib/juser-core.jar
lib/juser-lib.jar
src/java/log4j2.xml
src/java/org/mxchange/jcontacts/contact/FinancialsAdminContactSessionBean.java
src/java/org/mxchange/jcontacts/contact/FinancialsContactSessionBean.java
src/java/org/mxchange/jcontacts/phone/FinancialsAdminContactPhoneSessionBean.java
src/java/org/mxchange/jcountry/data/FinancialsCountrySingletonBean.java
src/java/org/mxchange/jfinancials/beans/resendlink/FinancialsResendLinkSessionBean.java
src/java/org/mxchange/jfinancials/mailer/model/delivery/FinancialsEmailDeliveryMessageBean.java
src/java/org/mxchange/jmailer/config.properties
src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsAdminMobileProviderSessionBean.java
src/java/org/mxchange/jphone/phonenumbers/mobileprovider/FinancialsMobileProviderSingletonBean.java
src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsAdminPhoneSessionBean.java
src/java/org/mxchange/jphone/phonenumbers/phone/FinancialsPhoneSessionBean.java
src/java/org/mxchange/jusercore/model/email_address/FinancialsUserEmailChangeSessionBean.java
src/java/org/mxchange/jusercore/model/login/FinancialsUserLoginSessionBean.java
src/java/org/mxchange/jusercore/model/register/FinancialsUserRegistrationSessionBean.java
src/java/org/mxchange/jusercore/model/user/FinancialsAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/password_history/FinancialsUserPasswordHistorySessionBean.java

index a0ca53b9d02f36e1d30269cefd780f092ac072e0..6de90379984e4536915f0abf67334246fccec75a 100644 (file)
Binary files a/lib/jcontacts-business-core.jar and b/lib/jcontacts-business-core.jar differ
index eaa2463471426757016ba6786661d4a7b471c087..54a8731c3ecc2973c6f9286a08706a16c4a442ab 100644 (file)
Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ
index 7baf796e4bd5f98534e20916a8329df0cebeaf71..a60343d14a5d410602d777851ed25dc714469436 100644 (file)
Binary files a/lib/jcontacts-lib.jar and b/lib/jcontacts-lib.jar differ
index c8046481dc6d1d52e4cec0137a3fb47448a8f795..3e757cdc2af9b522811655bbbacd2cd6dce2cba9 100644 (file)
Binary files a/lib/jcore-logger-lib.jar and b/lib/jcore-logger-lib.jar differ
index 7f47a54432a763f3d0b883e7cec8d940444c27c1..1c4dbecc0ac4e4d62ad903e93f26d31c47b8ae2e 100644 (file)
Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ
index 5cbad453c2f8698f9ab16791a4e97baef7fa6686..e91ed0ad88c8635e2a9fccb45c289eefa8d2f943 100644 (file)
Binary files a/lib/jcountry-core.jar and b/lib/jcountry-core.jar differ
index 066e9a10de897adc8457948e4449c71d31e5329e..d3f45e10d9cdf026834a75ecb1186027469f96da 100644 (file)
Binary files a/lib/jcountry-lib.jar and b/lib/jcountry-lib.jar differ
index 8452960c3b4799cdfc9cd2ceda1a0c135c9ba189..9b3912f2f17efabb37a46678205ad319a6f2c52e 100644 (file)
Binary files a/lib/jmailer-ee.jar and b/lib/jmailer-ee.jar differ
index 9587335f2376f8ddf1f9275c0ec27c454450b266..6f596cc999fe3f3bcc5ecb56de3a09ef90910f9f 100644 (file)
Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ
index 3c22799492f7a2d81213e1003191b44d016579ff..aa0c7b7f7f079149bf1cf52e6aa554e546a71dd7 100644 (file)
Binary files a/lib/jphone-lib.jar and b/lib/jphone-lib.jar differ
index 081cf1fc5285da28641848b97101a71eb8ae1b58..58afdc537b85c6c7de127b2b27f86ec60a4ed6fd 100644 (file)
Binary files a/lib/jproduct-core.jar and b/lib/jproduct-core.jar differ
index aa8a72393fba606d8e39c915068e9ea7ca5faf74..fd411f914c67a74da6daa0cce6a4534883b0b9ca 100644 (file)
Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ
index e845d87ba2337996bcc8aef68c5b14cfb6c6e763..38a2d3739dc9a9b584d39e9fe49980aec684bac3 100644 (file)
Binary files a/lib/juser-lib.jar and b/lib/juser-lib.jar differ
index 3741761ae97430f8041162218c6ba1b02c14a39e..98e9a65f642174f1e53f38823251423cf6e9f0d3 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-Copyright (C) 2016 Roland Häder
+Copyright (C) 2016, 2017 Roland Häder
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU Affero General Public License as
index 6c0e00c06ff93b4a960924b2ab5805f661f178fa..38bb9b0c101acdb9d43f11591692394f91d89e2c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 18ca4ff26b7ce02f1cb32d0bb159edb213dd60fc..48ef52f5013fb60582215f302a8032d6142f5d56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 5244ad116cfff555fa2a35c2811086bdda7d4640..0d8590961e14296be8a2a2b2597fcb64d25c1b12 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 99f2075353e269c9b8ce819852328d13755cd6d5..11810ce62867d1625fff5a2e7f16c1cff6479501 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 149ce0aa146fcb829d23ab94599aa784bbbd25ac..1e88731eaedd0e2e7f70b31c7410bbaf7eab3052 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -18,13 +18,21 @@ package org.mxchange.jfinancials.beans.resendlink;
 
 import java.text.MessageFormat;
 import java.util.Locale;
+import javax.ejb.EJB;
 import javax.ejb.EJBException;
 import javax.ejb.Stateless;
 import javax.mail.Address;
 import javax.mail.internet.AddressException;
 import javax.mail.internet.InternetAddress;
 import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
+import org.mxchange.jusercore.exceptions.UserNotFoundException;
+import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
+import org.mxchange.jusercore.exceptions.UserStatusLockedException;
+import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote;
+import org.mxchange.jusercore.model.resendlink.ResendLinkSessionBeanRemote;
+import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 
 /**
@@ -40,8 +48,20 @@ public class FinancialsResendLinkSessionBean extends BaseFinancialsDatabaseBean
         */
        private static final long serialVersionUID = 71_546_726_857_195_360L;
 
+       /**
+        * Registration bean
+        */
+       @EJB
+       private UserRegistrationSessionBeanRemote registerBean;
+
+       /**
+        * Regular user bean
+        */
+       @EJB
+       private UserSessionBeanRemote userBean;
+
        @Override
-       public void resendConfirmationLink (final User user, final Locale locale, final String baseUrl) {
+       public void resendConfirmationLink (final User user, final Locale locale, final String baseUrl) throws UserNotFoundException, UserStatusLockedException, UserStatusConfirmedException {
                // Log trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.resendConfirmationLink: user={1},locale={2},baseUrl={3} - CALLED!", this.getClass().getSimpleName(), user, locale, baseUrl)); //NOI18N
 
@@ -55,25 +75,38 @@ public class FinancialsResendLinkSessionBean extends BaseFinancialsDatabaseBean
                } else if (user.getUserId() < 1) {
                        // Invalid id number
                        throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
+               } else if (!this.userBean.ifUserExists(user)) {
+                       // User not found
+                       throw new UserNotFoundException(user);
                } else if (user.getUserConfirmKey() == null) {
                        // Throw NPE again
                        throw new NullPointerException("this.userConfirmKey is null"); //NOI18N
-               } else if (user.getUserAccountStatus() != UserAccountStatus.UNCONFIRMED) {
+               } else if (user.getUserAccountStatus() == UserAccountStatus.CONFIRMED) {
+                       // User account status is not UNCONFIRMED
+                       throw new UserStatusConfirmedException(user);
+               } else if (user.getUserAccountStatus() == UserAccountStatus.LOCKED) {
                        // User account status is not UNCONFIRMED
-                       throw new IllegalStateException(MessageFormat.format("Account status from user.userId={0} is not UNCONFIRMED:{1}", user.getUserId(), user.getUserAccountStatus())); //NOI18N
+                       throw new UserStatusLockedException(user);
                } else if (null == locale) {
                        // Locale should be set
                        throw new NullPointerException("locale is null"); //NOI18N
                }
 
-               // @TODO Unfinished: Change key + merge database
+               // Get new registration key
+               String confirmationKey = this.registerBean.generateConfirmationKey(user);
+
+               // Get managed instance
+               User managedUser = this.getEntityManager().find(LoginUser.class, user.getUserId());
+
+               // Set it in user
+               managedUser.setUserConfirmKey(confirmationKey);
 
                // Init variable
                Address emailAddress;
 
                try {
                        // Create email address and set
-                       emailAddress = new InternetAddress(user.getUserContact().getContactEmailAddress());
+                       emailAddress = new InternetAddress(managedUser.getUserContact().getContactEmailAddress());
                } catch (final AddressException ex) {
                        // Throw again
                        throw new EJBException(ex);
index 47d21b666a6d8a466f8deb21008c8aec07c2ce3b..a562f4f6b5b7a4f800f572fb16b29f72e070451c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 45b88a7beacabeb9f4f55a00c820dbda43520e22..5a02e31eeab2f42d7151f359d3b2ac982cd3251e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 Roland H\u00e4der
+# Copyright (C) 2016, 2017 Roland H\u00e4der
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as
index 2b02301d54470f64a9f87cf87f2a6b451ccce27a..a6b0014187303078c0e01bb5c7c545605b320c02 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 9163741f8a1b05df6fed1e913b666e3e73d64097..c800c75599f9875dfcf6d9f02c787a1311680f31 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 89543a250d7eea34c8b35021a51f73d69b6e28cc..7936651af3e3ac4d072f2750d96b0354fd35a903 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 2dbd0b7bdbd142ae351266e3c82373429091696b..cab2cc2b8678da945931e42ec66547dd6657c331 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 1ae21347a73a84e46381292d493e0de569721cd3..87a0e487a0ad7d762928a5f304d09936635d6d84 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index f7dd1d3462194b8f10ba225f4bcd50a0e8e11df3..d56e318974e976c41aa3b61dce5caf8f161c35cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 1f1827caca3ccc3375e360bf5449c3c400ba1578..ac57a4e50a9ce81bee486f774f28deb911e6448a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index fbb10eab3295b99e64e479a2d9ed558bcca4330f..6771ae31124056991990bb91c9817f177ca5ed7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -24,8 +24,8 @@ import javax.ejb.Stateless;
 import javax.mail.Address;
 import javax.mail.internet.AddressException;
 import javax.mail.internet.InternetAddress;
-import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
 import org.mxchange.jcontacts.contact.Contact;
+import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
index bbfabd4a2798217819af25165d0324c8b7da534d..32a8ab131f7978ecc243230f2469315294b041da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
index 403fd5eb707004c8b6c0294e2d6cfd7485545626..9cda8e589f19884ebb2f54f16824d3bdc76da5a3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as