function crackcha_next(WC_Challenge $chall) { if (crackcha_round_over()) { header('Content-Type: text/plain'); if (false === crackcha_insert_high($chall)) { echo GWF_HTML::lang('ERR_DATABASE', array(__FILE__, __LINE__)); return; } else { echo $chall->lang('msg_insert_high') . PHP_EOL; echo crackcha_reset($chall); return; } } require_once GWF_CORE_PATH . 'inc/3p/Class_Captcha.php'; $chars = GWF_Random::randomKey(5, GWF_Random::ALPHAUP); crackcha_increase_count(); GWF_Session::set('WCC_CRACKCHA_CHARS', $chars); $aFonts = array(GWF_PATH . 'extra/font/teen.ttf'); $rgbcolor = GWF_CAPTCHA_COLOR_BG; $oVisualCaptcha = new PhpCaptcha($aFonts, 210, 42, $rgbcolor); $oVisualCaptcha->Create('', $chars); }
<?php header('Content-Type: text/plain'); chdir('../../'); define('GWF_PAGE_TITLE', 'Crackcha'); require_once 'challenge/gwf_include.php'; GWF_Website::init(getcwd()); $wechall = GWF_Module::loadModuleDB('WeChall', true, true); require_once 'challenge/crackcha/crackcha.php'; if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) { $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 8, 'challenge/crackcha/index.php', false); } echo crackcha_reset($chall); //GWF_Session::commit();