Example #1
0
    $cpt->SetLinesNumber($result["numLines"]);
    $cpt->SetLineColorRGB($result["arLineColor_1"], $result["arLineColor_2"]);
    $cpt->SetTextWriting($result["textAngel_1"], $result["textAngel_2"], $result["textStartX"], $result["textDistance_1"], $result["textDistance_2"], $result["textFontSize"]);
    $cpt->SetTextColorRGB($result["arTextColor_1"], $result["arTextColor_2"]);
    $cpt->SetWaveTransformation($result["bWaveTransformation"] === "Y");
    $cpt->SetEmptyText($result["bEmptyText"] === "Y");
    $cpt->SetBorderColorRGB($result["arBorderColor"]);
    $cpt->SetTTFFonts($result["arTTFFiles"]);
    $arChars = array();
    $l = strlen($result["letters"]);
    for ($i = 0; $i < $l; $i++) {
        $arChars[] = substr($result["letters"], $i, 1);
    }
    $cpt->SetCodeChars($arChars);
    $cpt->SetCode();
    if ($cpt->InitCode($cpt->GetSID())) {
        $cpt->Output();
    } else {
        $cpt->OutputError();
    }
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
    die;
}
$APPLICATION->SetTitle(GetMessage("MAIN_ADM_CAPTCHA_PAGE_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$CAPTCHA_CODE = htmlspecialcharsbx($APPLICATION->CaptchaGetCode());
$tabControl->Begin();
?>
<script>
<?php 
foreach ($arSettings as $key => $value) {
Example #2
0
if (!Defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$HTTP_ACCEPT_ENCODING = "";
$_SERVER["HTTP_ACCEPT_ENCODING"] = "";
include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/captcha.php";
$cpt = new CCaptcha();
$cpt->setImageSize(240, 80);
$cpt->SetBorderColor(array(255, 255, 255));
$cpt->SetEllipseColor(array("#5daac9"));
$cpt->SetEllipsesNumber(6);
$cpt->textStartX = 45;
$cpt->textFontSize = 50;
if (isset($_GET["captcha_sid"])) {
    if ($cpt->InitCode($_GET["captcha_sid"])) {
        $cpt->Output();
    } else {
        $cpt->OutputError();
    }
} elseif (isset($_GET["captcha_code"])) {
    $captchaPass = COption::GetOptionString("main", "captcha_password", "");
    if ($cpt->InitCodeCrypt($_GET["captcha_code"], $captchaPass)) {
        $cpt->Output();
    } else {
        $cpt->OutputError();
    }
} else {
    $cpt->OutputError();
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";