Package es.udc.tfg.journals.web.util

Examples of es.udc.tfg.journals.web.util.UserSession


          try {

            User userProfile = userService.login(loginName,
                encryptedPassword, true);
            UserSession userSession = new UserSession();
            userSession.setUserId(userProfile.getUserId());
            userSession.setFirstName(userProfile.getFirstName());
            userSession.setRole(userProfile.getRole());
            applicationStateManager.set(UserSession.class,
                userSession);

          } catch (InstanceNotFoundException e) {
            CookiesManager.removeCookies(cookies);
View Full Code Here


      }
    }
  }

  Object onSuccessFromRegistrationForm() {
    userSession = new UserSession();
    userSession.setUserId(user.getUserId());
    userSession.setFirstName(user.getFirstName());
    userSession.setRole(user.getRole());
    return Index.class;
  }
View Full Code Here

      loginForm.recordError(messages.get("error-authenticationFailed"));
    }
  }

  Object onSuccessFromLoginForm() throws MalformedURLException {
    userSession = new UserSession();
    userSession.setUserId(user.getUserId());
    userSession.setFirstName(user.getFirstName());
    userSession.setRole(user.getRole());

    if (rememberMyPassword) {
View Full Code Here

      error = true;
    }
  }

  private Object createUserSession() {
    userSession = new UserSession();
    userSession.setUserId(user.getUserId());
    userSession.setFirstName(user.getFirstName());
    userSession.setRole(user.getRole());
    if (error) {
      return InternalErrorPage.class;
View Full Code Here

    boolean userAuthenticated = applicationStateManager
        .exists(UserSession.class);

    switch (policyType) {
    case ADMIN:
      UserSession userSession = applicationStateManager
          .getIfExists(UserSession.class);
      if (!userAuthenticated) {
        redirectPage = LOGIN_PAGE;
      } else if (!(userSession.isAdmin())) {
        redirectPage = UNAUTHORIZED_PAGE;
      }
      break;

    case AUTHENTICATED_USERS:
View Full Code Here

      error = true;
    }
  }

  private Object createUserSession() {
    userSession = new UserSession();
    userSession.setUserId(user.getUserId());
    userSession.setFirstName(user.getFirstName());
    userSession.setRole(user.getRole());
    if (error) {
      return InternalErrorPage.class;
View Full Code Here

TOP

Related Classes of es.udc.tfg.journals.web.util.UserSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.