Subversion Repositories SmartDukaan

Rev

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

Rev 11932 Rev 12616
Line 86... Line 86...
86
    		addActionError("Please enter password.");
86
    		addActionError("Please enter password.");
87
    		isValid = false;
87
    		isValid = false;
88
        }
88
        }
89
    	
89
    	
90
    	if(!isValid){
90
    	if(!isValid){
91
    	    DataLogger.logData(EventType.REGISTER_DATA_INCOMPLETE, getSessionId(), userinfo.getUserId(), email, "", email);
91
//    	    DataLogger.logData(EventType.REGISTER_DATA_INCOMPLETE, getSessionId(), userinfo.getUserId(), email, "", email);
92
    		return isValid;
92
    		return isValid;
93
    	}
93
    	}
94
    	
94
    	
95
		User user = new User();
95
		User user = new User();
96
		user.setEmail(email);
96
		user.setEmail(email);
Line 126... Line 126...
126
			in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
126
			in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
127
			try{
127
			try{
128
				user = userClient.createUser(user);
128
				user = userClient.createUser(user);
129
			}catch (UserContextException ux){
129
			}catch (UserContextException ux){
130
				addActionError("User already exists with this email id.");
130
				addActionError("User already exists with this email id.");
131
				DataLogger.logData(EventType.REGISTER_FAILED_USER_EXISTS, getSessionId(), userinfo.getUserId(), email, "", email);
131
//				DataLogger.logData(EventType.REGISTER_FAILED_USER_EXISTS, getSessionId(), userinfo.getUserId(), email, "", email);
132
				return false;				
132
				return false;				
133
			}
133
			}
134
			
134
			
135
			long userId = user.getUserId();
135
			long userId = user.getUserId();
136
			userClient.setUserAsLoggedIn(userId, (new Date()).getTime());
136
			userClient.setUserAsLoggedIn(userId, (new Date()).getTime());
Line 171... Line 171...
171
			
171
			
172
	        if (cookiesMap.containsKey(TrackingInterceptor.AFF_COOKIE)) {
172
	        if (cookiesMap.containsKey(TrackingInterceptor.AFF_COOKIE)) {
173
	            long affId = Long.parseLong(cookiesMap.get(TrackingInterceptor.AFF_COOKIE).getValue());
173
	            long affId = Long.parseLong(cookiesMap.get(TrackingInterceptor.AFF_COOKIE).getValue());
174
	            userClient.addTrackLog(affId, userId, TrackLogType.NEW_REGISTRATION, "",email, (new Date()).getTime());
174
	            userClient.addTrackLog(affId, userId, TrackLogType.NEW_REGISTRATION, "",email, (new Date()).getTime());
175
	        }
175
	        }
176
	        DataLogger.logData(EventType.REGISTER_SUCCESS, getSessionId(), userinfo.getUserId(), email, "", email);
176
//	        DataLogger.logData(EventType.REGISTER_SUCCESS, getSessionId(), userinfo.getUserId(), email, "", email);
177
	
177
	
178
			return true;
178
			return true;
179
		} catch (TTransportException e) {
179
		} catch (TTransportException e) {
180
			log.error("Unable to register user." + e);
180
			log.error("Unable to register user." + e);
181
		} catch (UserContextException e) {
181
		} catch (UserContextException e) {
Line 187... Line 187...
187
		} catch (ShoppingCartException e) {
187
		} catch (ShoppingCartException e) {
188
			log.error("Unable to register user." + e);
188
			log.error("Unable to register user." + e);
189
		} catch (WidgetException e) {
189
		} catch (WidgetException e) {
190
			log.error("Unable to register user." + e);
190
			log.error("Unable to register user." + e);
191
		}
191
		}
192
		DataLogger.logData(EventType.REGISTER_FAILED_USER_EXISTS, getSessionId(), userinfo.getUserId(), email, "", email);
192
//		DataLogger.logData(EventType.REGISTER_FAILED_USER_EXISTS, getSessionId(), userinfo.getUserId(), email, "", email);
193
		return false;
193
		return false;
194
		
194
		
195
    }
195
    }
196
 
196
 
197
	public String getRegistrationHeaderSnippet(){
197
	public String getRegistrationHeaderSnippet(){