Subversion Repositories SmartDukaan

Rev

Rev 20529 | Rev 20531 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20427 kshitij.so 1
package com.hotspotstore.controllers;
2
 
20529 kshitij.so 3
import java.io.IOException;
4
 
5
import com.hotspotstore.services.VerifyRecaptcha;
20427 kshitij.so 6
 
7
 
8
public class ContactUsController extends BaseController{
9
 
10
	/**
11
	 * 
12
	 */
13
	private static final long serialVersionUID = 1L;
14
	private String result;
20529 kshitij.so 15
	private String gRecaptchaResponse;
20427 kshitij.so 16
 
17
	public String getResult() {
18
		return result;
19
	}
20
 
21
	public void setResult(String result) {
22
		this.result = result;
23
	}
24
 
25
	public String index(){
26
		return "index";
27
	}
28
 
29
	public String create(){
20529 kshitij.so 30
		try {
20530 kshitij.so 31
			String gRecaptchaResponse = request.getParameter("g-recaptcha-response");
20529 kshitij.so 32
			boolean verify = VerifyRecaptcha.verify(gRecaptchaResponse);
33
			if (verify){
34
				return "contact-us-success";
35
			}
36
			return "contact-us-failure";
37
 
38
		} catch (IOException e) {
39
			// TODO Auto-generated catch block
40
			return "contact-us-failure";
41
		}
42
 
20427 kshitij.so 43
	}
44
 
45
 
46
}