public function captcha() { $this->load->library('captcha'); $captcha = new Captcha(); $this->session->data['captcha'] = $captcha->getCode(); $captcha->showImage(); }
public function main() { //init controller data $this->extensions->hk_InitData($this, __FUNCTION__); $this->load->library('captcha'); $captcha = new Captcha(); $this->session->data['captcha'] = $captcha->getCode(); $captcha->showImage(); //init controller data $this->extensions->hk_UpdateData($this, __FUNCTION__); }
public function captcha() { $this->load->library('captcha'); $font = $this->config->get('config_captcha_font'); $captcha = new Captcha(); $this->session->data['captcha'] = $captcha->getCode(); $captcha->showImage($font); }
public function captcham5() { $this->load->library('captcham5'); $this->language->load('record/record'); $this->data['entry_captcha'] = $this->language->get('entry_captcha'); $this->data['entry_captcha_title'] = $this->language->get('entry_captcha_title'); $this->data['entry_captcha_update'] = $this->language->get('entry_captcha_update'); if ($this->customer->isLogged()) { $this->data['captcha_status'] = false; } else { $this->data['captcha_status'] = true; $captcha = new Captcha(); if (!isset($this->session->data['captcha'])) { $this->session->data['captcha'] = ''; } $captcha->setCode($this->session->data['captcha']); $this->data['captcha_keys'] = ""; for ($i = 0; $i < strlen($this->session->data['captcha']); $i++) { $k = rand(0, 1); $pos = strpos($this->data['captcha_keys'], $this->session->data['captcha'][$i]); if ($pos === false) { if ($k == 1) { $this->data['captcha_keys'] = $this->data['captcha_keys'] . $this->session->data['captcha'][$i]; } else { $this->data['captcha_keys'] = $this->session->data['captcha'][$i] . $this->data['captcha_keys']; } } } } $this->data['theme'] = $this->config->get('config_template'); $captcha->showImage(); }
<?php include_once 'headers.php'; include_once 'common.php'; include_once 'libraries/captcha/class.captcha.php'; $captcha = new Captcha(); $pathToCaptchaFonts = dirname(__FILE__) . '/fonts/'; $captchaColors = unserialize(CAPTCHA_COLORS); $captcha->charsNumber = CAPTCHA_CHARS_NUMBER; $captcha->stringType = CAPTCHA_STRING_TYPE; $captcha->fontSize = CAPTCHA_FONT_SIZE; $captcha->textColor = $captchaColors['text']; $captcha->backgroundColor = $captchaColors['background']; $captcha->ttFont = $pathToCaptchaFonts . CAPTCHA_TT_FONT . '.ttf'; $captcha->showImage(CAPTCHA_IMAGE_WIDTH, CAPTCHA_IMAGE_HEIGHT);
public function captcha() { if (!isset($this->request->get['key']) || !($form_info = id::decode($this->request->get['key']))) { return; } if (isset($this->request->get['a']) && $this->request->get['a'] == 'reload') { $json = array('url' => str_replace('&', '&', $this->url->link('module/quick_order_pro/captcha', 'key=' . $this->request->get['key'] . '&r=' . uniqid()))); $this->response->setOutput(json_encode($json)); } else { $setting = $this->getSetting(); $captcha = new Captcha($setting['captcha_alphabet'], (int) $setting['captcha_count_items']); $captcha->line_color = explode(',', $setting['color_line']); $captcha->text_color = explode(',', $setting['captcha_color']); $captcha->showLine = (int) $setting['show_lines']; if ($form_info['position'] == 0) { // content $captcha->width = 110; $captcha->height = 40; } if (!array_key_exists('quick_order_pro_captcha', $this->session->data)) { $this->session->data['quick_order_pro_captcha'] = array(); } $this->session->data['quick_order_pro_captcha'][$this->request->get['key']] = $captcha->getCode(); $captcha->showImage(); } }