/** * Shows the image */ public function show() { if (is_file($this->_kcaptchaFilename)) { include_once $this->_kcaptchaFilename; $this->_instanceCaptcha = new KCAPTCHA(); rad_session::setVar($this->_sessionName, $this->_instanceCaptcha->getKeyString()); } else { throw new rad_exception('KCaptcha library not found!'); } }
/** * Вывод каптчи: */ public function indexAction(Application $application, Template $template) { $kvs = KVS::getInstance(); /* if ($kvs -> exists(__CLASS__, 'captcha_ban', $_SERVER['REMOTE_ADDR'])) return false; $kvs -> set(__CLASS__, 'captcha', $_SERVER['REMOTE_ADDR'], $kvs -> get(__CLASS__, 'captcha', $_SERVER['REMOTE_ADDR']) + 1); $kvs -> expire(__CLASS__, 'captcha', $_SERVER['REMOTE_ADDR'], 5); if ($kvs -> get(__CLASS__, 'captcha', $_SERVER['REMOTE_ADDR']) > 10) { $kvs -> set(__CLASS__, 'captcha_ban', $_SERVER['REMOTE_ADDR'], true); $kvs -> expire(__CLASS__, 'captcha_ban', $_SERVER['REMOTE_ADDR'], 60 * 15); return false; } */ if (!isset($_GET['key'])) { return false; } /* if (!preg_match('~^http://1chan\.ru/~i', $_SERVER['HTTP_REFERER'])) return false; */ $session = Session::getInstance(); if ($session->instantGet('captcha_' . $_GET['key'], false)) { $captcha = new KCAPTCHA(); $session->instantSet('captcha_' . $_GET['key'], $captcha->getKeyString()); } return false; }
function render() { App::import('vendor', 'kcaptcha/kcaptcha'); //vendor('kcaptcha/kcaptcha'); $kcaptcha = new KCAPTCHA(); $this->controller->Session->write('captcha', $kcaptcha->getKeyString()); }
function make_captcha($id) { require 'kcaptcha/kcaptcha.php'; $captcha = new KCAPTCHA(); cache_set('taxi_captcha_' . $id, $captcha->getKeyString()); die; }
public static function render() { include_once dirname(__FILE__) . '/../libs/kcaptcha/kcaptcha.php'; $captcha = new KCAPTCHA(); Session::instance()->set('CAPTHCA_KEYSTRING', $captcha->getKeyString()); exit(0); }
/** * Render captcha */ public function render() { Env::$response->headers->set('Content-Type', 'image/jpeg'); Env::$response->sendHeaders(); $captcha = new \KCAPTCHA(); $_SESSION['captcha_key'] = strtolower($captcha->getKeyString()); exit; }
/** * This function let us to generate a new captcha image. The image code is * saved in a session var. */ function render($generateImage = true) { $captchaCode = ""; App::import('Vendor', 'kcaptcha/kcaptcha'); $kcaptcha = new KCAPTCHA($generateImage); $captchaCode = $kcaptcha->getKeyString(); return $captchaCode; }
public function actionIndex() { require_once M_FRAME_PATH . '/extensions/captcha/kcaptcha.php'; $captcha = new KCAPTCHA(); if ($_REQUEST[session_name()]) { $_SESSION['captcha_keystring'] = $captcha->getKeyString(); } }
function render() { if (!App::import('Vendor', 'Kcaptcha' . DS . 'Kcaptcha')) { App::import('Vendor', 'Kcaptcha.Kcaptcha' . DS . 'Kcaptcha'); } $kcaptcha = new KCAPTCHA(); $this->Session->write($this->sessionKey, $kcaptcha->getKeyString()); }
protected function EventLibCaptcha() { if (!class_exists('KCAPTCHA', false)) { F::IncludeLib('kcaptcha/kcaptcha.php'); } $captcha = new KCAPTCHA(); $_SESSION['captcha_keystring'] = $captcha->getKeyString(); exit; }
public function getKcaptchaImage() { error_reporting(E_ALL); session_start(); $captcha = new KCAPTCHA(); if ($_REQUEST[session_name()]) { $_SESSION['captcha_keystring'] = $captcha->getKeyString(); } }
/** * キャプチャ画象を表示する * * @return void */ public function render($token = null) { $kcaptcha = new KCAPTCHA(); $key = 'captcha'; if (!$token) { $token = '0'; } $key .= '.' . $token; $this->controller->Session->write($key, $kcaptcha->getKeyString()); }
public function action_captcha() { require 'libraries/kapcha/kcaptcha.php'; if (isset($_REQUEST[session_name()])) { session_start(); } $captcha = new KCAPTCHA(); if ($_REQUEST[session_name()]) { $_SESSION['captcha_keystring'] = $captcha->getKeyString(); } }
function image() { // small hack to allow captcha display even if any notice or warning occurred $obLength = ob_get_length(); if ($obLength !== false || $obLength > 0) { while (@ob_end_clean()) { } if (function_exists('ob_clean')) { @ob_clean(); } } @session_start(); if (!class_exists('KCAPTCHA')) { require_once JCOMMENTS_LIBRARIES . DS . 'kcaptcha' . DS . 'kcaptcha.php'; } $captcha = new KCAPTCHA(); $_SESSION['comments-captcha-code'] = $captcha->getKeyString(); exit; }
public function generateImage($config = null) { $captcha = new \KCAPTCHA(); Session::set(self::KEYSTRING_KEY, $captcha->getKeyString()); die; }
/****************************************************************************** * * Subrion - open source content management system * Copyright (C) 2016 Intelliants, LLC <http://www.intelliants.com> * * This file is part of Subrion. * * Subrion is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Subrion is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Subrion. If not, see <http://www.gnu.org/licenses/>. * * * @link http://www.subrion.org/ * ******************************************************************************/ require_once IA_PLUGINS . 'kcaptcha' . IA_DS . 'includes' . IA_DS . 'kcaptcha' . IA_DS . 'captcha.php'; $captcha = new KCAPTCHA(); $captcha->length = $iaCore->get('captcha_num_chars'); $captcha->getImage(); $_SESSION['pass'] = $captcha->getKeyString();
<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/admin/lib/tools/kcaptcha/kcaptcha.php'; session_start(); $captcha = new KCAPTCHA(); $_SESSION['c_sec_code'] = md5($captcha->getKeyString() . 'FWK');
/** * Генерация проверочного кода * */ function captcha() { include 'modules/kcaptcha/kcaptcha.php'; $captcha = new KCAPTCHA(); session_start(); $_SESSION['captcha_keystring'] = $captcha->getKeyString(); session_write_close(); exit; }
<?php /******************************************************************************/ // // // InstantCMS v1.10.5 // // http://www.instantcms.ru/ // // // // written by InstantCMS Team, 2007-2014 // // produced by InstantSoft, (www.instantsoft.ru) // // // // LICENSED BY GNU/GPL v2 // // // /******************************************************************************/ session_start(); include('kcaptcha.php'); $captcha = new KCAPTCHA(); $captcha_id = filter_input('INPUT_GET', 'captcha_id', FILTER_VALIDATE_INT); $_SESSION['captcha'][$captcha_id] = $captcha->getKeyString();
imagejpeg($img2, null, $jpeg_quality); $ext = 'jpg'; } else { if (function_exists("imagegif")) { header("Content-Type: image/gif"); imagegif($img2); $ext = 'gif'; } else { if (function_exists("imagepng")) { header("Content-Type: image/x-png"); imagepng($img2); $ext = 'png'; } } } header('Content-Disposition: inline; filename=' . rand(10, 9999) . '.' . $ext); header('Content-Length: ' . ob_get_length()); ob_end_flush(); } // returns keystring function getKeyString() { return $this->keystring; } } // Обрабатываем запрос на картинку CAPTCHA session_name('SESID'); session_start(); $captcha = new KCAPTCHA(); $_SESSION['code'] = $captcha->getKeyString();
# random 5 or 6 //$length = 6; # CAPTCHA image size (you do not need to change it, whis parameters is optimal) $captcha_conf['width'] = 122; $captcha_conf['height'] = 62; # symbol's vertical fluctuation amplitude divided by 2 $captcha_conf['fluctuation_amplitude'] = 6; # increase safety by prevention of spaces between symbols $captcha_conf['no_spaces'] = false; # show credits $captcha_conf['show_credits'] = false; # set to false to remove credits line. Credits adds 12 pixels to image height $captcha_conf['credits'] = ' '; # if empty, HTTP_HOST will be shown # CAPTCHA image colors (RGB, 0-255) //$foreground_color = array(0, 0, 0); //$background_color = array(220, 230, 255); $captcha_conf['foreground_color'] = array(mt_rand(0, 100), mt_rand(0, 100), mt_rand(0, 100)); $captcha_conf['background_color'] = array(mt_rand(200, 255), mt_rand(200, 255), mt_rand(200, 255)); # JPEG quality of CAPTCHA image (bigger is better quality, but larger file size) $captcha_conf['jpeg_quality'] = 80; ########## End of CAPTCHA configuration // Print headers to disable image caching header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); $captcha = new KCAPTCHA($captcha_conf); $_SESSION['amember_captcha'] = $captcha->getKeyString();
function render() { App::import('Vendor', 'Contact.Kcaptcha.Kcaptcha'); $kcaptcha = new KCAPTCHA(); $this->controller->Session->write('captcha', $kcaptcha->getKeyString()); }
<?php include_once "_common.php"; //error_reporting (E_ALL); include 'kcaptcha.php'; //session_start(); $captcha = new KCAPTCHA(); $captcha->setKeyString(get_session("captcha_keystring")); $captcha->getKeyString(); $captcha->image();
/** * Отображение каптчи */ protected function EventCaptcha() { $this->Viewer_SetResponseAjax(null); /** * Подключаем каптчу */ require_once Config::Get('path.framework.libs_vendor.server') . '/kcaptcha/kcaptcha.php'; /** * Определяем уникальное название (возможность нескольких каптч на одной странице) */ $sName = ''; if (isset($_GET['name']) and is_string($_GET['name']) and $_GET['name']) { $sName = $_GET['name']; } /** * Генерируем каптчу и сохраняем код в сессию */ $oCaptcha = new KCAPTCHA(); $this->Session_Set('captcha_keystring' . ($sName ? '_' . $sName : ''), $oCaptcha->getKeyString()); $this->SetTemplate(false); }
<?php include 'kcaptcha.php'; $name = !empty($_GET['name']) ? trim($_GET['name']) : 'captcha_keystring'; session_start(); $captcha = new KCAPTCHA(); $_SESSION[$name] = $captcha->getKeyString(); /** * SESSION may be work incorrect */ $tmp_files = glob('../../logs/captcha_keystring_*.dat'); foreach ($tmp_files as $tmp_file) { if (!preg_match('#' . date("Y-m-d") . '\\.dat$#', $tmp_file)) { @unlink($tmp_file); } } @($f = fopen('../../logs/captcha_keystring_' . session_id() . '-' . date("Y-m-d") . '.dat', 'w')); @fwrite($f, $captcha->getKeyString()); @fclose($f);
// Create an image from button.png $image = imagecreatefrompng('captcha/button.png'); // Set the font colour $colour = imagecolorallocate($image, 183, 178, 152); // Set the font $font = 'captcha/Anorexia.ttf'; // Set a random integer for the rotation between -15 and 15 degrees // Create an image using our original image and adding the detail //imagettftext($image, 14, $rotate, 18, 30, $colour, $font, $str); if (function_exists('imagettftext')){ $rotate = rand(-15, 15); imagettftext($image, 14, $rotate, 18, 30, $colour, $font, $str); }else { $rotateX = rand(1, 78); $rotateY = rand(1, 28); ImageString($image, 15, $rotateX, $rotateY, $str, $colour); } // Output the image as a png imagepng($image); exit; */ include 'kcaptcha/kcaptcha.php'; $captcha = new KCAPTCHA(); $_SESSION['Var_session'] = $captcha->getKeyString();
<?php session_start(); require_once 'kcaptcha.php'; $captcha = new KCAPTCHA(); $_SESSION['captcha_keystring'] = $captcha->getKeyString();
<?php #---------------------------------------------# # ********* RotorCMS ********* # # Author : Vantuz # # Email : visavi.net@mail.ru # # Site : http://visavi.net # # ICQ : 36-44-66 # # Skype : vantuzilla # #---------------------------------------------# require_once '../includes/start.php'; require_once '../includes/functions.php'; $captcha = new KCAPTCHA(); $_SESSION['protect'] = $captcha->getKeyString();
<?php //error_reporting (E_ALL); error_reporting(E_ERROR); include 'kcaptcha.php'; if (isset($_REQUEST[session_name()])) { session_start(); } $id = (int) $_REQUEST['id']; $id2 = (int) $_REQUEST['id2']; $captcha = new KCAPTCHA(); if ($_REQUEST[session_name()]) { $_SESSION['captcha_keystring' . $id . '_' . $id2] = $captcha->getKeyString(); }
/** * Метод для обновления captcha */ public function captcha() { $kcaptcha = JPATH_COMPONENT . DS . 'libraries' . DS . 'kcaptcha' . DS . 'kcaptcha.php'; if (is_file($kcaptcha)) { if (!class_exists('KCAPTCHA')) { require_once $kcaptcha; } $captcha = new KCAPTCHA(); $_SESSION['captcha-code'] = $captcha->getKeyString(); } exit; }