reaplced the git service code (main gitbackendinterface()) with a new
[gwvp.git] / gwvplib / plugins / captcha_plugin.php
1 <?php
2 global $CALL_ME_FUNCTIONS;
3
4 $CALL_ME_FUNCTIONS["zzcaptchaimage"] = "gwvp_captchaCallMe";
5
6
7 function gwvp_haveCaptcha()
8 {
9         $thisloc = realpath(dirname(__FILE__));
10         if(file_exists("$thisloc/securimage/securimage_show.php")) {
11                 include_once("$thisloc/securimage/securimage.php");
12                 return true;
13         }
14         else return false;
15         
16 }
17
18 function gwvp_captchaImage()
19 {
20         if(gwvp_haveCaptcha()) {
21                 $thisloc = realpath(dirname(__FILE__));
22                 include("$thisloc/securimage/securimage_show.php");             
23         }
24 }
25
26 function gwvp_captchaCallMe()
27 {
28         if(isset($_REQUEST["q"])) {
29                 $query = $_REQUEST["q"];
30                 $qspl = explode("/", $query);
31                 if($qspl[0] == "securimage") {
32                         error_log("calling captchaimage");
33                         return "gwvp_captchaImage";
34                 }
35         }
36         
37         return false;
38 }
39
40 ?>