Subversion Repositories SmartDukaan

Rev

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

Rev 2145 Rev 2157
Line 14... Line 14...
14
 
14
 
15
import java.io.IOException;
15
import java.io.IOException;
16
import java.util.Date;
16
import java.util.Date;
17
import java.util.List;
17
import java.util.List;
18
 
18
 
19
import org.apache.commons.lang.StringUtils;
-
 
20
import org.apache.log4j.Logger;
19
import org.apache.log4j.Logger;
21
import org.apache.struts2.convention.annotation.Result;
20
import org.apache.struts2.convention.annotation.Result;
22
import org.apache.struts2.convention.annotation.Results;
21
import org.apache.struts2.convention.annotation.Results;
23
 
22
 
24
/**
23
/**
Line 37... Line 36...
37
	 * 
36
	 * 
38
	 */
37
	 */
39
	private static final long serialVersionUID = 5390035354379263121L;
38
	private static final long serialVersionUID = 5390035354379263121L;
40
 
39
 
41
	private static Logger log = Logger.getLogger(Class.class);
40
	private static Logger log = Logger.getLogger(Class.class);
42
	private static Logger dataLog = DataLogger.getLogger();
-
 
43
	private DesEncrypter desEncrypter = new DesEncrypter("saholic");
41
	private DesEncrypter desEncrypter = new DesEncrypter("saholic");
44
	
42
	
45
	private String redirectUrl = null;
43
	private String redirectUrl = null;
46
 
44
 
47
	public LoginController() {
45
	public LoginController() {
Line 56... Line 54...
56
	}
54
	}
57
 
55
 
58
	public String create() throws SecurityException, Exception {
56
	public String create() throws SecurityException, Exception {
59
		if (loginUser()) {
57
		if (loginUser()) {
60
			log.info(redirectUrl);
58
			log.info(redirectUrl);
61
            dataLog.info(StringUtils.join(
-
 
62
                    new String[] { Event.LOGIN_SUCCESS.name(),
59
            DataLogger.logData(Event.LOGIN_SUCCESS.name(),
63
                            this.request.getParameter("email") }, ", "));
60
                            this.request.getParameter("email"));
64
			return "redirect";
61
			return "redirect";
65
		} else {
62
		} else {
66
			addActionError(UserMessage.USER_AUTHENTICATION_FAILURE);
63
			addActionError(UserMessage.USER_AUTHENTICATION_FAILURE);
67
            dataLog.info(StringUtils.join(
-
 
68
                    new String[] { Event.LOGIN_FAILED.name(),
-
 
69
                            this.request.getParameter("email") }, ", "));
64
            DataLogger.logData(Event.LOGIN_FAILED.name(), this.request.getParameter("email"));
70
			return "login";
65
			return "login";
71
		}
66
		}
72
	}
67
	}
73
 
68
 
74
	private boolean loginUser() {
69
	private boolean loginUser() {