/**
  * Save user's captcha configuration options.
  *
  * @param array     $config
  * @return void
  */
 public static function save(array $config)
 {
     unset($config['CaptchaId']);
     unset($config['UserInputID']);
     if (empty($config)) {
         return;
     }
     $settings = \CaptchaConfiguration::LoadSettings();
     foreach ($config as $option => $value) {
         $settings->{$option} = $value;
     }
     \CaptchaConfiguration::SaveSettings($settings);
 }
예제 #2
0
function BDC_ApplyUserConfigOverride($CaptchaConfig, $CurrentCaptchaId)
{
    $BotDetect = clone $CaptchaConfig;
    $BDC_ConfigOverridePath = BDC_CONFIG_OVERRIDE_PATH . 'CaptchaConfig.php';
    if (is_file($BDC_ConfigOverridePath)) {
        include $BDC_ConfigOverridePath;
        CaptchaConfiguration::ProcessGlobalDeclarations($BotDetect);
        // 2nd pass correctly takes global declarations such as DisabledImageStyles into account
        // even if they're declared after affected values in the CaptchaConfig.php file
        // e.g. ImageStyle setting needs to be re-calculated according to DisabledImageStyles value
        include $BDC_ConfigOverridePath;
    }
    return $BotDetect;
}
예제 #3
0
 public function __construct($_0tthirxvwhnuox9goyj77wsfov)
 {
     $this->_lw7ebjlmi6q1drw4xpkdv = $_0tthirxvwhnuox9goyj77wsfov;
     $this->_Oq3w7fs1nex3zscid5ypn = "LBD_VCID_{$_0tthirxvwhnuox9goyj77wsfov}";
     $this->_l743z2bp4wwitzs6dudkaft5uy = "{$_0tthirxvwhnuox9goyj77wsfov}_CaptchaImage";
     $this->_08zj64b6y4sxb8y8 = new LBD_CaptchaBase($_0tthirxvwhnuox9goyj77wsfov);
     $this->_Opywuuujbkorzb71y6i472ne4x = $this->_08zj64b6y4sxb8y8->CaptchaId;
     $this->_0jsvqb1h48fu823n = CaptchaConfiguration::GetSettings();
     $this->_Ikdx6plfrd2vyfpmiqrov7ezqd = $this->_0jsvqb1h48fu823n->ImageTooltip;
     $this->_08tagf51qlrrg21x = $this->_0jsvqb1h48fu823n->ReloadEnabled;
     $this->_lppz38yxs2l3m8l5lkduj = $this->_0jsvqb1h48fu823n->ReloadTooltip;
     $this->_I65o2mc5k5clhx8ccfncr = $this->_0jsvqb1h48fu823n->ReloadIconUrl;
     $this->_iny1dx2pkst4gwuddtit3 = $this->_0jsvqb1h48fu823n->RemoteScriptEnabled;
     $this->Load();
 }
 public function __construct($_1d7alx9ngi5ihm2sjfc4e)
 {
     $this->_0fwk80huh6pb5qxomzdgl = $_1d7alx9ngi5ihm2sjfc4e;
     $this->_i96lh4wfvs9na67o = "LBD_VCID_{$_1d7alx9ngi5ihm2sjfc4e}";
     $this->_lw8n4p3ccghjfx1k6ddtgs2w4t = "{$_1d7alx9ngi5ihm2sjfc4e}_CaptchaImage";
     $this->_i42mw1gg47pybk5r = new LBD_CaptchaBase($_1d7alx9ngi5ihm2sjfc4e);
     $this->_1n5z7z9ryadongas9h3jtl8alk = $this->_i42mw1gg47pybk5r->CaptchaId;
     $this->_1j7tf7opltigfavc = CaptchaConfiguration::GetSettings();
     $this->_osz6h6mnnfp8temw = $this->_1j7tf7opltigfavc->ImageTooltip;
     $this->_1zes4p6m8csj3aiwdocf8lttrw = $this->_1j7tf7opltigfavc->SoundEnabled;
     $this->_1vm9wezufg0sbcm7 = $this->_1j7tf7opltigfavc->SoundTooltip;
     $this->_I31517ao64k3bsla = $this->_1j7tf7opltigfavc->SoundIconUrl;
     $this->_lb0iswwj4vy43afuz1tycv3z59 = $this->_1j7tf7opltigfavc->ReloadEnabled;
     $this->_iictbge6r8v26rp33dr15dwa30 = $this->_1j7tf7opltigfavc->ReloadTooltip;
     $this->_owo4l2yiljln2brr = $this->_1j7tf7opltigfavc->ReloadIconUrl;
     $this->_in0m653npz5o4uy5 = $this->_1j7tf7opltigfavc->HelpLinkEnabled;
     $this->_Iy3immtvit3fv70a = $this->_1j7tf7opltigfavc->HelpLinkMode;
     $this->_iqv7cj6muox1rl5b6mmw4cvpaq = $this->_1j7tf7opltigfavc->HelpLinkUrl;
     $this->_ihq20j9abxinjraiyqchoji5kr = $this->_1j7tf7opltigfavc->HelpLinkText;
     $this->_ihoyzvzlyw1zjbzu = $this->_1j7tf7opltigfavc->RemoteScriptEnabled;
     $this->Load();
 }
 public function __construct($_I9ia6stl6qqso9m3)
 {
     $this->_O6fg66odivg7gk06qemf5 = $_I9ia6stl6qqso9m3;
     $this->_Ilkgxy4y2643tjwl6scgm9jg9u = "LBD_VCID_{$_I9ia6stl6qqso9m3}";
     $this->_I2ry9fv02axe281rgywji = "{$_I9ia6stl6qqso9m3}_CaptchaImage";
     $this->_o27dysbzfa6rzk7u = new LBD_CaptchaBase($_I9ia6stl6qqso9m3);
     $this->_olsn4ldb6xnunpve = $this->_o27dysbzfa6rzk7u->CaptchaId;
     $this->_0meiahbavr02k249 = CaptchaConfiguration::GetSettings();
     $this->_oyud4drgjlqdlb9x6gze6 = $this->_0meiahbavr02k249->ImageTooltip;
     $this->_ok7vketkj85lv0k58oshek4gk7 = $this->_0meiahbavr02k249->SoundEnabled;
     $this->_0eqj8mvfkhzo0h7wlzvsf = $this->_0meiahbavr02k249->SoundTooltip;
     $this->_loka5fusd9g7hoa73t8fu = $this->_0meiahbavr02k249->SoundIconUrl;
     $this->_Itk50o5dwpsiybrgo29a6 = $this->_0meiahbavr02k249->ReloadEnabled;
     $this->_i1aamq1rfr2iv5bv3jvqsvie1q = $this->_0meiahbavr02k249->ReloadTooltip;
     $this->_064tri4qg5a4s0u5 = $this->_0meiahbavr02k249->ReloadIconUrl;
     $this->_1bxs3rjwtmml951qju3b3 = $this->_0meiahbavr02k249->HelpLinkEnabled;
     $this->_O6cm4g1wqbj90kzar3y09fkkqa = $this->_0meiahbavr02k249->HelpLinkMode;
     $this->_14d73pptscr3w8cie95sk = $this->_0meiahbavr02k249->HelpLinkUrl;
     $this->_Ik69ktb0emazyhlfs6vuqk5exp = $this->_0meiahbavr02k249->HelpLinkText;
     $this->_Ijnq79hiralot2bp41mcl1phuf = $this->_0meiahbavr02k249->RemoteScriptEnabled;
     $this->Load();
 }
<?php

$baseUrl = \LaravelCaptcha\Support\LaravelInformation::getBaseUrl();
$BotDetect = \CaptchaConfiguration::GetSettings();
$BotDetect->HandlerUrl = $baseUrl . '/captcha-handler';
// use Laravel session to store persist Captcha codes and other Captcha data
$BotDetect->SaveFunctionName = 'LA_Session_Save';
$BotDetect->LoadFunctionName = 'LA_Session_Load';
$BotDetect->ClearFunctionName = 'LA_Session_Clear';
\CaptchaConfiguration::SaveSettings($BotDetect);
// re-define custom session handler functions
function LA_Session_Save($key, $value)
{
    // save the given value with the given string key
    \Session::put($key, serialize($value));
}
function LA_Session_Load($key)
{
    // load persisted value for the given string key
    if (\Session::has($key)) {
        return unserialize(\Session::get($key));
        // NOTE: returns false in case of failure
    }
}
function LA_Session_Clear($key)
{
    // clear persisted value for the given string key
    if (\Session::has($key)) {
        \Session::remove($key);
    }
}
<?php

if (!class_exists('CaptchaConfiguration')) {
    return;
}
// BotDetect PHP Captcha configuration options
$LBD_CaptchaConfig = CaptchaConfiguration::GetSettings();
$LBD_CaptchaConfig->CodeLength = 4;
$LBD_CaptchaConfig->ImageWidth = 250;
$LBD_CaptchaConfig->ImageHeight = 50;
 public static function DisabledSmallSoundIconUrl()
 {
     $_1bth7f5xatnx9gagfc8q3 = CaptchaConfiguration::GetSettings()->SoundIconUrl;
     return str_replace("/lbd_sound_icon.gif", "/lbd_small_disabled_sound_icon.gif", $_1bth7f5xatnx9gagfc8q3);
 }
 public static function DisabledSmallSoundIconUrl()
 {
     $_i38pbglrwc4unvljubjw0 = CaptchaConfiguration::GetSettings()->SoundIconUrl;
     return str_replace("/lbd_sound_icon.gif", "/lbd_small_disabled_sound_icon.gif", $_i38pbglrwc4unvljubjw0);
 }
예제 #10
0
 public static function DisabledSmallSoundIconUrl()
 {
     $_lk1pyq1s0hf9d5p2lskjjc80rl = CaptchaConfiguration::GetSettings()->SoundIconUrl;
     return str_replace("/lbd_sound_icon.gif", "/lbd_small_disabled_sound_icon.gif", $_lk1pyq1s0hf9d5p2lskjjc80rl);
 }
예제 #11
0
 public static function DisabledSmallSoundIconUrl()
 {
     $_0v9bulyekc9sbnbs = CaptchaConfiguration::GetSettings()->SoundIconUrl;
     return str_replace("/lbd_sound_icon.gif", "/lbd_small_disabled_sound_icon.gif", $_0v9bulyekc9sbnbs);
 }
예제 #12
0
$LBD_CaptchaConfig->ReloadTooltip = 'Change the CAPTCHA code';
$LBD_CaptchaConfig->AutoReloadExpiredCaptchas = true;
$LBD_CaptchaConfig->AutoReloadTimeout = 7200;
// Captcha help link configuration
// ---------------------------------------------------------------------------
$LBD_CaptchaConfig->HelpLinkEnabled = true;
$LBD_CaptchaConfig->HelpLinkMode = HelpLinkMode::Text;
$LBD_CaptchaConfig->HelpLinkUrl = '';
$LBD_CaptchaConfig->HelpLinkText = '';
// Captcha user input configuration
// ---------------------------------------------------------------------------
$LBD_CaptchaConfig->AutoFocusInput = true;
$LBD_CaptchaConfig->AutoClearInput = true;
$LBD_CaptchaConfig->AutoUppercaseInput = true;
// Captcha remote script configuration
// ---------------------------------------------------------------------------
$LBD_CaptchaConfig->RemoteScriptEnabled = true;
// Captcha URL configuration
// ---------------------------------------------------------------------------
$LBD_CaptchaConfig->HandlerUrl = 'botdetect.php';
$LBD_CaptchaConfig->ReloadIconUrl = LBD_URL_ROOT . 'lbd_reload_icon.gif';
$LBD_CaptchaConfig->SoundIconUrl = LBD_URL_ROOT . 'lbd_sound_icon.gif';
$LBD_CaptchaConfig->LayoutStylesheetUrl = LBD_URL_ROOT . 'lbd_layout.css';
$LBD_CaptchaConfig->ScriptIncludeUrl = LBD_URL_ROOT . 'lbd_scripts.js';
// Captcha persistence configuration
// ---------------------------------------------------------------------------
$LBD_CaptchaConfig->SaveFunctionName = 'PHP_Session_Save';
$LBD_CaptchaConfig->LoadFunctionName = 'PHP_Session_Load';
$LBD_CaptchaConfig->ClearFunctionName = 'PHP_Session_Clear';
CaptchaConfiguration::SaveSettings($LBD_CaptchaConfig);