summary refs log tree commit diff stats
path: root/pages
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2010-08-17 13:40:52 -0400
committerStarla Insigna <hatkirby@fourisland.com>2010-08-17 13:40:52 -0400
commit0085e272b2002437f11f74ccdde0d6975f2cd9f2 (patch)
treef64e03d63c8566f85f0fdaf33ac88848824f2737 /pages
parent3b2e04f16a595893e8736a9b816bad81ecc8bf6a (diff)
downloadfourisland-0085e272b2002437f11f74ccdde0d6975f2cd9f2.tar.gz
fourisland-0085e272b2002437f11f74ccdde0d6975f2cd9f2.tar.bz2
fourisland-0085e272b2002437f11f74ccdde0d6975f2cd9f2.zip
Added back reCAPTCHA
Because of the lifting of the jail around my server, it can once again use reCAPTCHAs for security.

Backed out changeset 9332c237adcd
Diffstat (limited to 'pages')
-rwxr-xr-xpages/post.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/pages/post.php b/pages/post.php index fd826a5..121435a 100755 --- a/pages/post.php +++ b/pages/post.php
@@ -21,7 +21,9 @@
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} 21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22 22
23require('headerproc.php'); 23require('headerproc.php');
24require('includes/securimage/securimage.php'); 24
25include('includes/recaptchalib.php');
26$privatekey = "6LfgvgEAAAAAAD0_UVLp57MU7tqcypsbZPS9qTnr";
25 27
26if (!isset($_POST['id'])) 28if (!isset($_POST['id']))
27{ 29{
@@ -39,11 +41,10 @@ if (!isset($_POST['id']))
39 } else { 41 } else {
40 if (preg_match('/^[A-Za-z0-9!#$&\'*+-\/=?^_`{|}~]+@[-A-Za-z0-9]+(\.[-A-Za-z0-9]+)+[A-Za-z]$/', $_POST['email'])) 42 if (preg_match('/^[A-Za-z0-9!#$&\'*+-\/=?^_`{|}~]+@[-A-Za-z0-9]+(\.[-A-Za-z0-9]+)+[A-Za-z]$/', $_POST['email']))
41 { 43 {
42 $img = new Securimage; 44 $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
43 45 if (!$resp->is_valid)
44 if ($img->check($_POST['code']) == false)
45 { 46 {
46 die('The CAPTCHA wasn\'t entered correctly. Go back and try it again.'); 47 die('The reCAPTCHA wasn\'t entered correctly. Go back and try it again.');
47 } else { 48 } else {
48 $getanon = "SELECT * FROM anon_commenters WHERE username = \"" . $_POST['username'] . "\""; 49 $getanon = "SELECT * FROM anon_commenters WHERE username = \"" . $_POST['username'] . "\"";
49 $getanon2 = mysql_query($getanon); 50 $getanon2 = mysql_query($getanon);