made my star image a bit nicer
[gwvp.git] / gwvplib / plugins / captcha_plugin.php
diff --git a/gwvplib/plugins/captcha_plugin.php b/gwvplib/plugins/captcha_plugin.php
new file mode 100644 (file)
index 0000000..e952271
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+global $CALL_ME_FUNCTIONS;
+
+$CALL_ME_FUNCTIONS["zzcaptchaimage"] = "gwvp_captchaCallMe";
+
+
+function gwvp_haveCaptcha()
+{
+       $thisloc = realpath(dirname(__FILE__));
+       if(file_exists("$thisloc/securimage/securimage_show.php")) {
+               include_once("$thisloc/securimage/securimage.php");
+               return true;
+       }
+       else return false;
+       
+}
+
+function gwvp_captchaImage()
+{
+       if(gwvp_haveCaptcha()) {
+               $thisloc = realpath(dirname(__FILE__));
+               include("$thisloc/securimage/securimage_show.php");             
+       }
+}
+
+function gwvp_captchaCallMe()
+{
+       if(isset($_REQUEST["q"])) {
+               $query = $_REQUEST["q"];
+               $qspl = explode("/", $query);
+               if($qspl[0] == "securimage") {
+                       error_log("calling captchaimage");
+                       return "gwvp_captchaImage";
+               }
+       }
+       
+       return false;
+}
+
+?>
\ No newline at end of file