Subversion Repositories SmartDukaan

Rev

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

Rev 1625 Rev 1776
Line 25... Line 25...
25
 * @author rajveer
25
 * @author rajveer
26
 *
26
 *
27
 */
27
 */
28
 
28
 
29
@Results({
29
@Results({
30
    @Result(name="success", type="redirectAction", 
30
    @Result(name = "success", type = "redirectAction", params = {"actionName" , "home"}),
31
    		params = {"actionName" , "home"}),
-
 
32
    @Result(name="failure", type="redirectAction", 
31
    @Result(name = "failure", type = "redirectAction", params = {"actionName" , "register"}),
33
    		params = {"actionName" , "register"})
32
    @Result(name = "redirect", location = "${redirectUrl}", type = "redirect")
34
   		
33
   		
35
})
34
})
36
public class RegisterController extends BaseController{
35
public class RegisterController extends BaseController{
37
		
36
		
38
	private static final long serialVersionUID = 1L;
37
	private static final long serialVersionUID = 1L;
39
	private static Logger log = Logger.getLogger(Class.class);
38
	private static Logger log = Logger.getLogger(Class.class);
40
	private DesEncrypter desEncrypter = new DesEncrypter("saholic");
39
	private DesEncrypter desEncrypter = new DesEncrypter("saholic");
41
	
40
	
-
 
41
	private String redirectUrl = null;
-
 
42
 
42
	public RegisterController(){
43
	public RegisterController(){
43
		super();
44
		super();
44
	}
45
	}
45
 
46
 
46
 
-
 
47
    public String index() throws SecurityException, IOException {
47
    public String index() throws SecurityException, IOException {
48
    	if(userinfo.isLoggedIn()){
48
    	if(userinfo.isLoggedIn()){
49
    		return "success";
49
    		return "success";
50
    	}
50
    	}
51
    	htmlSnippets.put("REGISTRATION_HEADER",pageLoader.getRegistrationHeaderHtml());
51
    	htmlSnippets.put("REGISTRATION_HEADER",pageLoader.getRegistrationHeaderHtml());
Line 54... Line 54...
54
    }
54
    }
55
 
55
 
56
    public String create() throws SecurityException, Exception {
56
    public String create() throws SecurityException, Exception {
57
    	
57
    	
58
    	if(registerUser())
58
    	if(registerUser())
59
    		return "success";
59
    		return "redirect";
60
    	else
60
    	else
61
    		return "failure";
61
    		return "failure";
62
    }
62
    }
63
    
63
    
64
    public boolean registerUser() throws Exception{
64
    public boolean registerUser() throws Exception{
Line 174... Line 174...
174
	}
174
	}
175
	
175
	
176
	public String getRegistrationFormSnippet(){
176
	public String getRegistrationFormSnippet(){
177
		return htmlSnippets.get("REGISTRATION_FORM");
177
		return htmlSnippets.get("REGISTRATION_FORM");
178
	}
178
	}
-
 
179
	public String getRedirectUrl() {
-
 
180
		return redirectUrl;
-
 
181
	}
179
 
182
 
-
 
183
	public void setRedirectUrl(String redirectUrl) {
-
 
184
		this.redirectUrl = redirectUrl;
-
 
185
	}
180
}
186
}
181
187