Package org.hoteia.qalingo.core.domain

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


    customerCredential.setDateUpdate(new Date());
        if (customerCredential.getId() != null) {
            if(em.contains(customerCredential)){
                em.refresh(customerCredential);
            }
            CustomerCredential mergedCustomerCredential = em.merge(customerCredential);
            em.flush();
            return mergedCustomerCredential;
        } else {
            em.persist(customerCredential);
            return customerCredential;
View Full Code Here


        addMessageError(result, null, "forgottenPasswordForm", "emailOrLogin",  getSpecificMessage(ScopeWebMessage.AUTH, "error_form_reset_password_customer_is_not_active", locale));
      return displayForgottenPassword(request, modelMap);
    }
   
    // FLAG THE CREDENTIAL WITH A TOKEN
    CustomerCredential customerCredential = webManagementService.flagCustomerCredentialWithToken(requestData, customer);
   
    webManagementService.buildAndSaveCustomerForgottenPasswordMail(requestData, customer, customerCredential, forgottenPasswordForm);
   
        return modelAndView;
  }
View Full Code Here

     *
     */
    public CustomerCredential flagCustomerCredentialWithToken(final RequestData requestData, final Customer customer) throws Exception {
        if(customer != null){
            String token = UUID.randomUUID().toString();
            CustomerCredential customerCredential = customer.getCurrentCredential();
            if(customerCredential != null){
                customerCredential.setResetToken(token);
                Date date = new Date();
                customerCredential.setTokenTimestamp(new Timestamp(date.getTime()));
                customerService.saveOrUpdateCustomerCredential(customerCredential);
            }
            return customerCredential;
        }
        return null;
View Full Code Here

    /**
     *
     */
    public void cancelCustomerCredentialToken(final RequestData requestData, final Customer customer) throws Exception {
        if(customer != null){
            CustomerCredential customerCredential = customer.getCurrentCredential();
            if(customerCredential != null){
                customerCredential.setResetToken("");
                customerCredential.setTokenTimestamp(null);
                customerService.saveOrUpdateCustomerCredential(customerCredential);
            }
        }
    }
View Full Code Here

     */
    public void resetCustomerCredential(final RequestData requestData, final Customer customer, final String newPassword) throws Exception {
        if(customer != null){
            String clearPassword = newPassword;
            String encorePassword = securityUtil.encodePassword(clearPassword);
            CustomerCredential customerCredential = new CustomerCredential();
            customerCredential.setPassword(encorePassword);
            customerCredential.setDateUpdate(new Date());
            customer.getCredentials().add(customerCredential);
           
            customer.setPassword(encorePassword);
           
            customerService.saveOrUpdateCustomer(customer);
View Full Code Here

TOP

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

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.