Beispiel #1
0
 public function showCaptcha()
 {
     include JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'securimage' . DIRECTORY_SEPARATOR . 'securimage.php';
     $img = new securimage();
     $mod_jinc = JRequest::getString('mod_jinc', 'false');
     $mod_jinc = trim($mod_jinc);
     if ($mod_jinc == 'true') {
         $img->image_width = 125;
         $img->image_height = 30;
         $img->code_length = rand(4, 4);
         $img->setSessionPrefix('mod_jinc');
     } else {
         $img->image_width = 250;
         $img->image_height = 40;
         $img->code_length = rand(5, 6);
     }
     $img->perturbation = 0.7;
     $img->image_bg_color = new Securimage_Color("#ffffff");
     $img->use_transparent_text = true;
     $img->text_transparency_percentage = 45;
     // 100 = completely transparent
     $img->num_lines = 2;
     $img->image_signature = '';
     $img->text_color = new Securimage_Color("#333366");
     $img->line_color = new Securimage_Color("#FFFFCC");
     $img->show('');
     // alternate use:  $img->show('/path/to/background_image.jpg');
 }
Beispiel #2
0
 function security_captcha()
 {
     @ob_clean();
     include 'captcha/securimage.php';
     $img = new securimage();
     $img->image_type = SI_IMAGE_PNG;
     $img->text_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
     $img->num_lines = 5;
     $img->line_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
     $img->text_transparency_percentage = 30;
     $img->perturbation = 0.3;
     //Change some settings
     /*
     $img->image_width = 275;
     $img->image_height = 90;
     $img->perturbation = 0.9; // 1.0 = high distortion, higher numbers = more distortion
     $img->image_bg_color = new Securimage_Color(0x0, 0x99, 0xcc);
     $img->text_color = new Securimage_Color(0xea, 0xea, 0xea);
     $img->text_transparency_percentage = 65; // 100 = completely transparent
     $img->num_lines = 8;
     $img->line_color = new Securimage_Color(0x0, 0xa0, 0xcc);
     $img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
     */
     $img->show('');
     // alternate use:  $img->show('/path/to/background_image.jpg');
 }
Beispiel #3
0
 public function IsCorrect($captchaValue)
 {
     require_once ROOT_DIR . 'lib/external/securimage/securimage.php';
     $img = new securimage();
     $isValid = $img->check($captchaValue);
     Log::Debug('Checking captcha value. Value entered: %s. IsValid: %s', $captchaValue, $isValid);
     return $isValid;
 }
 public function action()
 {
     /** 防止跨站 */
     $referer = $this->request->getReferer();
     if (empty($referer)) {
         exit;
     }
     $refererPart = parse_url($referer);
     $currentPart = parse_url(Helper::options()->siteUrl);
     if ($refererPart['host'] != $currentPart['host'] || 0 !== strpos($refererPart['path'], $currentPart['path'])) {
         exit;
     }
     require_once 'Captcha/securimage/securimage.php';
     $img = new securimage();
     $dir = dirname(__FILE__) . '/securimage/';
     $options = Typecho_Widget::widget('Widget_Options');
     $fontsArray = array('04b03.ttf', 'AHGBold.ttf', 'atkinsoutlinemedium-regular.ttf', 'decorative-stylisticblackout-regular.ttf', 'okrienhmk.ttf', 'ttstepha.ttf', 'vtckomixationhand.ttf');
     $fontsKey = array_rand($fontsArray);
     $fontsFile = $dir . 'fonts/' . $fontsArray[$fontsKey];
     //验证码字体
     $fontsFile = $dir . 'fonts/' . $options->plugin('Captcha')->ttf_file;
     $img->ttf_file = $fontsFile;
     //验证码背景
     if ($options->plugin('Captcha')->is_background) {
         $img->background_directory = $dir . '/backgrounds/';
     }
     //背景颜色
     $img->image_bg_color = new Securimage_Color($options->plugin('Captcha')->image_bg_color);
     //验证码颜色
     $img->text_color = new Securimage_Color($options->plugin('Captcha')->text_color);
     //自定义验证码
     $img->use_wordlist = $options->plugin('Captcha')->use_wordlist;
     $img->wordlist = explode("\n", $options->plugin('Captcha')->wordlist);
     $img->wordlist_file = $dir . 'words/words.txt';
     //干扰线颜色
     $img->line_color = new Securimage_Color($options->plugin('Captcha')->line_color);
     //干扰线、扭曲度
     $img->num_lines = $options->plugin('Captcha')->num_lines;
     $img->perturbation = $options->plugin('Captcha')->perturbation;
     //签名内容、颜色、字体
     $img->signature_color = new Securimage_Color($options->plugin('Captcha')->signature_color);
     $img->image_signature = $options->plugin('Captcha')->image_signature;
     $img->signature_font = $dir . 'fonts/' . $options->plugin('Captcha')->signature_font;
     //高度宽度
     $img->image_height = $options->plugin('Captcha')->image_height;
     $img->image_width = $options->plugin('Captcha')->image_width;
     $img->show('');
 }
Beispiel #5
0
 public function index($params)
 {
     $img = new securimage();
     //Change some settings
     $img->image_width = !empty($_GET['width']) ? (int) $_GET['width'] : self::CAPTCHA_WIDTH;
     $img->image_height = !empty($_GET['height']) ? (int) $_GET['height'] : self::CAPTCHA_HEIGHT;
     $img->perturbation = 0.45;
     $img->image_bg_color = new Securimage_Color(0xf6, 0xf6, 0xf6);
     $img->text_angle_minimum = -5;
     $img->text_angle_maximum = 5;
     $img->use_transparent_text = true;
     $img->text_transparency_percentage = 30;
     // 100 = completely transparent
     $img->num_lines = 7;
     $img->line_color = new Securimage_Color("#7B92AA");
     $img->signature_color = new Securimage_Color("#7B92AA");
     $img->text_color = new Securimage_Color("#7B92AA");
     $img->use_wordlist = true;
     $img->show();
     exit;
 }
Beispiel #6
0
function captcha($width = 280, $height = 100, $word = false)
{
    $img = new securimage();
    //Change some settings
    $img->image_width = $width;
    $img->image_height = $height;
    $img->perturbation = 0.9;
    $img->code_length = rand(5, 6);
    $img->image_bg_color = new Securimage_Color("#000000");
    $img->use_transparent_text = true;
    $img->text_transparency_percentage = 25;
    // 100 = completely transparent
    $img->num_lines = 15;
    $img->wordlist_file = $_SERVER["DOCUMENT_ROOT"] . __racineadminlib__ . "/securimage/words/words.txt";
    $img->gd_font_file = $_SERVER["DOCUMENT_ROOT"] . __racineadminlib__ . "/securimage/gdfonts/automatic.gdf";
    $img->ttf_file = $_SERVER["DOCUMENT_ROOT"] . __racineadminlib__ . "/securimage/AHGBold.ttf";
    $img->use_wordlist = $word;
    $img->image_signature = '';
    $img->text_color = new Securimage_Color("#FFFFFF");
    $img->line_color = new Securimage_Color("#FFFFFF");
    $img->show('');
    // alternate use:  $img->show('/path/to/background_image.jpg');
}
        $captcha_type = Securimage::SI_CAPTCHA_STRING;
        $code_length = 5;
        break;
    case 6:
        $bg = 'backgrounds/yxm_bg_120-3.gif';
        $ttf_file = 'AHGBold.ttf';
        $captcha_type = Securimage::SI_CAPTCHA_MATHEMATIC;
        break;
    default:
        $bg = 'backgrounds/yxm_bg_120-1.gif';
        $captcha_type = Securimage::SI_CAPTCHA_STRING;
        $ttf_file = 'AHGBold.ttf';
        $code_length = 5;
        break;
}
$img = new securimage();
$img->switch_type = $switch_type;
$img->ttf_file = $ttf_file;
$img->captcha_type = $captcha_type;
// show a simple math problem instead of text
$img->image_height = 120;
// width in pixels of the image
$img->image_width = 300;
// a good formula for image size
$img->code_length = $code_length;
$img->perturbation = 0.2;
// 1.0 = high distortion, higher numbers = more distortion
$img->num_lines = 0;
$img->text_color = new Securimage_Color("#000");
// captcha text color
$img->show($bg);
Beispiel #8
0
/********************************************************
	JobExpert v1.0
	powered by Script Developers Group (SD-Group)
	email: info@sd-group.org.ua
	url: http://sd-group.org.ua/
	Copyright 2010-2015 (c) SD-Group
	All rights reserved
=========================================================
	Настройки капчи
********************************************************/
/**
 * @package
 * @todo
 */
include_once 'securimage.php';
$securimage = new securimage();
// Change some settings
$securimage->image_width = 80;
$securimage->image_height = 40;
$securimage->perturbation = 0.0;
// 1.0 = high distortion, higher numbers = more distortion
//$securimage -> image_bg_color = new Securimage_Color("#FFFFFF");//new Securimage_Color(rand(0, 128), rand(0, 128), rand(0, 128));
$securimage->text_color = new Securimage_Color(rand(0, 64), rand(0, 128), rand(0, 128));
//new Securimage_Color("#FF0000");
//$securimage -> text_transparency_percentage = 65; // 100 = completely transparent
$securimage->num_lines = 0;
//$securimage -> image_type = SI_IMAGE_PNG;
$securimage->code_length = 5;
$securimage->charset = '2345689';
//'2345689ABCDEFYZ';//'ABCDEFGHKLMNPRSTUVWYZabcdefghklmnprstuvwyz23456789';
$securimage->expiry_time = 3600;
<?php

include 'securimage.php';
$img = new securimage();
//$img->show();
$img->show('./background.gif');
<?php

include 'securimage.php';
$session_id = isset($_GET['session_id']) ? $_GET['session_id'] : false;
$width = isset($_GET['width']) && (int) $_GET['width'] != 0 ? $_GET['width'] : null;
$height = isset($_GET['height']) && (int) $_GET['height'] != 0 ? $_GET['height'] : null;
$length = isset($_GET['length']) && (int) $_GET['length'] != 0 ? $_GET['length'] : null;
$img = new securimage($session_id);
$img->show($width, $height, $length);
// alternate use:  $img->show('/path/to/background.jpg');
Beispiel #11
0
        } else {
            echo ajax::sdgJSONencode(array('error' => MESSAGE_COMMENTS_NOT_DELETE));
        }
    } else {
        echo ajax::sdgJSONencode(array('error' => MESSAGE_COMMENTS_NOT_DELETE));
    }
} elseif (isset($_POST['addCommentA']) && !empty($_POST['articleId'])) {
    if (!empty($_POST['addCommentA'])) {
        $articles = new articles();
        $aComments = new articlesComments();
        $_POST['addCommentA'] = strings::htmlEncode($_POST['addCommentA']);
        // проверяем наличие новости
        if (!$articles->getPublishedArticle("id=" . secure::escQuoteData($_POST['articleId']))) {
            echo ajax::sdgJSONencode(array('error' => ERROR_COMMENT_ARTICLE_NOT_FOUND));
        } else {
            $securimage = new securimage();
            // если добавление комментариев доступно только для зарегистрированных пользователей
            // и пользователь не авторизован, выдаем ошибку
            if (CONF_ARTICLES_COMMENTS_REGISTER && empty($_SESSION['sd_user']['data']['id'])) {
                echo ajax::sdgJSONencode(array('error' => MESSAGE_COMMENTS_REGISTER));
            } else {
                // проверяем капчу, если она включена
                if (SECURE_CAPTCHA) {
                    if (empty($_POST['keystring']) || !$securimage->check($_POST['keystring'])) {
                        die(ajax::sdgJSONencode(array('error' => ERROR_CAPTCHA)));
                    }
                }
                // массив сервисных полей
                $sFields = array('id_article' => $_POST['articleId'], 'id_user' => !empty($_SESSION['sd_user']['data']['id']) ? $_SESSION['sd_user']['data']['id'] : 0);
                !empty($_POST['userName']) ? $_POST['userName'] = htmlspecialchars(htmlentities(trim($_POST['userName']), ENT_QUOTES, CONF_DEFAULT_CHARSET), ENT_QUOTES, CONF_DEFAULT_CHARSET) : null;
                $user = new user();
 * If you found this script useful, please take a quick moment to rate it.<br />
 * http://www.hotscripts.com/rate/49400.html  Thanks.
 *
 * @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
 * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
 * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
 * @copyright 2009 Drew Phillips
 * @author drew010 <*****@*****.**>
 * @version 2.0.1 BETA (December 6th, 2009)
 * @package Securimage
 *
 */
include 'securimage.php';
require_once dirname(__FILE__) . '/../../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../../init.php';
$img = new securimage();
// Change some settings
$img->image_width = (int) Configuration::get('ASK_SECURIMAGE_WIDTH');
$img->image_height = (int) Configuration::get('ASK_SECURIMAGE_HEIGHT');
$img->perturbation = Configuration::get('ASK_PERTURBATION');
// 1.0 = high distortion, higher numbers = more distortion
if ((int) Configuration::get('ASK_BACK_COLOR_RAND')) {
    $img->image_bg_color = new Securimage_Color(rand(0, 255), rand(0, 255), rand(0, 255));
} else {
    $img->image_bg_color = new Securimage_Color('#' . Configuration::get('ASK_BACKGROUND_COL'));
}
if ((int) Configuration::get('ASK_TEXT_COLOR_RAND')) {
    $img->text_color = new Securimage_Color(rand(0, 255), rand(0, 255), rand(0, 255));
} else {
    $img->text_color = new Securimage_Color('#' . Configuration::get('ASK_TEXT_COL'));
}
Beispiel #13
0
 /**
  * 评论过滤器
  * 
  * @access public
  * @param array $comment 评论结构
  * @param Typecho_Widget $post 被评论的文章
  * @param array $result 返回的结果上下文
  * @param string $api api地址
  * @return void
  */
 public static function filter($comment, $post, $result)
 {
     $captchaCode = Typecho_Request::getInstance()->captcha_code;
     if (empty($captchaCode)) {
         throw new Typecho_Widget_Exception(_t('请输入验证码'));
     }
     require_once 'Captcha/securimage/securimage.php';
     $img = new securimage();
     if (!$img->check($captchaCode)) {
         throw new Typecho_Widget_Exception(_t('验证码错误, 请重新输入'));
     }
     return $comment;
 }
Beispiel #14
0
 function securimage_ex()
 {
     parent::securimage();
     // get the control's name from querystring
     $this->captcha_num = intval($_GET['c']);
 }
Beispiel #15
0
 function _show_captcha()
 {
     $img = new securimage();
     $img->show();
 }
 * to inform users that the changes are not a part of the original software.<br /><br />
 *
 * If you found this script useful, please take a quick moment to rate it.<br />
 * http://www.hotscripts.com/rate/49400.html  Thanks.
 *
 * @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
 * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
 * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
 *
 * @copyright 2009 Drew Phillips
 * @author Drew Phillips <*****@*****.**>
 *
 * @version 2.0.1 BETA (December 6th, 2009)
 */
include 'securimage.php';
$img = new securimage();
//Change some settings
$img->image_width = 250;
$img->image_height = 80;
$img->perturbation = 0.85;
$img->image_bg_color = new Securimage_Color('#f6f6f6');
$img->multi_text_color = array(new Securimage_Color('#3399ff'), new Securimage_Color('#3300cc'), new Securimage_Color('#3333cc'), new Securimage_Color('#6666ff'), new Securimage_Color('#99cccc'));
$img->use_multi_text = true;
$img->text_angle_minimum = -5;
$img->text_angle_maximum = 5;
$img->use_transparent_text = true;
$img->text_transparency_percentage = 30;
// 100 = completely transparent
$img->num_lines = 7;
$img->line_color = new Securimage_Color('#eaeaea');
$img->image_signature = 'phpcaptcha.org';
if (file_exists(dirname(__FILE__) . '/../../../../defines.php')) {
    include_once dirname(__FILE__) . '/../../../../defines.php';
}
if (!defined('_JDEFINES')) {
    define('JPATH_BASE', dirname(__FILE__) . '/../../../../');
    require_once JPATH_BASE . '/includes/defines.php';
}
require_once JPATH_BASE . '/includes/framework.php';
/* To use Joomla's Database Class */
require_once JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'factory.php';
// Instantiate the application.
$app = JFactory::getApplication('site');
ob_end_clean();
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
include JPATH_SITE . DS . 'components' . DS . 'com_breezingforms' . DS . 'images' . DS . 'captcha' . DS . 'securimage.php';
$img = new securimage();
//Change some settings
$img->image_width = 230;
$img->image_height = 80;
$img->perturbation = 0.9;
$img->image_bg_color = new Securimage_Color("#6495ED");
$img->text_color = new Securimage_Color("#B0E0E6");
$img->line_color = new Securimage_Color("#B0E0E6");
$img->noise_color = new Securimage_Color("#B0E0E6");
$img->use_transparent_text = false;
$img->text_transparency_percentage = 60;
// 100 = completely transparent
$img->num_lines = 15;
$img->image_signature = '';
$img->use_wordlist = true;
$img->show(JPATH_SITE . DS . 'components' . DS . 'com_breezingforms' . DS . 'images' . DS . 'captcha' . DS . 'backgrounds' . DS . 'bg6.jpg');
Beispiel #18
0
                 }
             }
         }
     }
     // обработка чеккера "Старт карьеры"
     if (!empty($_POST['career_launch'])) {
         $_POST['arrFieldsXmlData']['expires'] = false;
         $smarty->assignByRef('career_launch', $_POST['career_launch']);
     }
     // обработка чеккера "Не владею иностранными языками"
     isset($_POST['noforeign_lang']) ? $noforeign_lang =& $_POST['noforeign_lang'] : ($noforeign_lang = '');
     $smarty->assignByRef('noforeign_lang', $noforeign_lang);
 }
 // проверка капчи
 if (!isset($_POST['save']) && SECURE_CAPTCHA) {
     $securimage = new securimage();
     !$securimage->check($_POST['keystring']) ? $arrWarnings[] = $errFields['captcha'] = ERROR_CAPTCHA : null;
 }
 // обработка и проверка чеккера пользовательского соглашения
 !isset($_POST['agreement']) ? $_POST['agreement'] = false : null;
 $smarty->assignByRef('agreement', $_POST['agreement']);
 if (CONF_ANNOUNCE_USER_AGREEMENT_NOMEMBERS_REQUIRED && empty($_POST['agreement']) && !$user->getAuthorized()) {
     $arrWarnings[] = $errFields['agreement'] = ERROR_AGREEMENT;
 }
 // END Блок валидации данных переданных из формы
 // очищаем предупреждение о платности услуги
 if (isset($arrWarnings['payment'])) {
     unset($arrWarnings['payment']);
 }
 // проверяем есть ли ошибки
 if (!empty($arrWarnings)) {
     $errstr[] = "Please enter a valid email address";
 }
 if (empty($_POST['subject'])) {
     $error = 1;
     $errstr[] = "Please enter a subject";
 }
 if (empty($_POST['message']) || preg_match("/^enter your message here\$/i", $_POST['message'])) {
     $error = 1;
     $errstr[] = "Please enter a message";
 }
 if (empty($_POST['imagetext'])) {
     $error = 1;
     $errstr[] = "Please validate the image code";
 } else {
     include "securimage.php";
     $img = new securimage();
     $valid = $img->check($_POST['imagetext']);
     if (!$valid) {
         $error = 1;
         $errstr[] = "The code you entered was incorrect";
     }
 }
 if ($error == 1) {
     echo "<center>\n<font style=\"color: #FF0000\">\n";
     foreach ($errstr as $err) {
         echo "<li> " . $err . "</li>\n";
     }
     echo "</font>\n</center>\n<br />\n\n";
     showForm();
 } else {
     @mail($to, "Site Contact - " . $_POST['subject'], "Drew,\nOn " . date("r") . ", " . $_POST['name'] . " " . $_POST['email'] . " sent the following message.\nReason " . $_POST['reason'] . "\n\n" . stripslashes($_POST['message']), "From: " . $_POST['email']);
<?php
$_user_location	= 'public';
define('AT_INCLUDE_PATH', '../');
require (AT_INCLUDE_PATH.'vitals.inc.php');
session_start();

include 'securimage.php';

$img = new securimage();

$img->show(); // alternate use:  $img->show('/path/to/background.jpg');
?>
<?php

include 'securimage.php';
$img = new securimage();
$img->show();
// alternate use:  $img->show('/path/to/background.jpg');
<?php

include "securimage.php";
$img = new securimage();
$img->prune();
Beispiel #23
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require 'libraries/securimage/securimage.php';
$img = new securimage();
$img->code_length = 4;
$img->ttf_file = 'libraries/securimage/ttffonts/COOLVETI.ttf';
//Change some settings
$img->perturbation = 0.45;
$img->image_bg_color = new Securimage_Color("#f6f6f6");
$img->multi_text_color = array(new Securimage_Color("#3399ff"), new Securimage_Color("#3300cc"), new Securimage_Color("#3333cc"), new Securimage_Color("#6666ff"), new Securimage_Color("#99cccc"));
$img->use_multi_text = true;
$img->num_lines = 2;
$img->line_color = new Securimage_Color("#eaeaea");
if ($handle = @opendir('libraries/securimage/backgrounds/')) {
    while ($bgfile = @readdir($handle)) {
        if (preg_match('/\\.jpg$/i', $bgfile)) {
            $backgrounds[] = 'libraries/securimage/backgrounds/' . $bgfile;
        }
    }
    @closedir($handle);
}
srand((double) microtime() * 10000000);
$rand_keys = array_rand($backgrounds);
$background = $backgrounds[$rand_keys];
$img->show($background);
 *  QUALQUER GARANTIA; sem mesmo a garantia implicita de              
 *  COMERCIALIZACAO ou de ADEQUACAO A QUALQUER PROPOSITO EM           
 *  PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais  
 *  detalhes.                                                         
 *                                                                    
 *  Voce deve ter recebido uma copia da Licenca Publica Geral GNU     
 *  junto com este programa; se nao, escreva para a Free Software     
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA          
 *  02111-1307, USA.                                                  
 *  
 *  Copia da licenca no diretorio licenca/licenca_en.txt 
 *                                licenca/licenca_pt.txt 
 */
session_start();
include 'securimage.php';
$img = new securimage();
$get = $img->getCode();
$chek = $img->checkCode();
if (!isset($_GET["code"])) {
    exit;
}
if (!session_is_registered("DB_processacaptcha")) {
    $processa = true;
} else {
    if ($_SESSION["DB_processacaptcha"] == true) {
        $processa = true;
    } else {
        $processa = false;
        $_SESSION["DB_processacaptcha"] = true;
    }
}
 * to inform users that the changes are not a part of the original software.<br /><br />
 *
 * If you found this script useful, please take a quick moment to rate it.<br />
 * http://www.hotscripts.com/rate/49400.html  Thanks.
 *
 * @link http://www.phpcaptcha.org Securimage PHP CAPTCHA
 * @link http://www.phpcaptcha.org/latest.zip Download Latest Version
 * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
 * @copyright 2009 Drew Phillips
 * @author Drew Phillips <*****@*****.**>
 * @version 2.0 BETA (November 15, 2009)
 * @package Securimage
 *
 */
include 'securimage.php';
$img = new securimage();
//Change some settings
$img->image_width = 320;
$img->image_height = 100;
$img->perturbation = 0.9;
$img->code_length = rand(5, 6);
$img->image_bg_color = new Securimage_Color(0xff, 0xff, 0xff);
$img->use_transparent_text = true;
$img->text_transparency_percentage = 75;
// 100 = completely transparent
$img->num_lines = 15;
$img->image_signature = '';
$img->text_color = new Securimage_Color(0, 0, 0);
$img->line_color = new Securimage_Color(0xcc, 0xcc, 0xcc);
$img->show('');
// alternate use:  $img->show('/path/to/background_image.jpg');
Beispiel #26
0
 static function check($code_entered)
 {
     require_once LAFC_HELPER_PATH . '/captcha/securimage.php';
     $s_img = new securimage();
     $s_img->namespace = LAFC_COMPONENT;
     $ret = $s_img->check($code_entered);
     return $ret;
 }
Beispiel #27
0
    $img->ttf_font_directory = getcwd() . '/ttffonts';
    $img->show('');
    if (!file_exists($img->captcha_path . $prefix . '.php')) {
        $img->clean_temp_dir($img->captcha_path);
        if ($fh = fopen($img->captcha_path . $prefix . '.php', 'w')) {
            fwrite($fh, '<?php $captcha_word = \'' . $captcha_word . '\'; ?>');
            fclose($fh);
            @chmod($img->captcha_path . $prefix . '.php', 0755);
        }
    }
    unset($img);
    exit;
} else {
    // session
    include 'securimage.php';
    $img = new securimage();
    $img->code_length = 4;
    $img->image_width = 175;
    $img->image_height = 60;
    if (isset($_GET['si_sm_captcha']) && $_GET['si_sm_captcha'] == 1) {
        $img->image_width = 132;
        $img->image_height = 45;
    }
    //set some settings
    if (isset($_GET['si_form_id']) && in_array($_GET['si_form_id'], array('com', 'reg', 'log'))) {
        $img->form_id = $_GET['si_form_id'];
    }
    $img->use_multi_text = true;
    $img->use_transparent_text = true;
    $img->text_transparency_percentage = 20;
    $img->num_lines = 3;
<?php

require_once 'securimage.php';
$img = new securimage();
// $img->image_width = 278;
$img->image_width = 250;
$img->image_height = 80;
// $img->ttf_file = 'AHGBold.ttf';
$img->perturbation = 0.85;
$img->image_bg_color = new Securimage_Color(0x0, 0x0, 0x0);
$img->text_color = new Securimage_Color(0xff, 0xff, 0xff);
$img->text_transparency_percentage = 10;
$img->use_transparent_text = true;
$img->text_angle_minimum = -10;
$img->text_angle_maximum = 10;
$img->num_lines = 0;
$img->line_color = new Securimage_Color(0xff, 0xaff, 0xff);
$img->show('backgrounds/bg6.png');
Beispiel #29
0
// признак вывода капчи
$secure = false;
// проверяем, включена ли регистрация
if (CONF_USER_REGISTER) {
    // если пользователь уже вошел на сайт, не пускаем его в форму авторизации
    if ($user->getAuthorized()) {
        messages::error404();
    } else {
        $return_data = array('email' => false);
        // сохраняем в сесиию рефер-ссылку
        !isset($_SESSION['referer']) && secure::checkServerCalls() && isset($_GET['do']) && !strpos($_SERVER['HTTP_REFERER'], $_GET['do']) ? $_SESSION['referer'] = $_SERVER['HTTP_REFERER'] : null;
        if (!empty($_POST['email']) && !empty($_POST['password'])) {
            if (validate::postDataNotEmpty()) {
                // проверяем капчу
                if (isset($_POST['keystring'])) {
                    $securimage = new securimage();
                    !$securimage->check($_POST['keystring']) ? $arrErrors[] = ERROR_CAPTCHA : null;
                }
                $_POST['remember'] = isset($_POST['remember']) ? true : false;
                if ($user->issetUser("email IN (" . secure::escQuoteData($_POST['email']) . ") AND password IN ('" . md5($_POST['password']) . "') AND token IN ('active', 'new')")) {
                    if ($user->authorizeUser($_POST['email'], $_POST['password'], $_POST['remember'])) {
                        unset($_SESSION['user_fail_auth']);
                        if (isset($_SESSION['referer']) && !strstr($_SESSION['referer'], 'do=payments')) {
                            $referer = $_SESSION['referer'];
                            unset($_SESSION['referer']);
                            die('<script type="text/javascript">window.location="' . $referer . '";</script>');
                        } else {
                            die('<script type="text/javascript">window.location="' . chpu::createChpuUrl(CONF_SCRIPT_URL . 'index.php?do=user.data') . '";</script>');
                        }
                    } else {
                        $arrErrors[] = ERROR_AUTHORIZE_ACCOUNT_NOT_ACTIVATE;
Beispiel #30
0
 function ucheck()
 {
     $username = $this->input->post('username');
     $email = $this->input->post('email');
     $code = $this->input->post('security_code');
     $fullname = $this->input->post('fullname');
     $exitUser = -1;
     $exitEmail = -1;
     $checkCode = -1;
     $error = 0;
     $msgSuccess = '';
     if ($username) {
         $exitUser = $this->user_group_model->userExists($username) ? 1 : 0;
     }
     if ($email) {
         $exitEmail = $this->user_group_model->emailExists($email) ? 1 : 0;
     }
     //check seccurity imgage
     include_once dirname(BASEPATH) . DIRECTORY_SEPARATOR . 'securimage' . DIRECTORY_SEPARATOR . 'securimage.php';
     $img = new securimage();
     if ($code) {
         $checkCode = $img->check($code) ? 0 : 1;
     }
     if ($exitUser || $exitEmail || $checkCode) {
         $error = 1;
     }
     $aryJson = array('username' => $exitUser, 'email' => $exitEmail, 'code' => $checkCode);
     if (!$error) {
         //process create user
         $data = $this->_get_user_form_values();
         $status = $this->user_group_model->addUser($data);
         if ($status == 1) {
             //login cho user
             $sessdata = array();
             $sessdata = $this->user_group_model->getUserInfo($username);
             $sessdata['loggedin'] = TRUE;
             // Set the session
             $this->session->set_userdata($sessdata);
             $_SESSION['userdata'] = $sessdata;
             $msgSuccess = 'Quá trình đăng ký thành công, chào mừng bạn "' . $username . '"';
         }
     }
     exit(json_encode(array('error' => $error, 'aryError' => $aryJson, 'msg' => $msgSuccess, 'url' => site_url())));
 }