show('bg.jpg');
public static function sendCaptcha() { $libPath = INSTALL_PATH . "/server/classes/securimage"; $img = new Securimage(); $img->wordlist_file = $libPath . "/words/words.txt"; $img->gd_font_file = $libPath . "/gdfonts/automatic.gdf"; $img->signature_font = $img->ttf_file = $libPath . "/AHGBold.ttf"; $img->image_height = 80; $img->image_width = 170; $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 = 5; $img->line_color = new Securimage_Color("#eaeaea"); $img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255)); $img->use_wordlist = true; if (!function_exists('imagettftext')) { $img->use_gd_font = true; $img->use_transparent_text = false; $img->use_multi_text = false; } //$img->show($libPath."/backgrounds/bg3.jpg"); $img->show(); }
public function securimages_show() { $img = new Securimage(); // 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; // height in pixels of the image //$img->image_width = $img->image_height * M_E; // a good formula for image size based on the height //$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), // rand(128, 255)); // random signature color // see securimage.php for more options that can be set // set namespace if supplied to script via HTTP GET if (!empty($_GET['namespace'])) { $img->setNamespace($_GET['namespace']); } $img->show(); // outputs the image and content headers to the browser // alternate use: // $img->show('/path/to/background_image.jpg'); }
function show() { $options = array('text_color' => new Securimage_Color('#e80707'), 'captcha_type' => 1, 'noise_level' => 2); $phpcaptcha = new Securimage($options); $phpcaptcha->show(); exit; }
public function actionCaptcha() { require_once dirname(__FILE__) . '/../widget/secureimage/assets/securimage.php'; $img = new \Securimage(); // You can customize the image by making changes below, some examples are included - remove the "//" to uncomment //$img->ttf_file = dirname(__FILE__) . '/../widget/secureimage/assets/AHGBold.ttf'; //$img->captcha_type = \Securimage::SI_CAPTCHA_WORDS; // show a simple math problem instead of text //$img->case_sensitive = true; // true to use case sensitve codes - not recommended //$img->image_height = 90; // height in pixels of the image //$img->image_width = $img->image_height * M_E *1.5; // a good formula for image size based on the height //$img->perturbation = .75; // 1.0 = high distortion, higher numbers = more distortion $img->image_bg_color = new \Securimage_Color("#f1f3f4"); // image background color //$img->text_color = new \Securimage_Color("#000"); // 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), // rand(128, 255)); // random signature color if (!empty($_GET['namespace'])) { $img->setNamespace($_GET['namespace']); } $img->show(); }
/** * 画像作成。 */ public function captcha() { App::import('Vendor', 'Securimage', array('file' => 'securimage/securimage.php')); $securimage = new Securimage(); $securimage->ttf_file = ROOT . '/vendors/securimage/AHGBold.ttf'; $securimage->show(); }
public static function show($captcha_name, $width = 300, $height = 100) { $options = array('send_headers' => FALSE, 'no_exit' => TRUE); $img = new Securimage($options); //Change some settings $img->namespace = $captcha_name; $img->image_width = $width; $img->image_height = $height; $img->perturbation = 0.85; $img->image_bg_color = new Securimage_Color("#f6f6f6"); $img->use_transparent_text = true; $img->text_transparency_percentage = 10; // 100 = completely transparent $img->num_lines = 7; $img->line_color = new Securimage_Color("#eaeaea"); $img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255)); ob_start(); // start the output buffer $img->show(BASEPATH . '../application/third_party/securimage/backgrounds/bg6.jpg'); // alternate use: $img->show('/path/to/background_image.jpg'); $imgBinary = ob_get_contents(); // get contents of the buffer ob_end_clean(); // turn off buffering and clear the buffer header('Content-Type: image/png'); header('Content-Length: ' . strlen($imgBinary)); echo $imgBinary; }
/** * Method to display the captcha to validate the form * * @access public */ function captcha() { include "components/com_visforms/captcha/securimage.php"; $img = new Securimage(); $img->namespace = 'form' . JFactory::getApplication()->input->getInt('id', 0); $img->ttf_file = "components/com_visforms/captcha/elephant.ttf"; $img->show(); }
public function securimage() { $this->load->config('csecurimage'); $active = $this->config->item('si_active'); $allsettings = array_merge($this->config->item($active), $this->config->item('si_general')); $this->load->library('securimage/securimage'); $img = new Securimage($allsettings); //$img->captcha_type = Securimage::SI_CAPTCHA_MATHEMATIC; $img->show(APPPATH . 'libraries/securimage/backgrounds/bg6.png'); }
public function generate() { $config = configHelper::getConfig()['securimageConfig']; $si = new \Securimage($config); //securimage write the image data to output buffer, we should get it and clean output buffer and encode image data to a base64 string. $si->show(); $imageData = ob_get_contents(); ob_get_clean(); $imageStr = base64_encode($imageData); $imageCode = $si->getCode(false, true); return ['data' => $imageStr, 'code' => $imageCode]; }
public function getCaptcha(Request $request) { $config = Config::get('securimage'); $captcha = new \Securimage(); $captcha->code_length = $config['length']; $captcha->image_width = $config['width']; $captcha->image_height = $config['height']; $captcha->perturbation = $config['perturbation']; $captcha->case_sensitive = $config['case_sensitive']; $captcha->num_lines = $config['num_lines']; $captcha->charset = $config['charset']; $captcha->show(); }
/** * @inheritdoc */ protected function generate($generate = false) { if (!empty($this->data) && $generate === false) { return $this->data; } switch ($this->provider->image_type) { case Securimage::SI_IMAGE_JPEG: $this->data['mimeType'] = 'image/jpeg'; break; case Securimage::SI_IMAGE_GIF: $this->data['mimeType'] = 'image/gif'; break; default: $this->data['mimeType'] = 'image/png'; break; } ob_start(); $this->provider->show(); $this->data['image'] = ob_get_clean(); $this->code = $this->provider->getCode([], true); return $this->data; }
/** * 生成验证码2 * @param type $sessionName * @param type $width * @param type $height */ static function validatePic2($sessionName = "defaultSess", $width = 0, $height = 0) { require Yii::app()->basePath . '/components/SecurImage.php'; $validateImage = new Securimage(); $validateImage->use_gd_font = true; $validateImage->gd_font_file = Yii::app()->basePath . "/components/font/crass.gdf"; $validateImage->draw_lines = false; $validateImage->arc_linethrough = false; $validateImage->sess_name = $sessionName; if ($width != 0) { $validateImage->image_width = $width; } if ($height != 0) { $validateImage->image_height = $height; } $code = $validateImage->createCode(); Yii::app()->session[$sessionName] = strtolower($code); $validateImage->show(); }
//$img->image_height = 90; // height in pixels of the image //$img->image_width = $img->image_height * M_E; // a good formula for image size based on the height //$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), // rand(128, 255)); // random signature color // $img->ttf_file = './Aller_Bd.ttf'; $img->image_height = 30; $img->image_width = 81; $img->image_bg_color = new Securimage_Color(0, 0, 0); // image background color $img->perturbation = 0; $img->text_color = new Securimage_Color(255, 255, 255); // captcha text color $img->num_lines = 0; // how many lines to draw over the image $img->charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; // see securimage.php for more options that can be set // set namespace if supplied to script via HTTP GET if (!empty($_GET['namespace'])) { $img->setNamespace($_GET['namespace']); } $img->show(); // outputs the image and content headers to the browser // alternate use: // $img->show('/path/to/background_image.jpg');
function securimage() { $this->load->library('securimage/securimage'); $img = new Securimage(); $img->show(); }
<?php require_once 'helpers/Captcha.class.php'; $image = new Securimage(); $image->image_width = 250; $image->image_height = 80; $image->perturbation = 0.85; $image->image_bg_color = new Securimage_Color("#999"); $image->use_transparent_text = true; $image->num_lines = 3; $image->line_color = new Securimage_Color("#ccc"); $image->show('images/captcha/bg1.jpg');
public function index() { include_once FCPATH . 'resource/securimage/securimage.php'; $img = new Securimage(); $img->show(); }
public function imageAction() { //require(str_replace("index.php/","",Mage::getBaseDir()).DS.'mw_capcha'.DS.'Securimage.php'); $store_id = Mage::app()->getStore()->getId(); if (!Mage::helper('rewardpoints')->enabledCapcha($store_id)) { $this->norouteAction(); return; } $require = dirname(dirname(__FILE__)) . "/Helper/Capcha/Securimage.php"; require $require; $hp = $this->_getHelper(); $img = new Securimage(); //Change some settings $img->use_wordlist = $hp->capchaUseWordList($store_id); $img->image_width = $hp->getCapchaImageWidth($store_id); $img->image_height = $hp->getCapchaImageHeight($store_id); $img->perturbation = $hp->getCapchaPerturbation($store_id); $img->code_length = $hp->getCapchaCodeLength($store_id); $img->image_bg_color = new Securimage_Color($hp->getCapchaBackgroundColor($store_id)); $img->use_transparent_text = $hp->capchaUseTransparentText($store_id); $img->text_transparency_percentage = $hp->getCapchaTextTransparencyPercentage($store_id); // 100 = completely transparent $img->num_lines = $hp->getCapchaNumberLine($store_id); $img->text_color = new Securimage_Color($hp->getCapchaTextColor($store_id)); $img->line_color = new Securimage_Color($hp->getCapchaLineColor($store_id)); $backgroundFile = $hp->getCapchaBackgroundImage($store_id); $img->show($backgroundFile); }
<? require_once 'securimage.php'; $image = new Securimage(); $image->show(); ?>
/** * 获取验证码 */ public function getCaptchaImageAction() { require APP_PATH . 'libraries/securimage/securimage.php'; $img = new \Securimage(array('session' => $this->session, 'use_wordlist' => true)); $img->show(APP_PATH . 'libraries/securimage/backgrounds/bg4.jpg'); }
<?php require_once dirname(__FILE__) . '/securimage.php'; $img = new Securimage(); // $img->image_width = 278; $img->image_width = 250; $img->image_height = 80; $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->use_wordlist = false; $img->show('backgrounds/bg6.png');
/** * generate HTML Pages * * @param Object $postId Post Id * @param Object $formId Form Id * @param String $formName Form Name * @param String $formType Form Type * @param String $topContent Module Top content * @param String $bottomContent Module Bottom Content * @param String $showTitle State Show Title Form * @param String $showDes State Show Description Form * * @return string */ public static function generate_html_pages($postId, $formId, $formName, $formType = '', $topContent = '', $bottomContent = '', $showTitle = false, $showDes = false) { $html = ''; $assets = array(); // add Filter apply assets load_plugin_textdomain(WR_CONTACTFORM_TEXTDOMAIN, false, WR_CONTACTFORM_TEXTDOMAIN . '/frontend/languages/'); //$assets[ ] = 'wr-contactform-jquery-ui-css'; $loadBootstrap = get_option('wr_contactform_load_bootstrap_css', 1); if ($loadBootstrap != '0' && $loadBootstrap != 0) { $assets[] = 'wr-bootstrap2-css'; } $items = get_post_meta((int) $postId); $formPages = self::get_form_content((int) $formId); $scheme = parse_url(get_site_url(), PHP_URL_SCHEME); /* define language */ $arrayTranslated = array('The password must contain minimum %mi% and maximum %mx% character(s)', 'Both email addresses must be the same.', 'The number cannot be less than', 'The number cannot be greater than', 'WR_CONTACTFORM_DATE_HOUR_TEXT', 'WR_CONTACTFORM_DATE_MINUTE_TEXT', 'WR_CONTACTFORM_DATE_CLOSE_TEXT', 'Prev', 'Next', 'Today', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Wk', 'The information cannot contain more than', 'The information cannot contain less than', 'WR_CONTACTFORM_CAPTCHA_PUBLICKEY', 'WR_CONTACTFORM_BUTTON_BACK', 'WR_CONTACTFORM_BUTTON_NEXT', 'WR_CONTACTFORM_BUTTON_RESET', 'WR_CONTACTFORM_BUTTON_SUBMIT', 'This field can not be empty, please enter required information.', 'The information is invalid, please correct.'); /* Check load JS */ $checkLoadJS = array(); $checkLoadJSTipsy = false; $formSettings = !empty($items['form_settings'][0]) ? json_decode($items['form_settings'][0]) : ''; if ($formPages) { $formStyleCustom = new stdClass(); if (!empty($items['form_style'][0])) { $formStyleCustom = json_decode($items['form_style'][0]); } $dataSumbission = ''; $classForm = !empty($formStyleCustom->layout) ? $formStyleCustom->layout : ''; $formTheme = !empty($formStyleCustom->theme) ? $formStyleCustom->theme : ''; if (!$formType) { wp_enqueue_style('contactform_form_' . $formId, site_url() . '/?wr-cf-gadget=contactform-style&action=default&form_id=' . $formId); $html .= "<div class=\"wr-contactform jsn-master\" data-form-name='" . $formName . "' id='wr_form_" . $formId . "'><div class=\"jsn-bootstrap\">"; $html .= $topContent; $html .= "<form name='form_{$formName}' id='form_{$formName}' action=\"" . site_url() . '/?wr-cf-gadget=contactform-frontend&action=default&task=form.save&form_id=' . $formId . "\" method=\"post\" class=\"form-validate {$classForm} \" enctype=\"multipart/form-data\" >"; $html .= "<span class=\"hide wr-language\" style=\"display:none;\" data-value='" . json_encode(WR_Contactform_Helpers_Contactform::get_translated($arrayTranslated)) . "'></span>"; $html .= '<span class="hide wr-base-url" style="display:none;" data-value="' . get_site_url() . '"></span>'; $html .= '<div id="page-loading" class="jsn-bgloading"><i class="jsn-icon32 jsn-icon-loading"></i></div>'; $html .= '<div class="jsn-row-container ' . $formTheme . '">'; } $html .= '<div class="message-contactform"> </div>'; include_once WR_CONTACTFORM_PATH . 'helpers/form.php'; foreach ($formPages as $i => $contentForm) { $pageContainer = !empty($contentForm->page_container) && json_decode($contentForm->page_container) ? $contentForm->page_container : '[[{"columnName":"left","columnClass":"span12"}]]'; $formContent = isset($contentForm->page_content) ? json_decode($contentForm->page_content) : ''; $htmlForm = ''; if (!empty($formContent)) { foreach ($formContent as $content) { if (!empty($content->options->instruction) || !empty($content->instruction)) { $checkLoadJSTipsy = true; } if (!empty($content->type)) { $checkLoadJS[$content->type] = $content->type; } } $htmlForm .= WR_Contactform_Helpers_Form::generate($formContent, $dataSumbission, $pageContainer); } $html .= "<div data-value=\"{$contentForm->page_id}\" class=\"jsn-form-content hide\">{$htmlForm}"; if ($i + 1 == count($formPages)) { $global_captcha_setting = get_option('wr_contactform_global_captcha_setting', 2); if ($global_captcha_setting != 0) { if (!empty($formSettings->form_captcha) && $formSettings->form_captcha == 1) { if ($scheme == 'https') { $html .= '<script type="text/javascript" src="https://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>'; } else { $html .= '<script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>'; } $html .= '<div id="' . md5(date('Y-m-d H:i:s') . $i . $formName) . '" publickey="' . WR_CONTACTFORM_CAPTCHA_PUBLICKEY . '" class="form-captcha control-group"></div>'; } else { if (!empty($formSettings->form_captcha) && $formSettings->form_captcha == 2 || $global_captcha_setting == 1) { include_once WR_CONTACTFORM_PATH . 'libraries/3rd-party/securimage/securimage.php'; $img = new Securimage(); $img->case_sensitive = true; // true to use case sensitve codes - not recommended $img->image_bg_color = new Securimage_Color('#ffffff'); // image background color $img->text_color = new Securimage_Color('#000000'); // captcha text color $img->num_lines = 0; // how many lines to draw over the image $img->line_color = new Securimage_Color('#0000CC'); // color of lines over the image $img->namespace = $formName; $img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255)); // random signature color ob_start(); $img->show(WR_CONTACTFORM_PATH . 'libraries/3rd-party/securimage/backgrounds/bg4.png'); $dataCaptcha = base64_encode(ob_get_clean()); $html .= '<div class="control-group wr-captcha-block"> <div class="controls"> <div class="row-fluid"><img src="data:image/png;base64,' . $dataCaptcha . '" alt="CAPTCHA" /></div> <input type="text" id="wr-captcha" name="captcha" autocomplete="off" placeholder="' . __('Captcha', WR_CONTACTFORM_TEXTDOMAIN) . '"> </div> </div>'; } } } } $html .= '</div>'; } $btnNext = !empty($formSettings->form_btn_next_text) ? $formSettings->form_btn_next_text : 'Next'; $btnPrev = !empty($formSettings->form_btn_prev_text) ? $formSettings->form_btn_prev_text : 'Prev'; $btnSubmit = !empty($formSettings->form_btn_submit_text) ? $formSettings->form_btn_submit_text : 'Submit'; $btnReset = !empty($formSettings->form_btn_reset_text) ? $formSettings->form_btn_reset_text : 'Reset'; $btnNextStyle = !empty($formStyleCustom->button_next_color) ? $formStyleCustom->button_next_color : 'btn btn-primary'; $btnPrevStyle = !empty($formStyleCustom->button_prev_color) ? $formStyleCustom->button_prev_color : 'btn'; $btnSubmitStyle = !empty($formStyleCustom->button_submit_color) ? $formStyleCustom->button_submit_color : 'btn btn-primary'; $btnResetStyle = !empty($formStyleCustom->button_reset_color) ? $formStyleCustom->button_reset_color : 'btn'; $btnPosition = !empty($formStyleCustom->button_position) ? $formStyleCustom->button_position : 'btn-toolbar'; $htmlBtnReset = ''; if (!empty($formSettings->form_state_btn_reset_text) && $formSettings->form_state_btn_reset_text == 'Yes') { $htmlBtnReset = '<button class="' . $btnResetStyle . ' reset" onclick="return false;">' . __($btnReset, WR_CONTACTFORM_TEXTDOMAIN) . '</button>'; } $html .= '<div class="form-actions"> <div class="' . $btnPosition . '"> <button class="' . $btnPrevStyle . ' prev hide" onclick="return false;">' . __($btnPrev, WR_CONTACTFORM_TEXTDOMAIN) . '</button> <button class="' . $btnNextStyle . ' next hide" onclick="return false;">' . __($btnNext, WR_CONTACTFORM_TEXTDOMAIN) . '</button> <button type="submit" class="' . $btnSubmitStyle . ' jsn-form-submit hide" >' . __($btnSubmit, WR_CONTACTFORM_TEXTDOMAIN) . '</button> ' . $htmlBtnReset . ' </div> </div>'; $postAction = isset($items['form_post_action'][0]) ? $items['form_post_action'][0] : ''; $postActionData = isset($items['form_post_action_data'][0]) ? $items['form_post_action_data'][0] : ''; $html .= '<input type="hidden" name="form_name" value="' . $formName . '" />'; if (!$formType) { $html .= '</div>'; $html .= '<input type="hidden" name="form_id" value="' . $formId . '" />'; $html .= '<input type="hidden" id="form_post_action" name="form_post_action" value="' . $postAction . '" />'; $html .= '<input type="hidden" name="form_post_action_data" value=\'' . htmlentities(json_encode(unserialize($postActionData)), ENT_QUOTES, 'UTF-8') . '\' />'; $html .= '</form>'; $html .= $bottomContent; $html .= '</div></div>'; } /* Load JS */ if (!empty($checkLoadJS['date'])) { $assets[] = 'wr-jquery-ui-css'; } wp_enqueue_script('jquery'); //$assets[ ] = 'wr-jquery-json-js'; $assets[] = 'wr-jquery-placeholder-js'; if ($checkLoadJSTipsy) { $assets[] = 'wr-jquery-tipsy-css'; $assets[] = 'wr-jquery-tipsy-js'; } $assets[] = 'wr-jquery-scrollto-js'; $loadBootstrapJs = get_option('wr_contactform_load_bootstrap_js', 1); if ($loadBootstrapJs != '0' && $loadBootstrapJs != 0) { $assets[] = 'wr-frontend-contactform-bootstrap-js'; } if (!empty($checkLoadJS['date'])) { wp_enqueue_script('jquery-ui'); wp_enqueue_script('jquery-ui-datepicker'); $assets[] = 'wr-jquery-daterangepicker-js'; $assets[] = 'wr-jquery-timepicker-js'; } if (!empty($checkLoadJS['google-maps'])) { if ($scheme == 'https') { $assets[] = 'wr-https-googlemaps-api-js'; } else { $assets[] = 'wr-http-googlemaps-api-js'; } $assets[] = 'wr-googlemaps-ui-js'; $assets[] = 'wr-googlemaps-services-js'; $assets[] = 'wr-googlemaps-extensions-js'; } $getFilterAssets = apply_filters('wr_contactform_filter_frontend_load_assets', $assets, $checkLoadJS); if (!empty($getFilterAssets)) { $assets = $getFilterAssets; } $assets[] = 'wr-frontend-contactform-js'; } $assets[] = 'wr-bootstrap2-icomoon-css'; $assets[] = 'wr-bootstrap2-jsn-gui-css'; $assets[] = 'wr-frontend-contactform-css'; WR_CF_Init_Assets::load($assets); return $html; }
<?php require_once '../securimage.php'; $securimage = new Securimage(array('no_exit' => true)); $securimage->use_database = true; $securimage->database_driver = Securimage::SI_DRIVER_PGSQL; $securimage->database_host = 'localhost'; $securimage->database_user = '******'; $securimage->database_pass = '******'; $securimage->database_name = 'test'; $securimage->show();
/** * */ public function showImage() { chdir(ilSecurImageUtil::getDirectory()); $this->securimage->show(); }
/** * generate HTML Pages * * @param Object $formId Form Id * @param String $formName Form Name * @param String $formType Form Type * @param String $topContent Module Top content * @param String $bottomContent Module Bottom Content * @param String $showTitle State Show Title Form * @param String $showDes State Show Description Form * * @return string */ public static function generateHTMLPages($formId, $formName, $formType = "", $topContent = "", $bottomContent = "", $showTitle = false, $showDes = false) { $uri = JUri::getInstance(); $baseUrl = JURI::base(true); $html = ""; // Load language $lang = JFactory::getLanguage(); $lang->load('com_uniform'); $document = JFactory::getDocument(); /** load Css */ $loadBootstrap = self::getDataConfig('load_bootstrap_css'); $loadBootstrap = isset($loadBootstrap->value) ? $loadBootstrap->value : "0"; $stylesheets = array(); if (preg_match('/msie/i', $_SERVER['HTTP_USER_AGENT'])) { $document->addStyleSheet(JURI::root(true) . '/plugins/system/jsnframework/assets/3rd-party/jquery-ui/css/ui-bootstrap/jquery.ui.1.9.0.ie.css'); } if ($loadBootstrap == 1) { $document->addStyleSheet(JSN_UNIFORM_ASSETS_URI . '/3rd-party/bootstrap/css/bootstrap.min.css'); } $document->addStyleSheet(JURI::root(true) . '/plugins/system/jsnframework/assets/joomlashine/css/jsn-gui.css'); //$document->addStyleSheet(JURI::root(true) . '/plugins/system/jsnframework/assets/3rd-party/font-awesome/css/font-awesome.css'); $document->addStyleSheet(JURI::root(true) . '/plugins/system/jsnframework/assets/3rd-party/jquery-tipsy/tipsy.css'); $document->addStyleSheet(JSN_UNIFORM_ASSETS_URI . '/css/form.css'); /** end */ /* Get data form */ $db = JFactory::getDBO(); $db->setQuery($db->getQuery(true)->from('#__jsn_uniform_forms')->select('*')->where('form_state = 1 AND form_id=' . (int) $formId)); $items = $db->loadObject(); /* Get data page form */ $db->setQuery($db->getQuery(true)->from('#__jsn_uniform_form_pages')->select('*')->where('form_id=' . (int) $formId)->order("page_id ASC")); $formPages = $db->loadObjectList(); /* define language */ $arrayTranslated = array('JSN_UNIFORM_CHARACTERS', 'JSN_UNIFORM_WORDS', 'JSN_UNIFORM_CONFIRM_FIELD_PASSWORD_MIN_MAX_CHARACTER', 'JSN_UNIFORM_CONFIRM_FIELD_EMAIL_CONFIRM', 'JSN_UNIFORM_CONFIRM_FIELD_MIN_NUMBER', 'JSN_UNIFORM_CONFIRM_FIELD_MAX_NUMBER', 'JSN_UNIFORM_DATE_HOUR_TEXT', 'JSN_UNIFORM_DATE_MINUTE_TEXT', 'JSN_UNIFORM_DATE_CLOSE_TEXT', 'JSN_UNIFORM_DATE_PREV_TEXT', 'JSN_UNIFORM_DATE_NEXT_TEXT', 'JSN_UNIFORM_DATE_CURRENT_TEXT', 'JSN_UNIFORM_DATE_MONTH_JANUARY', 'JSN_UNIFORM_DATE_MONTH_FEBRUARY', 'JSN_UNIFORM_DATE_MONTH_MARCH', 'JSN_UNIFORM_DATE_MONTH_APRIL', 'JSN_UNIFORM_DATE_MONTH_MAY', 'JSN_UNIFORM_DATE_MONTH_JUNE', 'JSN_UNIFORM_DATE_MONTH_JULY', 'JSN_UNIFORM_DATE_MONTH_AUGUST', 'JSN_UNIFORM_DATE_MONTH_SEPTEMBER', 'JSN_UNIFORM_DATE_MONTH_OCTOBER', 'JSN_UNIFORM_DATE_MONTH_NOVEMBER', 'JSN_UNIFORM_DATE_MONTH_DECEMBER', 'JSN_UNIFORM_DATE_MONTH_JANUARY_SHORT', 'JSN_UNIFORM_DATE_MONTH_FEBRUARY_SHORT', 'JSN_UNIFORM_DATE_MONTH_MARCH_SHORT', 'JSN_UNIFORM_DATE_MONTH_APRIL_SHORT', 'JSN_UNIFORM_DATE_MONTH_MAY_SHORT', 'JSN_UNIFORM_DATE_MONTH_JUNE_SHORT', 'JSN_UNIFORM_DATE_MONTH_JULY_SHORT', 'JSN_UNIFORM_DATE_MONTH_AUGUST_SHORT', 'JSN_UNIFORM_DATE_MONTH_SEPTEMBER_SHORT', 'JSN_UNIFORM_DATE_MONTH_OCTOBER_SHORT', 'JSN_UNIFORM_DATE_MONTH_NOVEMBER_SHORT', 'JSN_UNIFORM_DATE_MONTH_DECEMBER_SHORT', 'JSN_UNIFORM_DATE_DAY_SUNDAY', 'JSN_UNIFORM_DATE_DAY_MONDAY', 'JSN_UNIFORM_DATE_DAY_TUESDAY', 'JSN_UNIFORM_DATE_DAY_WEDNESDAY', 'JSN_UNIFORM_DATE_DAY_THURSDAY', 'JSN_UNIFORM_DATE_DAY_FRIDAY', 'JSN_UNIFORM_DATE_DAY_SATURDAY', 'JSN_UNIFORM_DATE_DAY_SUNDAY_SHORT', 'JSN_UNIFORM_DATE_DAY_MONDAY_SHORT', 'JSN_UNIFORM_DATE_DAY_TUESDAY_SHORT', 'JSN_UNIFORM_DATE_DAY_WEDNESDAY_SHORT', 'JSN_UNIFORM_DATE_DAY_THURSDAY_SHORT', 'JSN_UNIFORM_DATE_DAY_FRIDAY_SHORT', 'JSN_UNIFORM_DATE_DAY_SATURDAY_SHORT', 'JSN_UNIFORM_DATE_DAY_SUNDAY_MIN', 'JSN_UNIFORM_DATE_DAY_MONDAY_MIN', 'JSN_UNIFORM_DATE_DAY_TUESDAY_MIN', 'JSN_UNIFORM_DATE_DAY_WEDNESDAY_MIN', 'JSN_UNIFORM_DATE_DAY_THURSDAY_MIN', 'JSN_UNIFORM_DATE_DAY_FRIDAY_MIN', 'JSN_UNIFORM_DATE_DAY_SATURDAY_MIN', 'JSN_UNIFORM_DATE_DAY_WEEK_HEADER', 'JSN_UNIFORM_CONFIRM_FIELD_MAX_LENGTH', 'JSN_UNIFORM_CONFIRM_FIELD_MIN_LENGTH', 'JSN_UNIFORM_CAPTCHA_PUBLICKEY', 'JSN_UNIFORM_BUTTON_BACK', 'JSN_UNIFORM_BUTTON_NEXT', 'JSN_UNIFORM_BUTTON_RESET', 'JSN_UNIFORM_BUTTON_SUBMIT', 'JSN_UNIFORM_CONFIRM_FIELD_CANNOT_EMPTY', 'JSN_UNIFORM_CONFIRM_FIELD_INVALID'); /* Check load JS */ $checkLoadJS = array(); $checkLoadJSTipsy = false; if ($items) { $formStyleCustom = new stdClass(); if (!empty($items->form_style)) { $formStyleCustom = json_decode($items->form_style); } $dataSumbission = ''; $classForm = !empty($formStyleCustom->layout) ? $formStyleCustom->layout : ''; $formTheme = !empty($formStyleCustom->theme) ? $formStyleCustom->theme : ''; $uri = JURI::getInstance(); $url = $uri->toString(array('scheme', 'host', 'port')) . JURI::root(true); if (!$formType) { if ($showTitle && !empty($items->form_title)) { $html .= "<h2 class='contentheading'>{$items->form_title}</h2>"; } if ($showDes && !empty($items->form_description)) { $des = str_replace("\n", "<br/>", $items->form_description); $html .= "<p>{$des}</p>"; } $document->addStyleSheet(JRoute::_('index.php?option=com_uniform&view=form&task=generateStylePages&form_id=' . $items->form_id)); $html .= "<div class=\"jsn-uniform jsn-master\" data-form-name='" . $formName . "' id='jsn_form_" . $items->form_id . "'><div class=\"jsn-bootstrap\">"; $html .= $topContent; $html .= "<form name='form_{$formName}' id='form_{$formName}' action=\"" . $url . '/index.php?option=com_uniform&view=form&task=form.save&form_id=' . $items->form_id . "\" method=\"post\" class=\"form-validate {$classForm} \" enctype=\"multipart/form-data\" >"; $html .= "<span class=\"hide jsn-language\" style=\"display:none;\" data-value='" . json_encode(JSNUniformHelper::getTranslated($arrayTranslated)) . "'></span>"; $html .= "<span class=\"hide jsn-base-url\" style=\"display:none;\" data-value=\"" . $url . "\"></span>"; $html .= "<div id=\"page-loading\" class=\"jsn-bgloading\"><i class=\"jsn-icon32 jsn-icon-loading\"></i></div>"; $html .= "<div class=\"jsn-row-container {$formTheme}\">"; } $html .= "<div class=\"message-uniform\"> </div>"; foreach ($formPages as $i => $contentForm) { $pageContainer = !empty($contentForm->page_container) && json_decode($contentForm->page_container) ? $contentForm->page_container : '[[{"columnName":"left","columnClass":"span12"}]]'; $formContent = isset($contentForm->page_content) ? json_decode($contentForm->page_content) : ""; $htmlForm = ""; if (!empty($formContent)) { foreach ($formContent as $content) { if (!empty($content->instruction)) { $checkLoadJSTipsy = true; } if (!empty($content->type)) { $checkLoadJS[$content->type] = $content->type; } } $htmlForm .= JSNFormGenerateHelper::generate($formContent, $dataSumbission, $pageContainer); } $html .= "<div data-value=\"{$contentForm->page_id}\" class=\"jsn-form-content hide\">{$htmlForm}"; if ($i + 1 == count($formPages)) { if (!empty($items->form_captcha) && $items->form_captcha == 1) { if ($uri->getScheme() == 'https') { $html .= "<script type=\"text/javascript\" src=\"https://www.google.com/recaptcha/api/js/recaptcha_ajax.js\"></script>"; } else { $html .= "<script type=\"text/javascript\" src=\"http://www.google.com/recaptcha/api/js/recaptcha_ajax.js\"></script>"; } $html .= "<div id=\"" . md5(date("Y-m-d H:i:s") . $i . $formName) . "\" publickey=\"" . JSN_UNIFORM_CAPTCHA_PUBLICKEY . "\" class=\"form-captcha control-group\"></div>"; } else { if (!empty($items->form_captcha) && $items->form_captcha == 2) { require_once JPATH_ROOT . '/components/com_uniform/libraries/3rd-party/securimage/securimage.php'; $img = new Securimage(); $img->case_sensitive = true; // true to use case sensitve codes - not recommended $img->image_bg_color = new Securimage_Color("#ffffff"); // image background color $img->text_color = new Securimage_Color("#000000"); // captcha text color $img->num_lines = 0; // how many lines to draw over the image $img->line_color = new Securimage_Color("#0000CC"); // color of lines over the image $img->namespace = $formName; $img->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255)); // random signature color ob_start(); $img->show(JPATH_ROOT . '/components/com_uniform/libraries/3rd-party/securimage/backgrounds/bg4.png'); $dataCaptcha = base64_encode(ob_get_clean()); $html .= '<div class="control-group"> <div class="controls"> <div class="row-fluid"><img src="data:image/png;base64,' . $dataCaptcha . '" alt="CAPTCHA" /></div> <input type="text" id="jsn-captcha" name="captcha" autocomplete="off" placeholder="' . JText::_("JSN_UNIFORM_CAPTCHA") . '"> </div> </div>'; } } } $html .= "</div>"; } $formSettings = !empty($items->form_settings) ? json_decode($items->form_settings) : ""; $btnNext = !empty($formSettings->form_btn_next_text) ? $formSettings->form_btn_next_text : "Next"; $btnPrev = !empty($formSettings->form_btn_prev_text) ? $formSettings->form_btn_prev_text : "Prev"; $btnSubmit = !empty($formSettings->form_btn_submit_text) ? $formSettings->form_btn_submit_text : "Submit"; $btnReset = !empty($formSettings->form_btn_reset_text) ? $formSettings->form_btn_reset_text : "Reset"; $btnNextStyle = !empty($formStyleCustom->button_next_color) ? $formStyleCustom->button_next_color : "btn btn-primary"; $btnPrevStyle = !empty($formStyleCustom->button_prev_color) ? $formStyleCustom->button_prev_color : "btn"; $btnSubmitStyle = !empty($formStyleCustom->button_submit_color) ? $formStyleCustom->button_submit_color : "btn btn-primary"; $btnResetStyle = !empty($formStyleCustom->button_reset_color) ? $formStyleCustom->button_reset_color : "btn"; $btnPosition = !empty($formStyleCustom->button_position) ? $formStyleCustom->button_position : "btn-toolbar"; $htmlBtnReset = ""; if (!empty($formSettings->form_state_btn_reset_text) && $formSettings->form_state_btn_reset_text == "Yes") { $htmlBtnReset = '<button class="' . $btnResetStyle . ' reset hide" onclick="return false;">' . JText::_($btnReset) . '</button>'; } $html .= '<div class="form-actions"> <div class="' . $btnPosition . '"> <button class="' . $btnPrevStyle . ' prev hide" onclick="return false;">' . JText::_($btnPrev) . '</button> <button class="' . $btnNextStyle . ' next hide" onclick="return false;">' . JText::_($btnNext) . '</button> ' . $htmlBtnReset . ' <button type="submit" class="' . $btnSubmitStyle . ' jsn-form-submit hide" >' . JText::_($btnSubmit) . '</button> </div> </div>'; $formId = isset($items->form_id) ? $items->form_id : ""; $postAction = isset($items->form_post_action) ? $items->form_post_action : ""; $postActionData = isset($items->form_post_action_data) ? $items->form_post_action_data : ""; $edition = defined('JSN_UNIFORM_EDITION') ? JSN_UNIFORM_EDITION : "free"; if (strtolower($edition) == "free") { $html .= "<div class=\"jsn-text-center\"><a href=\"http://www.joomlashine.com/joomla-extensions/jsn-uniform.html\" target=\"_blank\">" . JText::_('JSN_UNIFORM_POWERED_BY') . "</a> by <a href=\"http://www.joomlashine.com\" target=\"_blank\">JoomlaShine</a></div>"; } $html .= "<input type=\"hidden\" name=\"form_name\" value=\"{$formName}\" />"; if (!$formType) { $html .= "</div>"; $html .= "<input type=\"hidden\" name=\"task\" value=\"form.save\" />"; $html .= "<input type=\"hidden\" name=\"option\" value=\"com_uniform\" />"; $html .= "<input type=\"hidden\" name=\"form_id\" value=\"{$formId}\" />"; $html .= "<input type=\"hidden\" id=\"form_post_action\" name=\"form_post_action\" value=\"{$postAction}\" />"; $html .= "<input type=\"hidden\" name=\"form_post_action_data\" value='" . htmlentities($postActionData, ENT_QUOTES, "UTF-8") . "' />"; $html .= JHtml::_('form.token'); $html .= "</form>"; $html .= $bottomContent; $html .= "</div></div>"; } /* Load JS */ if (!empty($checkLoadJS['date'])) { $document->addStyleSheet(JURI::root(true) . '/plugins/system/jsnframework/assets/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.9.0.custom.css'); } $getHeadData = JFactory::getDocument()->getHeadData(); $checkLoadScript = true; $scripts = array(); foreach ($getHeadData['scripts'] as $script => $option) { if ($script == JSN_UNIFORM_ASSETS_URI . '/js/form.js') { if (!empty($checkLoadJS['google-maps']) && empty($getHeadData['scripts']['https://maps.google.com/maps/api/js?sensor=false&libraries=places'])) { if ($uri->getScheme() == 'https') { $scripts['https://maps.google.com/maps/api/js?sensor=false&libraries=places'] = $option; } else { $scripts['http://maps.google.com/maps/api/js?sensor=false&libraries=places'] = $option; } $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/googlemaps/jquery.ui.map.js'] = $option; $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/googlemaps/jquery.ui.map.services.js'] = $option; $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/googlemaps/jquery.ui.map.extensions.js'] = $option; } if (!empty($checkLoadJS['date']) && empty($getHeadData['scripts'][JSN_UNIFORM_ASSETS_URI . '/js/libs/jquery-ui-timepicker-addon.js'])) { $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/jquery-ui-1.10.3.custom.min.js'] = $option; $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/jquery-ui-timepicker-addon.js'] = $option; } if ($checkLoadJSTipsy && empty($getHeadData['scripts'][JURI::root(true) . '/plugins/system/jsnframework/assets/3rd-party/jquery-tipsy/jquery.tipsy.js'])) { $scripts[JURI::root(true) . '/plugins/system/jsnframework/assets/3rd-party/jquery-tipsy/jquery.tipsy.js'] = $option; } $scripts[$script] = $option; $checkLoadScript = false; } else { $scripts[$script] = $option; } if ($script == JSN_UNIFORM_ASSETS_URI . '/js/submissions.js' || $script == JSN_UNIFORM_ASSETS_URI . '/js/submission.js') { $scripts[JURI::root(true) . '/plugins/system/jsnframework/assets/3rd-party/jquery-scrollto/jquery.scrollTo.js'] = $option; $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/jquery.placeholder.js'] = $option; $scripts[JURI::root(true) . '/media/jui/js/bootstrap.min.js'] = $option; if (!empty($checkLoadJS['google-maps'])) { if ($uri->getScheme() == 'https') { $scripts['https://maps.google.com/maps/api/js?sensor=false&libraries=places'] = $option; } else { $scripts['http://maps.google.com/maps/api/js?sensor=false&libraries=places'] = $option; } $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/googlemaps/jquery.ui.map.js'] = $option; $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/googlemaps/jquery.ui.map.services.js'] = $option; $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/googlemaps/jquery.ui.map.extensions.js'] = $option; } if (!empty($checkLoadJS['date'])) { $scripts[JSN_UNIFORM_ASSETS_URI . '/js/libs/jquery-ui-timepicker-addon.js'] = $option; } $scripts[JSN_UNIFORM_ASSETS_URI . '/js/form.js'] = $option; $checkLoadScript = false; } } if ($checkLoadScript) { $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/jsn_uf_jquery_safe.js'); $document->addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/libs/jquery.placeholder.js'); $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/libs/json-2.3.min.js'); if ($checkLoadJSTipsy) { $document->addScript(JURI::root(true) . '/plugins/system/jsnframework/assets/3rd-party/jquery-tipsy/jquery.tipsy.js'); } $document->addScript(JURI::root(true) . '/plugins/system/jsnframework/assets/3rd-party/jquery-scrollto/jquery.scrollTo.js'); $document->addScript(JURI::root(true) . '/media/jui/js/bootstrap.min.js'); if (!empty($checkLoadJS['date'])) { $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/libs/jquery-ui-1.10.3.custom.min.js'); $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/libs/jquery-ui-timepicker-addon.js'); } if (!empty($checkLoadJS['google-maps'])) { if ($uri->getScheme() == 'https') { $document->addScript('https://maps.google.com/maps/api/js?sensor=false&libraries=places'); } else { $document->addScript('http://maps.google.com/maps/api/js?sensor=false&libraries=places'); } $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/libs/googlemaps/jquery.ui.map.js'); $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/libs/googlemaps/jquery.ui.map.services.js'); $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/libs/googlemaps/jquery.ui.map.extensions.js'); } $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/form.js'); $document->addScript(JSN_UNIFORM_ASSETS_URI . '/js/jsn_uf_conflict.js'); } else { if (!empty($scripts)) { $getHeadData['scripts'] = $scripts; JFactory::getDocument()->setHeadData($getHeadData); } } } return $html; }
$img = new Securimage(); // 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; // height in pixels of the image //$img->image_width = $img->image_height * M_E; // a good formula for image size based on the height //$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), // rand(128, 255)); // random signature color // see securimage.php for more options that can be set // set namespace if supplied to script via HTTP GET if (!empty($_GET['namespace'])) $img->setNamespace($_GET['namespace']); $img->image_signature = 'Bank of Muenchen'; $img->signature_color = new Securimage_Color('#0066FF'); $img->show(); // outputs the image and content headers to the browser // alternate use: // $img->show('/path/to/background_image.jpg');
} } else { if (isset($_GET['refresh'])) { $captcha = Securimage::getCaptchaId(true, $options); $data = array('captchaId' => $captcha); echo json_encode($data); exit; } else { if (isset($_GET['display'])) { // display the captcha with the supplied ID from the URL // construct options specifying the existing captcha ID // also tell securimage not to start a session $options['captchaId'] = $captchaId; $captcha = new Securimage($options); // show the image, this sends proper HTTP headers $captcha->show(); exit; } } } // generate a new captcha ID and challenge $captchaId = Securimage::getCaptchaId(true, $options); // output the captcha ID, and a form to validate it // the form submits to itself and is validated above ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Static Captcha Example</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
* 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 2012 Drew Phillips * @author Drew Phillips <*****@*****.**> * @version 3.2RC2 (April 2012) * @package Securimage * */ require_once '../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->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');
public function imageAction() { $require = dirname(dirname(__FILE__)) . "/Helper/Capcha/Securimage.php"; require $require; $hp = $this->_getHelper(); $img = new Securimage(); //Change some settings $img->image_width = $hp->getCapchaImageWidth(); $img->image_height = $hp->getCapchaImageHeight(); $img->perturbation = $hp->getCapchaPerturbation(); $img->code_length = $hp->getCapchaCodeLength(); $img->image_bg_color = new Securimage_Color("#ffffff"); // not set config $img->use_transparent_text = $hp->capchaUseTransparentText(); $img->text_transparency_percentage = $hp->getCapchaTextTransparencyPercentage(); // 100 = completely transparent $img->num_lines = $hp->getCapchaNumberLine(); $img->image_signature = ''; $img->text_color = new Securimage_Color("#000000"); $img->line_color = new Securimage_Color("#cccccc"); $backgroundFile = $hp->getCapchaBackgroundImage(); $img->show($backgroundFile); }