Subversion Repositories SmartDukaan

Rev

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

Rev 4453 Rev 5510
Line 39... Line 39...
39
	 */
39
	 */
40
	private static final long serialVersionUID = 5390035354379263121L;
40
	private static final long serialVersionUID = 5390035354379263121L;
41
 
41
 
42
	private static Logger log = Logger.getLogger(Class.class);
42
	private static Logger log = Logger.getLogger(Class.class);
43
	private DesEncrypter desEncrypter = new DesEncrypter("saholic");
43
	private DesEncrypter desEncrypter = new DesEncrypter("saholic");
44
	
-
 
-
 
44
	private String loginResult = "0";
45
	private String redirectUrl = "/";
45
	private String redirectUrl = "/";
46
 
46
 
47
	public LoginController() {
47
	public LoginController() {
48
		super();
48
		super();
49
	}
49
	}
Line 131... Line 131...
131
			log.error(UserMessage.USER_AUTHENTICATION_FAILURE, e);
131
			log.error(UserMessage.USER_AUTHENTICATION_FAILURE, e);
132
			return false;
132
			return false;
133
		}
133
		}
134
	}
134
	}
135
 
135
 
-
 
136
	public String authenticateUser() {
-
 
137
		String email, password;
-
 
138
 
-
 
139
		email = this.request.getParameter("email");
-
 
140
		password = this.request.getParameter("password");
-
 
141
 
-
 
142
		if (email == null || password == null) {
-
 
143
			loginResult = "0";
-
 
144
			return "result";
-
 
145
		}
-
 
146
 
-
 
147
		String encryptedPassword = desEncrypter.encrypt(password);
-
 
148
		try{
-
 
149
			UserClient userContextServiceClient = new UserClient();
-
 
150
			in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
-
 
151
			userClient.authenticateUser(email, encryptedPassword);
-
 
152
		}catch (Exception e) {
-
 
153
			loginResult = "0";
-
 
154
			return "result";
-
 
155
		}
-
 
156
		loginResult = "1";
-
 
157
		return "result";
-
 
158
	}
-
 
159
	
-
 
160
	public String getLoginResult() {
-
 
161
		return loginResult;
-
 
162
	}
-
 
163
	
136
	public String getRedirectUrl() {
164
	public String getRedirectUrl() {
137
		return redirectUrl;
165
		return redirectUrl;
138
	}
166
	}
139
 
167
 
140
	public void setRedirectUrl(String redirectUrl) {
168
	public void setRedirectUrl(String redirectUrl) {