Subversion Repositories SmartDukaan

Rev

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

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