Guest User

Untitled

a guest
Jan 21st, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. String encryptedNewPassword = null;
  2. int userId;
  3. try {
  4. if(Util.isEmpty(password)||Util.isEmpty(userName)||Util.isEmpty(securityAnswer)||Util.isEmpty(securityQuestion))
  5. throw new CustomerEntryExceptions("values are null or empty");
  6.  
  7. encryptedNewPassword = encryptPassword(password);
  8.  
  9. userId =(Integer.parseInt(authenticationMap.get("userid")));
  10. Connection con = Util.getConnection();
  11. if(clientUserManagement.addorupdatesecurityquestion(userName,securityQuestion, securityAnswer,userId,con)){
  12. String updatestatus = updateUserPassword(userId, encryptedNewPassword,
  13. Boolean.parseBoolean(ServiceLocator.getConfigValue("authentication.fail_pwdchange_ind")),Integer.parseInt(ServiceLocator.getConfigValue("authentication.pwd_reason_firstlogin")));
  14. if(updatestatus.equals("updated")){
  15. velocityContextMembers = new HashMap<String,String>();
  16. velocityContextMembers.clear();
  17. velocityContextMembers.put("name", userName);
  18. velocityContextMembers.put("securityquestion", securityQuestion);
  19. velocityContextMembers.put("securityanswer", securityAnswer);
  20. velocityContextMembers.put("password", password);
  21. mailToUser(userId,"Authetication Profile Information","authenticationProfile_email_html.vm");
  22. return true;
  23. } else{
  24. throw new CustomerEntryExceptions("Password not updated");
  25. }
  26. } else{
  27. throw new CustomerEntryExceptions("Authentication profile not updated");
  28. }
  29. } catch (CustomerEntryExceptions e) {
  30. logger.error("createFirstTimerProfile() --> "+e.getMessage());
  31. return false;
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment