Package org.hoteia.qalingo.core.domain

Examples of org.hoteia.qalingo.core.domain.User


    @Override
    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
        Authentication authentication) throws IOException, ServletException {

      // Find the current user
      User user = userService.getUserByLoginOrEmail(authentication.getName());

      // Persit only the new UserConnectionLog
      UserConnectionLog userConnectionLog = new UserConnectionLog();
      userConnectionLog.setUserId(user.getId());
      userConnectionLog.setLoginDate(new Date());
      userConnectionLog.setApp(Constants.APP_NAME_BO_BUSINESS_CODE);
      userConnectionLog.setHost(request.getRemoteHost());
     
      userConnectionLog.setPublicAddress(request.getRemoteAddr());
        userConnectionLog.setPrivateAddress(request.getHeader(Constants.X_FORWARDED_FOR));
     
      userConnectionLogService.saveOrUpdateUserConnectionLog(userConnectionLog);

    try {
        // Update the User in Session
        user.getConnectionLogs().add(userConnectionLog);
        requestUtil.updateCurrentUser(request, user);
       
            setUseReferer(false);
            String targetUrl = null;
            String lastUrl = requestUtil.getCurrentRequestUrlNotSecurity(request);
View Full Code Here


  @Resource(name="assembler")
  protected Assembler assembler;

  @Transactional(readOnly = true)
  public org.springframework.security.core.userdetails.User loadUserByUsername(String usernameOrEmail) throws UsernameNotFoundException, DataAccessException {
    User userDetails = null;
    userDetails = userService.getUserByLoginOrEmail(usernameOrEmail);
    if (userDetails == null) {
      throw new UsernameNotFoundException("user not found");
    }
    return assembler.buildUserFromUserEntity(userDetails);
View Full Code Here

    final RequestUtil requestUtil = (RequestUtil) ctx.getBean("requestUtil");

    // THEME
    try {
        final RequestData requestData = requestUtil.getRequestData(request);
      User user = requestData.getUser();
      if(user !=null){
        final Company company = user.getCompany();
        if(company != null
            && StringUtils.isNotEmpty(company.getTheme())){
          String themeFolder = company.getTheme();
          requestUtil.updateCurrentTheme(request, themeFolder);
        }
View Full Code Here

   
    // USER
   
    public User createOrUpdatePersonalUser(User user, final UserForm userForm) {
        if (user == null) {
            user = new User();
        }
        user = handleUserForm(user, userForm);
        return userService.saveOrUpdateUser(user);
    }
View Full Code Here

        return userService.saveOrUpdateUser(user);
    }

    public User createOrUpdateUser(User user, final UserForm userForm) {
        if (user == null) {
            user = new User();
        }
        user = handleUserForm(user, userForm);
        return userService.saveOrUpdateUser(user);
    }
View Full Code Here

    /**
     *
     */
    public User buildNewUser(final UserForm userForm) throws Exception {
        User user = new User();
        user = handleUserForm(user, userForm);
        return user;
    }
View Full Code Here

    /**
     *
     */
    public User buildAndRegisterNewActiveUser(final RequestData requestData, final UserForm userForm) throws Exception {
        User user = buildNewUser(userForm);
        // FORCE TO ACTIVE A REGISTER USER
        user.setActive(true);
        return user;
    }
View Full Code Here

        return user;
    }
   
    protected User handleUserForm(User user, final UserForm userForm) {
        if (user == null) {
            user = new User();
        }
        user.setTitle(userForm.getTitle());
        user.setLastname(userForm.getLastname());
        user.setFirstname(userForm.getFirstname());
        user.setEmail(userForm.getEmail());

        if (StringUtils.isNotEmpty(userForm.getLogin())) {
            user.setLogin(userForm.getLogin());
        } else {
            String login = userForm.getFirstname().substring(0, 1) + userForm.getLastname();
            User checkUserLogin = userService.getUserByLoginOrEmail(login);
            int i = 1;
            while (checkUserLogin != null) {
                login = userForm.getFirstname().substring(0, 1) + userForm.getLastname() + i;
                checkUserLogin = userService.getUserByLoginOrEmail(login);
                i++;
View Full Code Here

                        AbstractPaymentGateway paymentGateway = (AbstractPaymentGateway) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_PAYMENT_GATEWAY_CODE, handleParamValue(paymentGateway.getCode().toString()));
                        break;
                    } else if (param instanceof User
                            && !urlWithoutWildcard.equals(BoUrls.PERSONAL_DETAILS.getUrlWithoutWildcard()) && !urlWithoutWildcard.equals(BoUrls.PERSONAL_EDIT.getUrlWithoutWildcard())) {
                        User user = (User) param;
                        getParams.put(RequestConstants.REQUEST_PARAMETER_USER_CODE, handleParamValue(user.getLogin()));
                        break;
                    } else if (param instanceof Retailer){
                      Retailer retailer = (Retailer) param;
                      getParams.put(RequestConstants.REQUEST_PARAMETER_RETAILER_CODE, handleParamValue(retailer.getCode()));
                      break;
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.domain.User

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.