• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/captcha.php
  • Класс: CCaptcha
  • Вызов: CCaptcha::InitCodeCrypt
function InitCodeCrypt($codeCrypt, $password = "")
{
	if (!defined("CAPTCHA_COMPATIBILITY"))
		return CCaptcha::InitCaptchaCode($codeCrypt);

	if ($codeCrypt == '')
		return false;

	if (!BitrixMainApplication::getInstance()->getSession()->get("CAPTCHA_PASSWORD"))
		return false;

	$this->codeCrypt = $codeCrypt;
	$this->code = $this->CryptData($codeCrypt, "D", BitrixMainApplication::getInstance()->getSession()["CAPTCHA_PASSWORD"]);
	$this->codeLength = mb_strlen($this->code);

	return true;
}