Subversion Repositories SmartDukaan

Rev

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

Rev 27238 Rev 33070
Line 27... Line 27...
27
		if (cookies == null){
27
		if (cookies == null){
28
			throw new ProfitMandiBusinessException("cookies", "", "GE_1008");
28
			throw new ProfitMandiBusinessException("cookies", "", "GE_1008");
29
		}
29
		}
30
		String fofoIdFound = null, emailIdFound = null, roleIdsString = null, readOnlyString = null;
30
		String fofoIdFound = null, emailIdFound = null, roleIdsString = null, readOnlyString = null;
31
		for(Cookie cookie : cookies){
31
		for(Cookie cookie : cookies){
32
			LOGGER.info("Requested Cookie {}={}", cookie.getName(), cookie.getValue());
32
			//LOGGER.info("Requested Cookie {}={}", cookie.getName(), cookie.getValue());
33
			if(cookie.getName().equals(ProfitMandiConstants.FOFO_ID) && cookie.getValue() != null && !cookie.getValue().isEmpty()){
33
			if(cookie.getName().equals(ProfitMandiConstants.FOFO_ID) && cookie.getValue() != null && !cookie.getValue().isEmpty()){
34
				fofoIdFound = cookie.getValue();
34
				fofoIdFound = cookie.getValue();
35
			}
35
			}
36
			if(cookie.getName().equals(ProfitMandiConstants.EMAIL_ID) && cookie.getValue() != null && !cookie.getValue().isEmpty()){
36
			if(cookie.getName().equals(ProfitMandiConstants.EMAIL_ID) && cookie.getValue() != null && !cookie.getValue().isEmpty()){
37
				emailIdFound = cookie.getValue();
37
				emailIdFound = cookie.getValue();
Line 52... Line 52...
52
				break;
52
				break;
53
			}
53
			}
54
		}
54
		}
55
		
55
		
56
		if(fofoIdFound == null || emailIdFound == null || roleIdsString == null){
56
		if(fofoIdFound == null || emailIdFound == null || roleIdsString == null){
57
			LOGGER.info("roleIdString is {}", roleIdsString);
-
 
58
			LOGGER.info("fofoIdFound is {}", fofoIdFound);
-
 
59
			LOGGER.info("emailIdFound is {}", emailIdFound);
-
 
60
			LOGGER.error("Requested session is not valid");
57
			LOGGER.error("Requested session is not valid");
61
			throw new ProfitMandiBusinessException("cookies", "", "GE_1008");
58
			throw new ProfitMandiBusinessException("cookies", "", "GE_1008");
62
		}else {
59
		}else {
63
			LoginDetails fofoDetails = new LoginDetails();
60
			LoginDetails fofoDetails = new LoginDetails();
64
			fofoDetails.setFofoId(Integer.parseInt(fofoIdFound));
61
			fofoDetails.setFofoId(Integer.parseInt(fofoIdFound));
65
			fofoDetails.setEmailId(emailIdFound);
62
			fofoDetails.setEmailId(emailIdFound);
-
 
63
			LOGGER.info("Session validated for - {}", fofoDetails);
66
			String[] roleIdStrings = StringUtils.split(roleIdsString, "-");
64
			String[] roleIdStrings = StringUtils.split(roleIdsString, "-");
67
			if(roleIdStrings.length==1) {
65
			if(roleIdStrings.length==1) {
68
				roleIdStrings = StringUtils.split(roleIdsString, ",");
66
				roleIdStrings = StringUtils.split(roleIdsString, ",");
69
			}
67
			}
70
			Set<Integer> roleIds = new HashSet<>();
68
			Set<Integer> roleIds = new HashSet<>();