/** * @param string $caption Caption of the form element, default value is defined in captcha/language/ * @param string $name Name for the input box * @param boolean $skipmember Skip CAPTCHA check for members * @param int $numchar Number of characters in image mode, and input box size for text mode * @param int $minfontsize Minimum font-size of characters in image mode * @param int $maxfontsize Maximum font-size of characters in image mode * @param int $backgroundtype Background type in image mode: 0 - bar; 1 - circle; 2 - line; 3 - rectangle; 4 - ellipse; 5 - polygon; 100 - generated from files * @param int $backgroundnum Number of background images in image mode * */ public function __construct($caption = '', $name = 'icmscaptcha', $skipmember = null, $numchar = null, $minfontsize = null, $maxfontsize = null, $backgroundtype = null, $backgroundnum = null) { $this->_captchaHandler =& icms_form_elements_captcha_Object::instance(); $this->_captchaHandler->init($name, $skipmember, $numchar, $minfontsize, $maxfontsize, $backgroundtype, $backgroundnum); if (!$this->_captchaHandler->active) { $this->setHidden(); } else { $caption = !empty($caption) ? $caption : $this->_captchaHandler->getCaption(); $this->setCaption($caption); } }
public function __construct() { parent::__construct(); $this->_deprecated = icms_core_Debug::setDeprecated('icms_form_elements_captcha_Object', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); }
include 'mainfile.php'; // If not a user and invite needs one, redirect if ($icmsConfigUser['activation_type'] == 3 && $icmsConfigUser['allow_register'] == 0 && !is_object(icms::$user)) { redirect_header('index.php', 6, _US_INVITEBYMEMBER); exit; } $op = !isset($_POST['op']) ? 'invite' : $_POST['op']; $email = isset($_POST['email']) ? trim(icms_core_DataFilter::stripSlashesGPC($_POST['email'])) : ''; switch ($op) { case 'finish': include 'header.php'; $stop = ''; if (!icms::$security->check()) { $stop .= implode('<br />', icms::$security->getErrors()) . "<br />"; } $icmsCaptcha = icms_form_elements_captcha_Object::instance(); if (!$icmsCaptcha->verify()) { $stop .= $icmsCaptcha->getMessage() . '<br />'; } if (!checkEmail($email)) { $stop .= _US_INVALIDMAIL . '<br />'; } if (empty($stop)) { $invite_code = substr(md5(uniqid(mt_rand(), 1)), 0, 8); $sql = sprintf('INSERT INTO ' . icms::$xoopsDB->prefix('invites') . ' (invite_code, from_id, invite_to, invite_date, extra_info) VALUES (%s, %d, %s, %d, %s)', icms::$xoopsDB->quoteString(addslashes($invite_code)), is_object(icms::$user) ? icms::$user->getVar('uid') : 0, icms::$xoopsDB->quoteString(addslashes($email)), time(), icms::$xoopsDB->quoteString(addslashes(serialize(array())))); icms::$xoopsDB->query($sql); // if query executed successful if (icms::$xoopsDB->getAffectedRows() == 1) { $xoopsMailer = new icms_messaging_Handler();