summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasiekierka <asiekierka@gmail.com>2012-12-22 17:44:43 +0100
committerasiekierka <asiekierka@gmail.com>2012-12-22 17:44:43 +0100
commitf754fcaea1bd4b67cd4d7a8fb90ed9f52f0605f2 (patch)
tree5cb5624f0a2186e9dce69ec44ea45e543f5262f4
parent549ecc200e16789f5b0cde8b38b0c4a70759da1f (diff)
integrated imgcaptcha with Tinyboard
-rw-r--r--imgcaptcha_im.php7
-rw-r--r--imgcaptcha_p.php5
-rw-r--r--inc/imgcaptcha.php2
-rw-r--r--js/imgcaptcha.js4
4 files changed, 15 insertions, 3 deletions
diff --git a/imgcaptcha_im.php b/imgcaptcha_im.php
new file mode 100644
index 00000000..152d92ad
--- /dev/null
+++ b/imgcaptcha_im.php
@@ -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);
+?>
diff --git a/imgcaptcha_p.php b/imgcaptcha_p.php
new file mode 100644
index 00000000..9543dc6c
--- /dev/null
+++ b/imgcaptcha_p.php
@@ -0,0 +1,5 @@
+<?php
+ require_once("inc/functions.php");
+ require_once("inc/imgcaptcha.php");
+ print generateCaptchaHash();
+?>
diff --git a/inc/imgcaptcha.php b/inc/imgcaptcha.php
index dae42752..77441fce 100644
--- a/inc/imgcaptcha.php
+++ b/inc/imgcaptcha.php
@@ -39,7 +39,7 @@
$converter = new Encryption;
return $converter->encode($enctext);
}
- function ac_verifyHash($enctext, $output) {
+ function ic_verifyHash($enctext, $output) {
//print "VERIFY: " . $enctext . " " . $output . "<br>";
$converter = new Encryption;
$dectext = split(",,",$converter->decode($enctext));
diff --git a/js/imgcaptcha.js b/js/imgcaptcha.js
index dd313fad..d8f922fe 100644
--- a/js/imgcaptcha.js
+++ b/js/imgcaptcha.js
@@ -3,9 +3,9 @@
//}
function imgcaptcha_odswiezKapcze() {
- $.get("/inc/imgcaptcha_p.php", function(data) {
+ $.get("/imgcaptcha_p.php", function(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() {