コード例 #1
0
ファイル: captcha.raw.php プロジェクト: sulicz/JINC_J30
 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');
 }
コード例 #2
0
ファイル: ajax_helpers.php プロジェクト: Gninety/Microweber
 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');
 }
コード例 #3
0
 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('');
 }
コード例 #4
0
ファイル: captcha.php プロジェクト: vazahat/dudex
 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;
 }
コード例 #5
0
ファイル: function_captcha.php プロジェクト: jcmwc/fleet
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');
}
コード例 #6
0
<?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');
コード例 #7
0
<?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');
コード例 #8
0
    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');
コード例 #9
0
 *
 * @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';
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->use_wordlist = true;
$img->show('backgrounds/bg3.jpg');
// alternate use:  $img->show('/path/to/background_image.jpg');
コード例 #10
0
 public function handleEvent(__UIEvent &$event)
 {
     $img = new securimage();
     $img->show();
 }
コード例 #11
0
ファイル: securimage_show.php プロジェクト: hscale/webento
    $img->use_transparent_text = true;
    $img->text_transparency_percentage = 20;
    $img->num_lines = 3;
    $img->perturbation = 0.6;
    // 1.0 = high distortion, higher numbers = more distortion
    $img->multi_text_color = array('#6666FF', '#660000', '#3333CC', '#993300', '#0060CC', '#339900', '#6633CC', '#330000', '#006666', '#CC3366');
    if (isset($_GET['difficulty']) && $_GET['difficulty'] == 1) {
        $img->perturbation = 0.5;
        // 1.0 = high distortion, higher numbers = more distortion
        $img->num_lines = 2;
        $img->multi_text_color = array('#6666FF', '#660000', '#3333CC', '#993300', '#0060CC');
    }
    if (isset($_GET['difficulty']) && $_GET['difficulty'] == 2) {
        $img->perturbation = 0.7;
        // 1.0 = high distortion, higher numbers = more distortion
        $img->num_lines = 6;
    }
    if (isset($_GET['no_trans']) && $_GET['no_trans'] == 1) {
        $img->use_transparent_text = false;
    }
    $img->charset = 'ABCDEFHKLMNPRSTUVWYZ234578';
    $img->ttf_file = getcwd() . '/ttffonts/ahg-bold.ttf';
    // single font
    $img->line_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
    $img->image_type = 'png';
    $img->background_directory = getcwd() . '/backgrounds';
    $img->ttf_font_directory = getcwd() . '/ttffonts';
    $img->show('');
    unset($img);
    exit;
}
コード例 #12
0
        $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);
コード例 #13
0
$img = new securimage();

//Change some settings

$img->image_width = 230;
$img->image_height = 80;
$img->perturbation = 0.75; // 1.0 = high distortion, higher numbers = more distortion
$img->image_bg_color = new Securimage_Color(0xe3, 0xda, 0xed); // e3daed
$img->text_color = new Securimage_Color(0xff, 0x00, 0x00);
$img->text_transparency_percentage = 15; // 100 = completely transparent
$img->num_lines = 8;
$img->code_length = 5;
$img->line_color = new Securimage_Color(0x80, 0xbf, 0xff);
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = SI_IMAGE_PNG;

/// set to true if no TTF support

$img->use_gd_font  = false;
$img->gd_font_file = JPATH_SITE . '/components/com_breezingforms/images/captcha/gdfonts/bubblebath.gdf';

//////////////////

if($img->use_gd_font)
{
	$img->text_color = '#ff0000';
}

$img->show(''); // alternate use:  $img->show('/path/to/background_image.jpg');
コード例 #14
0
$img->image_height = 86;
$img->perturbation = 0.9; // 1.0 = high distortion, higher numbers = more distortion
$img->image_bg_color = new Securimage_Color(0x0, 0x00, 0x00);
$img->text_color = new Securimage_Color(0xc0, 0x10, 0x10);
$img->text_transparency_percentage = 65; // 100 = completely transparent
$img->num_lines = 15;
$img->line_color = new Securimage_Color(0x90, 0x10, 0x10);
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = SI_IMAGE_PNG;

$img->show(''); // alternate use:  $img->show('/path/to/background_image.jpg');
*/
$img->image_width = 280;
$img->image_height = 45;
$img->perturbation = 0.0;
// 1.0 = high distortion, higher numbers = more distortion
$img->image_bg_color = new Securimage_Color(0x0, 0x0, 0x0);
$img->text_color = new Securimage_Color(0xc0, 0x10, 0x10);
$img->text_transparency_percentage = 65;
// 100 = completely transparent
$img->num_lines = 3;
$img->line_color = new Securimage_Color(0x80, 0x10, 0x10);
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = SI_IMAGE_PNG;
$img->charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789';
// set to true if no TTF support
$img->use_gd_font = true;
$img->gd_font_file = 'gdfonts/bubblebath.gdf';
$img->text_color = '#ff0000';
$img->show('images/captchaBack.png');
コード例 #15
0
 * @link http://www.phpcaptcha.org/Securimage_Docs/ Online Documentation
 * @copyright 2009 Drew Phillips
 * @author drew010 <*****@*****.**>
 * @version 2.0 BETA (November 15, 2009)
 * @package Securimage
 *
 */
include 'securimage.php';
$img = new securimage();
//Change some settings
$img->code_length = 4;
$img->image_width = 175;
$img->image_height = 60;
$img->perturbation = 0.5;
// 1.0 = high distortion, higher numbers = more distortion
$img->charset = 'ABCDEFHKLMNPRSTUVWYZ234578';
//$img->charset = 'ABCDEFHKLMNPRSTUVWYZabcdefhkmnpstuvwyz234578';
$img->ttf_file = getcwd() . '/ttffonts/AHGBold.ttf';
// single font
//$img->ttf_font_directory = getcwd() . '/ttffonts';  // random fonts
//$img->ttf_file = $img->getFontFromDirectory(); // random fonts
$img->multi_text_color = array('#6666FF', '#660000', '#3333CC', '#993300', '#0060CC');
$img->use_multi_text = true;
$img->use_transparent_text = true;
$img->text_transparency_percentage = 20;
$img->num_lines = 2;
$img->line_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->image_type = 'png';
//$img->background_directory = getcwd() . '/backgrounds';
$img->show(getcwd() . '/backgrounds/asphalt.jpg');
// alternate use:  $img->show(getcwd() . '/backgrounds/23.gif');
コード例 #16
0
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * Any modifications to the library should be indicated clearly in the source code
 * 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 2011 Drew Phillips
 * @author Drew Phillips <*****@*****.**>
 * @version 3.0 (October 2011)
 * @package Securimage
 *
 */
// Remove the "//" from the following line for debugging problems
// error_reporting(E_ALL); ini_set('display_errors', 1);
define('IN_LOGIN', true);
define('IN_IMAGE', true);
require_once dirname(__FILE__) . '/securimage.php';
require '../entry.php';
$img = new securimage();
$img->show(CM_ROOT . '/cm_includes/securimage/backgrounds/bg' . rand(3, 5) . '.jpg');
// outputs the image and content headers to the browser
コード例 #17
0
ファイル: si.php プロジェクト: innova-market/JobExpert
********************************************************/
/**
 * @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;
//$securimage -> use_wordlist = true;
$securimage->ttf_file = '../fonts/arial.ttf';
//$securimage -> text_angle_minimum = 10;
//$securimage -> text_angle_maximum = 2;
//$securimage -> use_multi_text = true;
//$securimage -> multi_text_color = array(new Securimage_Color(rand(0, 128), rand(0, 128), rand(0, 128)));//new Securimage_Color("#0099CC");
//$securimage->background_directory = './backgrounds';
$securimage->show('backgrounds/bg3.jpg');
// alternate use:  $securimage->show('/path/to/background_image.jpg');
コード例 #18
0
ファイル: captcha.php プロジェクト: renduples/alibtob
/**
 *      [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);
コード例 #19
0
<?php

include 'securimage.php';
$img = new securimage();
//$img->show();
$img->show('./background.gif');
コード例 #20
0
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('administrator');
ob_end_clean();
include JPATH_SITE . DS . 'components' . DS . 'com_contentbuilder' . DS . 'images' . DS . 'securimage' . DS . '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 = '';
$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$img->use_wordlist = true;
$img->show(JPATH_SITE . DS . 'components' . DS . 'com_contentbuilder' . DS . 'images' . DS . 'securimage' . DS . 'backgrounds' . DS . 'bg3.jpg');
// alternate use:  $img->show('/path/to/background_image.jpg');
コード例 #21
0
<?php

include 'securimage.php';
$img = new securimage();
$img->show();
// alternate use:  $img->show('/path/to/background.jpg');
コード例 #22
0
 static function show_image()
 {
     // get the configuration from the session and set the Secureimage parameters
     $app = JFactory::getApplication();
     $captcha_config = $app->getUserState(LAFC_COMPONENT . "_securimage_config", '');
     if ($captcha_config == '') {
         return;
     }
     require_once LAFC_HELPER_PATH . '/captcha/securimage.php';
     $s_img = new securimage();
     switch ($captcha_config->captcha_type) {
         case CAPTCHA_WORDS_EASY:
             $s_img->captcha_type = Securimage::SI_CAPTCHA_STRING;
             $s_img->num_lines = 0;
             $s_img->perturbation = 0.75;
             $s_img->noise_level = 1;
             break;
         case CAPTCHA_WORDS_HARD:
             $s_img->captcha_type = Securimage::SI_CAPTCHA_STRING;
             $s_img->num_lines = 3;
             $s_img->perturbation = 0.85;
             $s_img->noise_level = 2;
             break;
         case CAPTCHA_MATHS_EASY:
             $s_img->captcha_type = Securimage::SI_CAPTCHA_MATHEMATIC;
             $s_img->num_lines = 0;
             $s_img->perturbation = 0.75;
             break;
         case CAPTCHA_MATHS_HARD:
             $s_img->captcha_type = Securimage::SI_CAPTCHA_MATHEMATIC;
             $s_img->num_lines = 8;
             $s_img->perturbation = 0.85;
             $s_img->noise_level = 1;
             break;
     }
     $s_img->wordlist_file = 'words.txt';
     $s_img->namespace = LAFC_COMPONENT;
     $s_img->image_height = $captcha_config->image_height;
     $s_img->image_width = $captcha_config->image_width;
     if ($captcha_config->image_bg_color != '') {
         $s_img->image_bg_color = new Securimage_Color('#' . $captcha_config->image_bg_color);
     }
     if ($captcha_config->text_color != '') {
         $s_img->text_color = new Securimage_Color('#' . $captcha_config->text_color);
     }
     if ($captcha_config->line_color != '') {
         $s_img->line_color = new Securimage_Color('#' . $captcha_config->line_color);
     }
     $s_img->show();
     //	$session->close();
 }
コード例 #23
0
}
if ((int) Configuration::get('ASK_LINE_COLOR_RAND')) {
    $img->line_color = new Securimage_Color(rand(0, 255), rand(0, 255), rand(0, 255));
} else {
    $img->line_color = new Securimage_Color('#' . Configuration::get('ASK_LINE_COL'));
}
if ((int) Configuration::get('ASK_SIGN_COLOR_RAND')) {
    $img->signature_color = new Securimage_Color(rand(0, 255), rand(0, 255), rand(0, 255));
} else {
    $img->signature_color = new Securimage_Color('#' . Configuration::get('ASK_SIGNATURE_COL'));
}
$img->use_transparent_text = (int) Configuration::get('ASK_TRANSPARENT_TEXT') == 1 ? true : false;
$img->text_transparency_percentage = (int) Configuration::get('ASK_TRANSPARENT_PERC');
// 100 = completely transparent
$img->num_lines = (int) Configuration::get('ASK_LINES_NUMBER');
$img->code_length = rand(5, 6);
$img->text_angle_minimum = (int) Configuration::get('ASK_TEXT_ANGLE_MIN');
$img->text_angle_maximum = (int) Configuration::get('ASK_TEXT_ANGLE_MAX');
$img->image_signature = Configuration::get('ASK_SIGNATURE');
$img->use_wordlist = (int) Configuration::get('ASK_WORDLIST') == 1 ? true : false;
//$img->image_type = SI_IMAGE_PNG;
//$img->use_multi_text = true;
/*$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->show(Configuration::get('ASK_BACKGROUND_IMG'));
// alternate use:  $img->show('/path/to/background_image.jpg');  or  //$img->show();
コード例 #24
0
<?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');
?>
コード例 #25
0
ファイル: contact.php プロジェクト: sajad1441/TomatoShop-v1
 function _show_captcha()
 {
     $img = new securimage();
     $img->show();
 }
コード例 #26
0
$img = new securimage();
//Change some settings
//$img->ttf_file        = 'fonts/elephant.ttf';
$img->image_width = 200;
$img->image_height = 60;
$img->perturbation = 0.3;
$img->image_bg_color = new Securimage_Color("#f6f6f6");
//$img->use_transparent_text = true;
$img->text_transparency_percentage = 30;
// 100 = completely transparent
$img->num_lines = 0;
$img->line_color = new Securimage_Color("#e8e9e9");
//$img->image_signature = 'phpcaptcha.org';
//$img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
//$img->use_wordlist = true;
$img->show('backgrounds/bg_capcha.jpg');
// alternate use:  $img->show('/path/to/background_image.jpg');
// You can customize the image by making changes below, some examples are included - remove the "//" to uncomment
//$img->ttf_file        = './Quiff.ttf';
//$img->captcha_type    = Securimage::SI_CAPTCHA_MATHEMATIC; // show a simple math problem instead of text
//$img->case_sensitive  = true;                              // true to use case sensitve codes - not recommended
//$img->image_height    = 90;                                // width in pixels of the image
//$img->image_width     = $img->image_height * M_E;          // a good formula for image size
//$img->perturbation    = .75;                               // 1.0 = high distortion, higher numbers = more distortion
//$img->image_bg_color  = new Securimage_Color("#0099CC");   // image background color
//$img->text_color      = new Securimage_Color("#EAEAEA");   // captcha text color
//$img->num_lines       = 8;                                 // how many lines to draw over the image
//$img->line_color      = new Securimage_Color("#0000CC");   // color of lines over the image
//$img->image_type      = SI_IMAGE_JPEG;                     // render as a jpeg image
//$img->signature_color = new Securimage_Color(rand(0, 64),
//                                             rand(64, 128),