@SessionScoped
public class JobsUserLoginWebSessionBean extends BaseJobsController implements JobsUserLoginWebSessionController {
+ /**
+ * Path name for guest base template
+ */
+ private static final String GUEST_BASE_TEMPLATE_NAME = "guest/guest"; //NOI18N
+
+ /**
+ * Path name for logged-in user base template
+ */
+ private static final String USER_BASE_TEMPLATE_NAME = "login/user/user"; //NOI18N
+
/**
* Serial number
*/
// All fine
return "login"; //NOI18N
- } catch (final UserNotFoundException | UserStatusLockedException | UserStatusUnconfirmedException | UserPasswordMismatchException ex) {
- // Throw again
- throw new FaceletException(ex);
+ } catch (final UserNotFoundException | UserStatusLockedException | UserStatusUnconfirmedException ex) {
+ // Show JSF message
+ this.showFacesMessage("form_user_login:userName", ex); //NOI18N
+ return ""; //NOI18N
+ } catch (final UserPasswordMismatchException ex) {
+ // Show JSF message
+ this.showFacesMessage("form_user_login:userPassword", ex); //NOI18N
+ return ""; //NOI18N
}
}
}
@Override
- public boolean isGuest () {
- return (!this.isUserLoggedIn());
+ public boolean ifUserMustChangePassword () {
+ return (this.isUserLoggedIn() && this.getLoggedInUser().getUserMustChangePassword());
}
@Override
@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()));
+ // NOISY-DEBUG System.out.println(MessageFormat.format("JobsUserLoginWebSessionBean: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));
+ // NOISY-DEBUG System.out.println(MessageFormat.format("JobsUserLoginWebSessionBean:isUserLoggedIn: this.userLoggedIn={0} - EXIT!", this.userLoggedIn));
+
// Return it
return this.userLoggedIn;
}