Example #1
0
 private function generateCaptcha()
 {
     require_once ONE_LIB_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'captcha.php';
     // Generate captcha
     $captcha = Text_CAPTCHA::factory('Image');
     $imageOptions = array('font_size' => !is_null($this->getCfg('font_size')) ? $this->getCfg('font_size') : 20, 'font_path' => !is_null($this->getCfg('font_path')) ? $this->getCfg('font_path') : ONE_LIB_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'Image', 'font_file' => !is_null($this->getCfg('font_file')) ? $this->getCfg('font_file') : 'arial.ttf', 'text_color' => !is_null($this->getCfg('text_color')) ? $this->getCfg('text_color') : '#66720F', 'lines_color' => !is_null($this->getCfg('lines_color')) ? $this->getCfg('lines_color') : '#66720F', 'background_color' => !is_null($this->getCfg('background_color')) ? $this->getCfg('background_color') : '#B9C84C');
     // Set CAPTCHA options
     $options = array('width' => !is_null($this->getCfg('width')) ? $this->getCfg('width') : 150, 'height' => !is_null($this->getCfg('height')) ? $this->getCfg('height') : 50, 'output' => !is_null($this->getCfg('output')) ? $this->getCfg('output') : 'png', 'imageOptions' => $imageOptions);
     // Generate a new Text_CAPTCHA object, Image driver
     $c = Text_CAPTCHA::factory('Image');
     $retval = $c->init($options);
     if (PEAR::isError($retval)) {
         printf('Error initializing CAPTCHA: %s!', $retval->getMessage());
         exit;
     }
     // Get CAPTCHA secret passphrase
     $session = One_Repository::getSession();
     $session->set('OnePhrase', $c->getPhrase(), 'OneCaptcha');
     // Get CAPTCHA image (as PNG)
     $png = $c->getCAPTCHA();
     if (PEAR::isError($png)) {
         printf('Error generating CAPTCHA: %s!', $png->getMessage());
         exit;
     }
     file_put_contents("tmp/" . md5(session_id()) . '.png', $png);
     $captcha = 'tmp/' . md5(session_id()) . '.png?' . time();
     return $captcha;
 }
 /**
  * Renders the captcha for widget.
  *
  * @param  string $name        The element name
  * @param  string $value       The this widget is checked if value is not null
  * @param  array  $attributes  An array of HTML attributes to be merged with the default HTML attributes
  * @param  array  $errors      An array of errors for the field
  *
  * @return string An HTML tag string
  */
 public function renderCaptcha($name, $value = null, $attributes = array(), $errors = array())
 {
     $captcha = Text_CAPTCHA::factory('Figlet');
     $captcha->init(array('output' => $this->getOption('output'), 'width' => $this->getOption('width'), 'length' => $this->getOption('length'), 'options' => array('font_file' => $this->getOption('font'))));
     sfContext::getInstance()->getStorage()->write('captcha/phrase', $captcha->getPhrase());
     return $this->renderContentTag('div', $captcha->getCAPTCHA(), array_merge($attributes, array('id' => $this->generateId($name) . '_captcha', 'class' => 'captcha')));
 }
 function make_CAPTCHA(&$tpl)
 {
     global $system;
     $CAPTCHA = Text_CAPTCHA::factory('Image');
     $retval = $CAPTCHA->init(200, 80, null, array('font_size' => 24, 'font_path' => './icon/', 'font_file' => 'verdana.TTF'));
     if (PEAR::isError($retval)) {
         $tpl->setParam("FormReg_msg", "Error generating CAPTCHA!");
         $tpl->setParam('FormReg_user', "");
         $tpl->setParam('FormReg_password', "");
         $tpl->setParam('FormReg_email', "");
         $tpl->setParam('FormReg_CAPTCHA', "");
         return false;
     }
     $png = $CAPTCHA->getCAPTCHAAsPNG();
     if (PEAR::isError($png)) {
         $tpl->setParam("FormReg_msg", 'Error generating CAPTCHA!');
         $tpl->setParam('FormReg_user', "");
         $tpl->setParam('FormReg_password', "");
         $tpl->setParam('FormReg_email', "");
         $tpl->setParam('FormReg_CAPTCHA', "");
         return false;
     }
     $_SESSION['phrase'] = $CAPTCHA->getPhrase();
     file_put_contents($system->_cache . "/sess_" . md5(session_id()) . ".png", $png);
     return true;
 }
 /**
  * Renders the captcha for widget.
  *
  * @param  string $name        The element name
  * @param  string $value       The this widget is checked if value is not null
  * @param  array  $attributes  An array of HTML attributes to be merged with the default HTML attributes
  * @param  array  $errors      An array of errors for the field
  *
  * @return string An HTML tag string
  */
 public function renderCaptcha($name, $value = null, $attributes = array(), $errors = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers('I18N');
     $captcha = Text_CAPTCHA::factory('Equation');
     $captcha->init(array('min' => $this->getOption('min'), 'max' => $this->getOption('max'), 'numbersToText' => $this->getOption('numbers_to_text'), 'severity' => $this->getOption('severity')));
     sfContext::getInstance()->getStorage()->write('captcha/phrase', $captcha->getPhrase());
     $template = str_replace('%%captcha%%', $captcha->getCAPTCHA(), __($this->getOption('template')));
     return $this->renderContentTag('label', $template, array_merge($attributes, array('for' => $this->generateId($name))));
 }
 public function testSetAdapter()
 {
     $tc = new HTML_QuickForm2_Element_Captcha_TextCAPTCHA();
     $tc->setSession(new HTML_QuickForm2_Element_Captcha_Session_Mock());
     $tca = Text_CAPTCHA::factory('Word');
     $tc->setAdapter($tca);
     $f = (string) $tc;
     $adapter = $tc->getAdapter();
     $this->assertNotNull($adapter);
     $this->assertSame($adapter, $tca);
 }
 public function captchaAction()
 {
     $session = new Zend_Session_Namespace('captcha');
     $phrase = null;
     if (isset($session->phrase) && strlen($session->phrase) > 0) {
         $phrase = $session->phrase;
     }
     $captcha = Text_CAPTCHA::factory('Image');
     $opts = array('font_size' => 20, 'font_path' => Zend_Registry::get('config')->paths->data, 'font_file' => 'VeraBd.ttf', 'text_color' => '#FFFF33', 'lines_color' => '#CCEEDD', 'background_color' => '#555555');
     $captcha->init(120, 60, $phrase, $opts);
     $session->phrase = $captcha->getPhrase();
     $this->_helper->viewRenderer->setNoRender();
     header('Content-type: image/png');
     echo $captcha->getCAPTCHAAsPng();
 }
 public function executeCaptcha(sfWebRequest $request)
 {
     $options = sfContext::getInstance()->getStorage()->read('captcha/options');
     $phrase = sfContext::getInstance()->getStorage()->read('captcha/phrase');
     $this->forward404If(sfPEARcaptchaUtil::getHash($options, $phrase) != $request->getParameter('hash'));
     if ($options === null) {
         $options = array();
     }
     $options['phrase'] = $phrase;
     $captcha = Text_CAPTCHA::factory('Image');
     $captcha->init($options);
     if ($options['output'] == 'resource') {
         $this->getResponse()->setContentType('image/png');
         imagepng($captcha->getCAPTCHA());
     } else {
         $this->getResponse()->setContentType('image/' . $options['output']);
         $this->getResponse()->setContent($captcha->getCAPTCHA());
     }
     return sfView::NONE;
 }
 /**
  * Load the adapter instance
  *
  * @return void
  * @throws HTML_QuickForm2_Element_Captcha_Exception When the Text_CAPTCHA
  *         adapter cannot be initialized correctly
  */
 protected function loadAdapter()
 {
     if (!$this->adapter) {
         if (!isset($this->data['captchaType'])) {
             throw new HTML_QuickForm2_Element_Captcha_Exception('data[captchaType] is not set');
         }
         $this->adapter = Text_CAPTCHA::factory($this->data['captchaType']);
         $captchaOptions = $this->data;
         unset($captchaOptions['captchaType']);
         $ret = $this->adapter->init($captchaOptions);
         if (PEAR::isError($ret)) {
             throw new HTML_QuickForm2_Element_Captcha_Exception($ret->message, $ret->code);
         }
     }
     $question = $this->adapter->getCAPTCHA();
     if (PEAR::isError($question)) {
         throw new HTML_QuickForm2_Element_Captcha_Exception($question->message, $question->code);
     }
     $this->getSession()->question = $question;
     $this->getSession()->answer = $this->adapter->getPhrase();
     return true;
 }
Example #9
0
 /**
  * execute実行
  *
  * @access  public
  */
 function execute()
 {
     require_once 'Text/CAPTCHA.php';
     // Set CAPTCHA image options (font must exist!)
     $imageOptions = array('font_size' => 15, 'font_path' => BASE_DIR . "/" . MAPLE_DIR . '/includes/font/', 'font_file' => 'Vrinda.ttf', 'text_color' => '#DDFF99', 'lines_color' => '#CCEEDD', 'background_color' => '#555555');
     // Set CAPTCHA options
     $options = array('width' => 70, 'height' => 20, 'output' => 'jpg', 'imageOptions' => $imageOptions);
     $c = Text_CAPTCHA::factory('Image');
     $retval = $c->init($options);
     if (PEAR::isError($retval)) {
         printf('Error initializing CAPTCHA: %s!', $retval->getMessage());
         exit;
     }
     // Get CAPTCHA secret passphrase
     $this->session->setParameter(array(_SESSION_IMAGE_AUTH . $this->id), $c->getPhrase());
     // Get CAPTCHA image (as Jpeg)
     $png = $c->getCAPTCHA();
     if (PEAR::isError($png)) {
         printf('Error generating CAPTCHA: %s!', $png->getMessage());
         exit;
     }
     header("Content-type:   image/jpeg");
     echo $png;
 }
Example #10
0
 }
 $form_comment->addElement('text', 'newscomment_name', $locale->get('field_comment_name'));
 $newscomment =& $form_comment->addElement('textarea', 'newscomment_message', $locale->get('field_comment_message'));
 $newscomment->setCols(35);
 $newscomment->setRows(10);
 //ha kell captcha, akkor kirakjuk
 if ($row_comments['captcha'] == 1) {
     require_once 'Text/CAPTCHA.php';
     $form_comment->addElement('text', 'newscomment_recaptcha', $locale->get('field_comment_captcha'), 'class="input_box"');
     $form_comment->addRule('newscomment_recaptcha', $locale->get('error_captcha'), 'required');
     if ($form_comment->isSubmitted() && $form_comment->getSubmitValue('newscomment_recaptcha') != $_SESSION['newscomment_phrase']) {
         $form_comment->setElementError('newscomment_recaptcha', $locale->get('error_compare_captcha'));
     }
     $captcha_options = array('font_size' => 14, 'font_path' => $libs_dir . '/', 'font_file' => 'arial.ttf');
     // Generate a new Text_CAPTCHA object, Image driver
     $nc_class = Text_CAPTCHA::factory('Image');
     $retval = $nc_class->init(250, 150, null, $captcha_options);
     // Get CAPTCHA secret passphrase
     $_SESSION['newscomment_phrase'] = $nc_class->getPhrase();
     // Get CAPTCHA image (as PNG)
     $newsc_png = $nc_class->getCAPTCHAAsPNG();
     if (!function_exists('file_put_contents')) {
         function file_put_contents($filename, $content)
         {
             if (!($file = fopen('files/' . $filename, 'w'))) {
                 return false;
             }
             $n = fwrite($file, $content);
             fclose($file);
             return $n ? $n : false;
         }
<?php

require_once 'Text/CAPTCHA.php';
$c = Text_CAPTCHA::factory("Numeral");
$c->init();
print 'Operation: ' . $c->getCAPTCHA();
print '<br />Solution: ' . $c->getPhrase();
 public function imageCaptcha($captchaBgColor, $captchaDir, $captchaHeight, $captchaLen, $captchaLinesColor, $captchaSize, $captchaTextColor, $captchaURL, $captchaWidth, &$url_fn)
 {
     require_once 'Image.php';
     $imgOptions = array('font_size' => $captchaSize, 'font_path' => dirname(__FILE__), 'font_file' => 'FreeSansBold.ttf', 'text_color' => $captchaTextColor, 'lines_color' => $captchaLinesColor, 'background_color' => $captchaBgColor);
     $options = array('width' => $captchaWidth, 'height' => $captchaHeight, 'output' => 'png', 'imageOptions' => $imgOptions);
     // Set CAPTCHA phrase length
     Text_CAPTCHA_Driver_Image::$_phraseLength = $this->_captchaLen;
     // Generate a new Text_CAPTCHA object, Image driver
     $c = Text_CAPTCHA::factory('Image');
     $retval = $c->init($options);
     if (PEAR::isError($retval)) {
         throw new Exception($this->_transLang['MOD_SIMPLEEMAILFORM_captcha_error_init'] . ' ' . $retval->getMessage());
     }
     // Get CAPTCHA image (as PNG)
     $png = $c->getCAPTCHAAsPNG();
     if (PEAR::isError($png)) {
         throw new Exception($this->_transLang['MOD_SIMPLEEMAILFORM_captcha_error_gen'] . ' ' . $png->getMessage());
     }
     $randval = time() . rand(1, 999);
     $fn = 'captcha_' . $this->_instance . '_' . md5($randval) . '.png';
     $put_fn = $captchaDir . DIRECTORY_SEPARATOR . $fn;
     // 2013-10-24 DB: added check for trailing '/'
     if (substr($captchaURL, -1, 1) === '/') {
         $url_fn = $captchaURL . $fn;
     } else {
         // 2013-10-24 DB: hard-coded the "/" into the URL
         $url_fn = $captchaURL . '/' . $fn;
     }
     JFile::write($put_fn, $png);
     return $c->getPhrase();
 }
 /**
  * Initializes the CAPTCHA instance (if needed)
  *
  * @return boolean TRUE or PEAR_Error on error
  * @access protected
  */
 function _initCAPTCHA()
 {
     $sessionVar = $this->_options['sessionVar'];
     if (empty($_SESSION[$sessionVar])) {
         $_SESSION[$sessionVar] =& Text_CAPTCHA::factory($this->_CAPTCHA_driver);
         if (PEAR::isError($_SESSION[$sessionVar])) {
             return $_SESSION[$sessionVar];
         }
         $result = $_SESSION[$sessionVar]->init($this->_options);
         if (PEAR::isError($result)) {
             return $result;
         }
     }
     return true;
 }
<?php

require_once 'Text/CAPTCHA.php';
$c = Text_CAPTCHA::factory("Word");
$c->init(array('length' => 4, 'locale' => 'de'));
echo $c->getCAPTCHA();
Example #15
0
 protected function _renderVarDisplay_captcha($form, &$var, &$vars)
 {
     static $captcha;
     if (!isset($captcha)) {
         $captcha = Text_CAPTCHA::factory('Image');
     }
     $image = $captcha->init(150, 60, $var->type->getText(), array('font_path' => dirname($var->type->getFont()) . '/', 'font_file' => basename($var->type->getFont())));
     if (is_a($image, 'PEAR_Error')) {
         return $image->getMessage();
     }
     $cid = md5($var->type->getText());
     $cache = $GLOBALS['injector']->getInstance('Horde_Cache');
     $cache->set($cid, serialize(array('data' => $captcha->getCAPTCHAAsJPEG(), 'ctype' => 'image/jpeg')));
     $url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/cacheview.php')->add('cid', $cid);
     return '<img src="' . $url . '" />';
 }
Example #16
0
global $argc, $argv;
$session = new midcom_services_session('midcom_helper_datamanager2_widget_captcha');
if (!isset($argv[0])) {
    throw new midcom_error_notfound("Missing CAPTCHA session key.");
}
if ($argc == 0 || !$session->exists($argv[0])) {
    throw new midcom_error('Failed to generate CAPTCHA, the session key passed is invalid.');
}
$passphrase = $session->get($argv[0]);
if (empty($passphrase)) {
    throw new midcom_error('Failed to generate CAPTCHA, no passphrase in session.');
}
// Set Captcha options (font must exist!)
$options = array('width' => 200, 'height' => 80, 'phrase' => $passphrase, 'imageOptions' => array('font_path' => MIDCOM_ROOT . '/midcom/helper/datamanager2/widget/', 'font_file' => 'captcha-font.ttf', 'background_color' => '#000000', 'text_color' => '#FFFFFF'));
/* Generate a new Text_CAPTCHA object, Image driver
 * This is working at least with Text_CAPTCHAS latest alpha version. Older versions
 * give missing font error
 */
$captcha = Text_CAPTCHA::factory('Image');
$result = $captcha->init($options);
if (PEAR::isError($result)) {
    throw new midcom_error('Failed to generate CAPTCHA, class init call failed: ' . $result->getMessage());
}
// Get Captcha GD Handle
$image = $captcha->getCAPTCHA();
if (!is_resource($image)) {
    throw new midcom_error('Failed to generate CAPTCHA, rendering failed. Reason: ' . $image->getMessage());
}
// Render the Captcha
_midcom_header('Content-Type: image/png');
imagepng($image);
<?php

require_once 'Text/CAPTCHA.php';
$c = Text_CAPTCHA::factory('Equation');
$ret = $c->init();
if (PEAR::isError($ret)) {
    echo $ret->getMessage();
    exit(1);
}
echo 'Equation: ' . $c->getCAPTCHA() . "<br />";
echo 'Solution: ' . $c->getPhrase() . "<br />";
$options = array('min' => 1, 'max' => 4, 'numbersToText' => true, 'severity' => 2);
$ret = $c->init($options);
if (PEAR::isError($ret)) {
    echo $ret->getMessage();
    exit(1);
}
echo 'Equation: ' . $c->getCAPTCHA() . "<br />";
echo 'Solution: ' . $c->getPhrase() . "<br />";
 function load()
 {
     if (!$this->checkAvailability()) {
         return;
     }
     // Call the parent class load method (includes necessary files)
     CaptchaLib::load();
     if (!isset($this->object)) {
         $this->object = Text_CAPTCHA::factory('Image');
     }
 }
 /**
  * Erstellen des Captcha und Rückgabe der verschlüsselten Zeichenfolge
  *
  * @return string
  */
 public function makeCaptcha()
 {
     // Set CAPTCHA options (font must exist!)
     $imageOptions = array('font_size' => 24, 'font_path' => './', 'font_file' => 'arial.ttf', 'text_color' => '#0D2FB4', 'lines_color' => '#FD4430', 'background_color' => '#DDDDDD');
     // Set CAPTCHA options
     $options = array('width' => 200, 'height' => 50, 'output' => 'png', 'imageOptions' => $imageOptions);
     // Generate a new Text_CAPTCHA object, Image driver
     $c = Text_CAPTCHA::factory('Image');
     $retval = $c->init($options);
     if (PEAR::isError($retval)) {
         printf('Error initializing CAPTCHA: %s!', $retval->getMessage());
         exit;
     }
     // Get CAPTCHA secret passphrase
     //$_SESSION['phrase'] = $c->getPhrase();
     $this->captcha = $c->getPhrase();
     // Get CAPTCHA image (as PNG)
     $png = $c->getCAPTCHAAsPNG();
     if (PEAR::isError($png)) {
         echo 'Error generating CAPTCHA!';
         echo $png->getMessage();
         exit;
     }
     file_put_contents(DIR_CAPTCHA . md5(session_id()) . '.png', $png);
     $this->reset();
     $this->setTable('session');
     $this->primaryCol = 'sid';
     $this->setWhere('sid = "' . SID . '"');
     if ($this->getCount() > 0) {
         $this->update(array('captcha' => $c->_phrase, 'time' => 'NOW()'));
     } else {
         $this->reset();
         $this->setTable('session');
         $this->primaryCol = 'sid';
         $this->add(array('sid' => SID, 'ip' => IP, 'captcha' => $c->_phrase, 'time' => 'NOW'));
     }
     return $c->_phrase;
 }
 /**
  * Renders the captcha for widget.
  *
  * @param  string $name        The element name
  * @param  string $value       The this widget is checked if value is not null
  * @param  array  $attributes  An array of HTML attributes to be merged with the default HTML attributes
  * @param  array  $errors      An array of errors for the field
  *
  * @return string An HTML tag string
  */
 public function renderCaptcha($name, $value = null, $attributes = array(), $errors = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers('Url');
     $fontPath = realpath($this->getOption('font_file'));
     if ($fontPath === false) {
         $fontPath = sfConfig::get('sf_data_dir') . '/font';
     }
     $options = array('width' => $this->getOption('width'), 'height' => $this->getOption('height'), 'output' => $this->getOption('output'), 'imageOptions' => array('font_size' => $this->getOption('font_size'), 'font_path' => $fontPath, 'font_file' => basename($this->getOption('font_file')), 'text_color' => $this->getOption('text_color'), 'lines_color' => $this->getOption('lines_color'), 'background_color' => $this->getOption('background_color'), 'antialias' => $this->getOption('antialias')));
     $captcha = Text_CAPTCHA::factory('Image');
     $captcha->init($options);
     @session_start();
     sfContext::getInstance()->getStorage()->write('captcha/options', $options);
     sfContext::getInstance()->getStorage()->write('captcha/phrase', $captcha->getPhrase());
     $imgAttributes = array_merge($attributes, array('id' => $this->generateId($name) . '_captcha', 'class' => 'captcha', 'src' => url_for('captcha_image', array('hash' => sfPEARcaptchaUtil::getHash($options, $captcha->getPhrase())))));
     return $this->renderTag('img', $imgAttributes);
 }
<?php

require_once 'Text/CAPTCHA.php';
// Set CAPTCHA image options
// font_file can either be an array or a string
// style is optional and specifies inline css to be used
$textOptions = array('font_file' => glob('*.flf'), 'style' => array('border' => '1px dashed red', 'color' => 'yellow', 'background' => 'black'));
// Set CAPTCHA options
// There is no way to set the 'height' property
// output options are 'javascript', 'html' or 'text' default is html
// default length is 6
$options = array('width' => 200, 'output' => 'javascript', 'length' => 8, 'options' => $textOptions);
// Generate a new Text_CAPTCHA object, Image driver
$c = Text_CAPTCHA::factory('Figlet');
$retval = $c->init($options);
if (PEAR::isError($retval)) {
    echo 'Error initializing CAPTCHA!';
    exit;
}
// Get CAPTCHA secret passphrase
$phrase = strtoupper($c->getPhrase());
$text = $c->getCAPTCHA();
if (PEAR::isError($text)) {
    echo $text->getMessage();
    echo 'Error generating CAPTCHA!';
    exit;
}
echo "<pre>{$text}</pre><br />";
echo "Solution: {$phrase}";
Example #22
0
        $ok = true;
        unset($_SESSION['phrase']);
    } else {
        $msg = 'Please try again!';
    }
    unlink(md5(session_id()) . '.png');
}
print "<p>{$msg}</p>";
if (!$ok) {
    require_once 'Text/CAPTCHA.php';
    // Set CAPTCHA image options (font must exist!)
    $imageOptions = array('font_size' => 24, 'font_path' => './', 'font_file' => 'COUR.TTF', 'text_color' => '#DDFF99', 'lines_color' => '#CCEEDD', 'background_color' => '#555555');
    // Set CAPTCHA options
    $options = array('width' => 200, 'height' => 80, 'output' => 'png', 'imageOptions' => $imageOptions);
    // Generate a new Text_CAPTCHA object, Image driver
    $c = Text_CAPTCHA::factory('Image');
    $retval = $c->init($options);
    if (PEAR::isError($retval)) {
        printf('Error initializing CAPTCHA: %s!', $retval->getMessage());
        exit;
    }
    // Get CAPTCHA secret passphrase
    $_SESSION['phrase'] = $c->getPhrase();
    // Get CAPTCHA image (as PNG)
    $png = $c->getCAPTCHA();
    if (PEAR::isError($png)) {
        printf('Error generating CAPTCHA: %s!', $png->getMessage());
        exit;
    }
    file_put_contents(md5(session_id()) . '.png', $png);
    echo '<form method="post">' . '<img src="' . md5(session_id()) . '.png?' . time() . '" />' . '<input type="text" name="phrase" />' . '<input type="submit" /></form>';
Example #23
0
 function createCaptcha($objPage)
 {
     $save_path = IMAGE_TEMP_REALDIR . $this->img_name;
     // PEARのパスを追加
     set_include_path(get_include_path() . PATH_SEPARATOR . PLUGIN_UPLOAD_REALDIR . "CAPTCHA");
     require_once "Text/CAPTCHA.php";
     $optins = array('width' => 200, 'height' => 60, 'output' => 'png', 'imageOptions' => array('font_size' => 20, 'font_path' => DATA_REALDIR . 'fonts', 'font_file' => 'wlmaru20044.ttf', 'text_color' => "#69af00", 'lines_color' => "#7acc00", 'background_color' => "#ededed"));
     $captcha = Text_CAPTCHA::factory('Image');
     $captcha->init($optins);
     if (PEAR::isError($captcha)) {
         printf('CAPTCHA 作成時にエラー: %s!', $captcha->getMessage());
         exit;
     }
     //画像を保存
     file_put_contents($save_path, $captcha->getCAPTCHAAsPNG());
     //画像文字列をセッションに格納
     $_SESSION['captcha_auth'] = $captcha->getPhrase();
     $objPage->captcha_img = IMAGE_TEMP_URLPATH . $this->img_name;
 }