Subversion Repositories SmartDukaan

Rev

Rev 23173 | Rev 23271 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23173 Rev 23203
Line 102... Line 102...
102
			fofoDetails.setFofoId(-1);
102
			fofoDetails.setFofoId(-1);
103
			//fofoDetails.setFofo(false);
103
			//fofoDetails.setFofo(false);
104
			User user = null;
104
			User user = null;
105
			try{
105
			try{
106
				user = userRepository.selectByEmailId(emailId);
106
				user = userRepository.selectByEmailId(emailId);
-
 
107
			}catch(ProfitMandiBusinessException profitMandiBusinessException){
-
 
108
				LOGGER.error("User not found with given emailId", profitMandiBusinessException);
-
 
109
			}
-
 
110
			if(user == null){
-
 
111
				try{
-
 
112
					user = userRepository.selectBySecondryEmailId(emailId);
-
 
113
				}catch(ProfitMandiBusinessException profitMandiBusinessException){
-
 
114
					LOGGER.error("User not found with given emailId", profitMandiBusinessException);
-
 
115
				}
-
 
116
			}
-
 
117
			if(user != null){
107
				fofoDetails.setFofoId(user.getId());
118
				fofoDetails.setFofoId(user.getId());
108
				try {
119
				try {
109
					List<UserRole> userRoles = userRoleRepository.selectByUserId(user.getId());
120
					List<UserRole> userRoles = userRoleRepository.selectByUserId(user.getId());
110
					for(int index = 0; index < userRoles.size(); index++){
121
					for(int index = 0; index < userRoles.size(); index++){
111
						roleTypes.add(userRoles.get(index).getRoleType());
122
						roleTypes.add(userRoles.get(index).getRoleType());
Line 117... Line 128...
117
						//fofoDetails.setFofo(retailer.isFofo());
128
						//fofoDetails.setFofo(retailer.isFofo());
118
					}
129
					}
119
				} catch(ProfitMandiBusinessException pmbe) {
130
				} catch(ProfitMandiBusinessException pmbe) {
120
					LOGGER.error("Data Inconsistent", pmbe);
131
					LOGGER.error("Data Inconsistent", pmbe);
121
				}
132
				}
122
			}catch(ProfitMandiBusinessException profitMandiBusinessException){
-
 
123
				LOGGER.error("User not found with given emailId", profitMandiBusinessException);
-
 
124
			}
133
			}
125
			String redirectUrl = Utils.getRedictUrlFromLogin(fofoDetails);
134
			String redirectUrl = Utils.getRedictUrlFromLogin(fofoDetails);
126
			if(!redirectUrl.equals("/login")){
135
			if(!redirectUrl.equals("/login")){
127
				this.addCookiesToResponse(fofoDetails, request, response);
136
				this.addCookiesToResponse(fofoDetails, request, response);
128
				LOGGER.info("Requested token email_id is valid, user login to system, shoud be redirect to {}", redirectUrl);
137
				LOGGER.info("Requested token email_id is valid, user login to system, shoud be redirect to {}", redirectUrl);