<?php use Captcha\Bundle\CaptchaBundle\Routing\Generator\UrlGenerator; $captchaUrlGenerator = UrlGenerator::getInstance(); // generate Absolute URLs $LBD_Resource_Url = $captchaUrlGenerator->generate('captcha_resource', array(), true) . '/'; $LBD_Handler_Url = $captchaUrlGenerator->generate('captcha_handler', array(), true); // config captcha resources $LBD_CaptchaConfig = \CaptchaConfiguration::GetSettings(); $LBD_CaptchaConfig->HandlerUrl = $LBD_Handler_Url; $LBD_CaptchaConfig->ReloadIconUrl = $LBD_Resource_Url . 'lbd_reload_icon.gif'; $LBD_CaptchaConfig->SoundIconUrl = $LBD_Resource_Url . 'lbd_sound_icon.gif'; $LBD_CaptchaConfig->LayoutStylesheetUrl = $LBD_Resource_Url . 'lbd_layout.css'; $LBD_CaptchaConfig->ScriptIncludeUrl = $LBD_Resource_Url . 'lbd_scripts.js'; // use Symfony sessions to store persist Captcha codes and other Captcha data $LBD_CaptchaConfig->SaveFunctionName = 'SF_Session_Save'; $LBD_CaptchaConfig->LoadFunctionName = 'SF_Session_Load'; $LBD_CaptchaConfig->ClearFunctionName = 'SF_Session_Clear'; // re-define custom session handler functions global $session; $session = $includeData; function SF_Session_Save($key, $value) { global $session; // save the given value with the given string key $session->set($key, serialize($value)); } function SF_Session_Load($key) { global $session; // load persisted value for the given string key
<?php // include BotDetect PHP CAPTCHA Library v4.0.0 // Copyright © Captcha, Inc. (formerly Lanapsoft, Inc.) 2004-2016. All rights reserved. // BotDetect, BotDetect CAPTCHA, Lanap, Lanap CAPTCHA, Lanap BotDetect, Lanap BotDetect CAPTCHA, Lanapsoft, Lanapsoft CAPTCHA, Lanapsoft BotDetect, Lanapsoft BotDetect CAPTCHA, and Lanap Software are trademarks or registered trademarks of Captcha, Inc. // PHP 5.2.x compatibility workaround if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); } // 1. define BotDetect paths // physical path to Captcha library files (the BotDetect folder) $BDC_Include_Path = __DIR__ . '/../../captcha/lib/botdetect/'; // BotDetect Url prefix (base Url of the BotDetect public resources) $captchaUrlGenerator = \Captcha\Bundle\CaptchaBundle\Routing\Generator\UrlGenerator::getInstance(); $BDC_Url_Root = $captchaUrlGenerator->generate('captcha_resource', array(), true); // physical path to the folder with the (optional!) config override file $BDC_Config_Override_Path = __DIR__; // normalize paths if (is_file(__DIR__ . '/botdetect/CaptchaIncludes.php')) { // in case a local copy of the library exists, it is always used $BDC_Include_Path = __DIR__ . '/botdetect/'; $BDC_Url_Root = 'botdetect/public/'; } else { // clean-up path specifications $BDC_Include_Path = BDC_NormalizePath($BDC_Include_Path); $BDC_Url_Root = BDC_NormalizePath($BDC_Url_Root); $BDC_Config_Override_Path = BDC_NormalizePath($BDC_Config_Override_Path); } define('BDC_INCLUDE_PATH', $BDC_Include_Path); define('BDC_URL_ROOT', $BDC_Url_Root); define('BDC_CONFIG_OVERRIDE_PATH', $BDC_Config_Override_Path);