| 1183 |
varun.gupt |
1 |
package in.shop2020.serving.controllers;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.model.v1.user.Sex;
|
|
|
4 |
import in.shop2020.model.v1.user.User;
|
|
|
5 |
import in.shop2020.serving.utils.DesEncrypter;
|
|
|
6 |
import in.shop2020.serving.utils.Utils;
|
|
|
7 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
|
|
8 |
|
|
|
9 |
import java.io.IOException;
|
|
|
10 |
import java.util.Date;
|
|
|
11 |
|
|
|
12 |
import org.apache.log4j.Logger;
|
|
|
13 |
import org.apache.struts2.convention.annotation.Result;
|
|
|
14 |
import org.apache.struts2.convention.annotation.Results;
|
|
|
15 |
|
|
|
16 |
/**
|
|
|
17 |
* @author Varun Gupta
|
|
|
18 |
*/
|
|
|
19 |
|
|
|
20 |
@Results({
|
|
|
21 |
@Result(name="success", type="redirectAction",
|
|
|
22 |
params = {"actionName" , "home"}),
|
|
|
23 |
@Result(name="failure", type="redirectAction",
|
|
|
24 |
params = {"actionName" , "register"})
|
|
|
25 |
})
|
|
|
26 |
public class UserController extends BaseController{
|
|
|
27 |
|
|
|
28 |
private static final long serialVersionUID = 1L;
|
|
|
29 |
private static Logger log = Logger.getLogger(Class.class);
|
|
|
30 |
private DesEncrypter desEncrypter = new DesEncrypter("saholic");
|
|
|
31 |
|
|
|
32 |
public UserController(){
|
|
|
33 |
super();
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
public String index() throws SecurityException, IOException {
|
|
|
37 |
if(userinfo.isLoggedIn()){
|
|
|
38 |
return "success";
|
|
|
39 |
}
|
| 1184 |
varun.gupt |
40 |
htmlSnippets.put("REGISTRATION_HEADER",pageLoader.getSigninSignupHeaderHtml());
|
| 1183 |
varun.gupt |
41 |
htmlSnippets.put("REGISTRATION_FORM",pageLoader.getRegistrationFormHtml());
|
|
|
42 |
return "index";
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
public String getRegistrationHeaderSnippet(){
|
|
|
46 |
return htmlSnippets.get("REGISTRATION_HEADER");
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
public String getRegistrationFormSnippet(){
|
|
|
50 |
return htmlSnippets.get("REGISTRATION_FORM");
|
|
|
51 |
}
|
|
|
52 |
}
|