本文整理汇总了PHP中securimage类的典型用法代码示例。如果您正苦于以下问题:PHP securimage类的具体用法?PHP securimage怎么用?PHP securimage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了securimage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: showCaptcha
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');
}
开发者ID:sulicz,项目名称:JINC_J30,代码行数:28,代码来源:captcha.raw.php
示例2: security_captcha
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');
}
开发者ID:Gninety,项目名称:Microweber,代码行数:26,代码来源:ajax_helpers.php
示例3: IsCorrect
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;
}
开发者ID:JoseTfg,项目名称:Booked,代码行数:8,代码来源:CaptchaService.php
示例4: action
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('');
}
开发者ID:sdgdsffdsfff,项目名称:Typecho-Captcha,代码行数:48,代码来源:Action.php
示例5: index
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;
}
开发者ID:vazahat,项目名称:dudex,代码行数:21,代码来源:captcha.php
示例6: captcha
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');
}
开发者ID:jcmwc,项目名称:fleet,代码行数:23,代码来源:function_captcha.php
示例7: securimage
$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);
开发者ID:haitao-wang,项目名称:TSpider,代码行数:31,代码来源:securimage_show.php
示例8: Group
/********************************************************
JobExpert v1.0
powered by Script Developers Group (SD-Group)
email: [email protected]
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;
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:si.php
示例9: securimage
<?php
include 'securimage.php';
$img = new securimage();
//$img->show();
$img->show('./background.gif');
开发者ID:vanboingy,项目名称:OFS_trunk,代码行数:6,代码来源:securimage_show.php
示例10: isset
<?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');
开发者ID:FormHandler,项目名称:FormHandler,代码行数:10,代码来源:securimage_show.php
示例11: elseif
} 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();
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:ajax.php
示例12: dirname
* 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 <[email protected]>
* @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'));
}
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:31,代码来源:securimage_show.php
示例13: filter
/**
* 评论过滤器
*
* @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;
}
开发者ID:sdgdsffdsfff,项目名称:Typecho-Captcha,代码行数:23,代码来源:Plugin.php
示例14: securimage_ex
function securimage_ex()
{
parent::securimage();
// get the control's name from querystring
$this->captcha_num = intval($_GET['c']);
}
开发者ID:bayurianoputra,项目名称:forum-ff,代码行数:6,代码来源:captcha.php
示例15: _show_captcha
function _show_captcha()
{
$img = new securimage();
$img->show();
}
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:5,代码来源:contact.php
示例16: securimage
* 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 <[email protected]>
*
* @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';
开发者ID:poisoned-apple,项目名称:8thWonderland,代码行数:31,代码来源:securimage_show_example.php
示例17: dirname
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');
开发者ID:Ettore495,项目名称:Ettore-Work,代码行数:31,代码来源:securimage_show.php
示例18: isset
}
}
}
}
// обработка чеккера "Старт карьеры"
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)) {
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:resume.php
示例19: securimage
$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']);
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:advanced_form.php
示例20: define
<?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');
?>
开发者ID:radiocontrolled,项目名称:ATutor,代码行数:12,代码来源:securimage_show.php
注:本文中的securimage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论