Package edu.asu.securebanking.businessobject

Examples of edu.asu.securebanking.businessobject.CreateInternalAccountBO


    } else{
    ApplicationContext appContext = new ClassPathXmlApplicationContext("spring/config/BeanLocations.xml");
    LoginAttemptBO loginAttemptBO = (LoginAttemptBO)appContext.getBean("loginAttemptBO");
       CreateExternalAccountBO createExternalAccountBO = (CreateExternalAccountBO)appContext.getBean("createExternalAccountBO");
       CreateInternalAccountBO createInternalAccountBO = (CreateInternalAccountBO)appContext.getBean("createInternalAccountBO");

    String userType = loginAttemptBO.findRecoveryAccount(forgot_user.getUsername(),
        forgot_user.getEmail(), forgot_user.getTelephone(),
        forgot_user.getSecurityquestion(), forgot_user.getSecurityanswer());
    String otp_pwd = this.generateOTP();
   
    //find user from database and update password
   
    if(userType == "INTERNAL"){
      InternalAccount ia = loginAttemptBO.findAccountByNameInternal(forgot_user.getUsername());
      if(ia != null)
      {
          try{
              MessageDigest digest = MessageDigest.getInstance("SHA-256");
              byte[] hash = digest.digest(otp_pwd.getBytes("UTF-8"));
              StringBuffer hexString = new StringBuffer();

              for (int i = 0; i < hash.length; i++) {
                  String hex = Integer.toHexString(0xff & hash[i]);
                  if(hex.length() == 1) hexString.append('0');
                  hexString.append(hex);
              }
              this.sendPwdRecoveryEmail(ia.getEmail(), ia.getUsername(), otp_pwd);
              ia.setPassword(hexString.toString());
              //ia.setPassword(otp_pwd);
              createInternalAccountBO.update(ia);
          } catch(Exception ex){
             throw new RuntimeException(ex);
          }
      }
      else
View Full Code Here


    //default values
    createInternalAccount.setFirstTimeLogin(true)//1 - true

    ApplicationContext appContext = new ClassPathXmlApplicationContext("spring/config/BeanLocations.xml");

    CreateInternalAccountBO createInternalAccountBO = (CreateInternalAccountBO)appContext.getBean("createInternalAccountBO");

    createInternalAccountBO.save(createInternalAccount);

    return new ModelAndView("internalAccountSuccess");
  }
View Full Code Here

TOP

Related Classes of edu.asu.securebanking.businessobject.CreateInternalAccountBO

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.