/**
  * Get the captcha image or sound or validation result.
  */
 public function GetCaptchaResponse()
 {
     if (is_null($this->Captcha)) {
         HttpHelper::BadRequest('captcha');
     }
     $commandString = $this->GetUrlParameter('get');
     if (!\LBD_StringHelper::HasValue($commandString)) {
         \LBD_HttpHelper::BadRequest('command');
     }
     $command = \LBD_CaptchaHttpCommand::FromQuerystring($commandString);
     switch ($command) {
         case \LBD_CaptchaHttpCommand::GetImage:
             $responseBody = $this->GetImage();
             break;
         case \LBD_CaptchaHttpCommand::GetSound:
             $responseBody = $this->GetSound();
             break;
         case \LBD_CaptchaHttpCommand::GetValidationResult:
             $responseBody = $this->GetValidationResult();
             break;
         default:
             \LBD_HttpHelper::BadRequest('command');
             break;
     }
     // disallow audio file search engine indexing
     header('X-Robots-Tag: noindex, nofollow, noarchive, nosnippet');
     echo $responseBody;
     exit;
 }
示例#2
0
 public function index()
 {
     $commandString = $this->input->get('get');
     if (!LBD_StringHelper::HasValue($commandString)) {
         LBD_HttpHelper::BadRequest('command');
     }
     $command = LBD_CaptchaHttpCommand::FromQuerystring($commandString);
     switch ($command) {
         case LBD_CaptchaHttpCommand::GetImage:
             $responseBody = $this->GetImage();
             break;
         case LBD_CaptchaHttpCommand::GetSound:
             $responseBody = $this->GetSound();
             break;
         case LBD_CaptchaHttpCommand::GetValidationResult:
             $responseBody = $this->GetValidationResult();
             break;
         default:
             LBD_HttpHelper::BadRequest('command');
             break;
     }
     $this->output->cache(0);
     $this->output->set_output($responseBody);
 }
<?php

session_start();
LBD_HttpHelper::FixEscapedQuerystrings();
LBD_HttpHelper::CheckForIgnoredRequests();
// There are several Captcha commands accessible through the Http interface;
// first we detect which of the valid commands is the current Http request for.
if (!array_key_exists('get', $_GET) || !LBD_StringHelper::HasValue($_GET['get'])) {
    LBD_HttpHelper::BadRequest('command');
}
$commandString = LBD_StringHelper::Normalize($_GET['get']);
$command = LBD_CaptchaHttpCommand::FromQuerystring($commandString);
switch ($command) {
    case LBD_CaptchaHttpCommand::GetImage:
        GetImage();
        break;
    case LBD_CaptchaHttpCommand::GetSound:
        GetSound();
        break;
    case LBD_CaptchaHttpCommand::GetValidationResult:
        GetValidationResult();
        break;
    default:
        LBD_HttpHelper::BadRequest('command');
        break;
}
// Returns the Captcha image binary data
function GetImage()
{
    // saved data for the specified Captcha object in the application
    $captcha = GetCaptchaObject();
 public static function SoundUrl($_0zlmzzar2ejc7stvyhq76ob56d)
 {
     $_1zgfy2orc7hskgem = LBD_CaptchaHttpCommand::GetQuerystring(1, $_0zlmzzar2ejc7stvyhq76ob56d->CaptchaId, $_0zlmzzar2ejc7stvyhq76ob56d->InstanceId);
     $_i7q5a2gk0hwro110cvuhu = CaptchaConfiguration::GetSettings()->HandlerUrl;
     $_0rtj5zrmv3d1s3raid0gr246gv = parse_url($_i7q5a2gk0hwro110cvuhu, PHP_URL_QUERY) == NULL ? "?" : "&";
     return htmlentities("{$_i7q5a2gk0hwro110cvuhu}{$_0rtj5zrmv3d1s3raid0gr246gv}{$_1zgfy2orc7hskgem}");
 }
 public static function SoundUrl($_1jmixitt2akrbvczkx7lf)
 {
     $_Imm2y77x02e6bcadpx46l = LBD_CaptchaHttpCommand::GetQuerystring(1, $_1jmixitt2akrbvczkx7lf->CaptchaId, $_1jmixitt2akrbvczkx7lf->InstanceId);
     $_ix06ez45uwnw4vsl = CaptchaConfiguration::GetSettings()->HandlerUrl;
     $_izi6jkaty5faekbc = parse_url($_ix06ez45uwnw4vsl, PHP_URL_QUERY) == NULL ? "?" : "&";
     return htmlentities("{$_ix06ez45uwnw4vsl}{$_izi6jkaty5faekbc}{$_Imm2y77x02e6bcadpx46l}");
 }
 public static function SoundUrl($_imt2rdwz4l9diaoiflqz6li961)
 {
     $_lt2ocol31c96gwfpas9wasqdot = LBD_CaptchaHttpCommand::GetQuerystring(1, $_imt2rdwz4l9diaoiflqz6li961->CaptchaId, $_imt2rdwz4l9diaoiflqz6li961->InstanceId);
     $_17au79vfxj45vpetpf0wm = CaptchaConfiguration::GetSettings()->HandlerUrl;
     $_l2lj1wn57ugzp4wq = parse_url($_17au79vfxj45vpetpf0wm, PHP_URL_QUERY) == NULL ? "?" : "&";
     return htmlentities("{$_17au79vfxj45vpetpf0wm}{$_l2lj1wn57ugzp4wq}{$_lt2ocol31c96gwfpas9wasqdot}");
 }
示例#7
0
 public static function SoundUrl($_Itz8vfx7gegognntuljs4)
 {
     $_Ob0fzy3rkeg29o3cr868fvxrwq = LBD_CaptchaHttpCommand::GetQuerystring(1, $_Itz8vfx7gegognntuljs4->CaptchaId, $_Itz8vfx7gegognntuljs4->InstanceId);
     $_1spahoaj1y5z7kgh6bds1 = CaptchaConfiguration::GetSettings()->HandlerUrl;
     $_14dadq96zltrlbr7 = parse_url($_1spahoaj1y5z7kgh6bds1, PHP_URL_QUERY) == NULL ? "?" : "&";
     return htmlentities("{$_1spahoaj1y5z7kgh6bds1}{$_14dadq96zltrlbr7}{$_Ob0fzy3rkeg29o3cr868fvxrwq}");
 }