Subversion Repositories SmartDukaan

Rev

Rev 8181 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8181 Rev 8745
Line 44... Line 44...
44
 
44
 
45
		// POST /Forgot password
45
		// POST /Forgot password
46
		public String create() {
46
		public String create() {
47
	    	log.info("ForgotPasswordController.create");
47
	    	log.info("ForgotPasswordController.create");
48
	    	String emailId = request.getParameter("emailId");
48
	    	String emailId = request.getParameter("emailId");
49
	    	if(emailId != null){
49
	    	if(emailId != null && !emailId.isEmpty() && !emailId.contains(" ")){
50
	    		UserClient userContextServiceClient;
50
	    		UserClient userContextServiceClient;
51
				try {
51
				try {
52
					userContextServiceClient = new UserClient();
52
					userContextServiceClient = new UserClient();
53
		    		Client client = userContextServiceClient.getClient();
53
		    		Client client = userContextServiceClient.getClient();
54
		    		if(!client.userExists(emailId)){
54
		    		if(!client.userExists(emailId)){
Line 71... Line 71...
71
				} catch (Exception e) {
71
				} catch (Exception e) {
72
					log.error("Unexpected error while processing forgot password request", e);
72
					log.error("Unexpected error while processing forgot password request", e);
73
					addActionError("Something went wrong. Try again.");
73
					addActionError("Something went wrong. Try again.");
74
				}
74
				}
75
	    	}
75
	    	}
-
 
76
	    	else{
-
 
77
	    		addActionError("Please enter valid email Id...");
-
 
78
	    	}
76
	    	return "failure";
79
	    	return "failure";
77
	    }
80
	    }
78
		
81
		
79
		private boolean mailNewPassword(String emailId, String newPassword) {
82
		private boolean mailNewPassword(String emailId, String newPassword) {
80
			List<String> toList = new ArrayList<String>();
83
			List<String> toList = new ArrayList<String>();