*/
package org.mxchange.jjobs.beans.login;
+import java.util.Collections;
+import java.util.List;
import java.util.Objects;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.event.Event;
import org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote;
import org.mxchange.jusercore.model.user.User;
import org.mxchange.jusercore.model.user.UserUtils;
+import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
+import org.mxchange.jusercore.model.user.password_history.UserPasswordHistorySessionBeanRemote;
import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
private User loggedInUser;
/**
- * Remote register session bean
+ * EJB for user-login
*/
private UserLoginSessionBeanRemote loginBean;
*/
private boolean userLoggedIn;
+ /**
+ * User's password history
+ */
+ private List<PasswordHistory> userPasswordHistory;
+
+ /**
+ * EJB for user's password history
+ */
+ private UserPasswordHistorySessionBeanRemote userPasswordHistoryBean;
+
/**
* Default constructor
*/
// Try to lookup
this.loginBean = (UserLoginSessionBeanRemote) context.lookup("java:global/jjobs-ejb/login!org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote"); //NOI18N
+
+ // Also find this
+ this.userPasswordHistoryBean = (UserPasswordHistorySessionBeanRemote) context.lookup(""); //NOI18N
+
+ // Defaul template is guest
+ this.baseTemplatePathName = GUEST_BASE_TEMPLATE_NAME;
} catch (final NamingException ex) {
// Continue to throw
throw new FaceletException(ex);
// All fine here so set it here
this.setLoggedInUser(confirmedUser);
+ // Retrieve user's password list
+ this.userPasswordHistory = this.userPasswordHistoryBean.getUserPasswordHistory(confirmedUser);
+
// Set template to "login"
this.setTemplateType("login"); //NOI18N
}
@Override
- public String getTemplateType () {
- return this.templateType;
- }
-
- @Override
- public void setTemplateType (final String templateType) {
- this.templateType = templateType;
+ public List<PasswordHistory> getUserPasswordHistory () {
+ return Collections.unmodifiableList(this.userPasswordHistory);
}
@Override
package org.mxchange.jjobs.beans.login;
import java.io.Serializable;
+import java.util.List;
+import javax.ejb.Local;
import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
/**
* An interface for registration web controllers
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
+@Local
public interface JobsUserLoginWebSessionController extends Serializable {
/**
*/
boolean ifCurrentPasswordMatches ();
+ /**
+ * Getter for user's password history
+ * <p>
+ * @return User's password history
+ */
+ List<PasswordHistory> getUserPasswordHistory ();
+
}