integrated imgcaptcha with Tinyboard

This commit is contained in:
asiekierka 2012-12-22 17:44:43 +01:00
parent 549ecc200e
commit f754fcaea1
4 changed files with 15 additions and 3 deletions

7
imgcaptcha_im.php Normal file
View File

@ -0,0 +1,7 @@
<?php
require_once("inc/functions.php");
require_once("inc/imgcaptcha.php");
$t = $_GET["cr"];
header("Content-Type: image/png");
generateImage($t);
?>

5
imgcaptcha_p.php Normal file
View File

@ -0,0 +1,5 @@
<?php
require_once("inc/functions.php");
require_once("inc/imgcaptcha.php");
print generateCaptchaHash();
?>

View File

@ -39,7 +39,7 @@
$converter = new Encryption; $converter = new Encryption;
return $converter->encode($enctext); return $converter->encode($enctext);
} }
function ac_verifyHash($enctext, $output) { function ic_verifyHash($enctext, $output) {
//print "VERIFY: " . $enctext . " " . $output . "<br>"; //print "VERIFY: " . $enctext . " " . $output . "<br>";
$converter = new Encryption; $converter = new Encryption;
$dectext = split(",,",$converter->decode($enctext)); $dectext = split(",,",$converter->decode($enctext));

View File

@ -3,9 +3,9 @@
//} //}
function imgcaptcha_odswiezKapcze() { function imgcaptcha_odswiezKapcze() {
$.get("/inc/imgcaptcha_p.php", function(data) { $.get("/imgcaptcha_p.php", function(data) {
$("#imgcaptcha_hash").val(data); $("#imgcaptcha_hash").val(data);
$("#imgcaptcha_img").prop("src","/inc/imgcaptcha_im.php?cr=" + data); $("#imgcaptcha_img").prop("src","/imgcaptcha_im.php?cr=" + data);
}); });
} }
//function resetujKapcze() { //function resetujKapcze() {