<?php
#-----------------------------------------------------#
#          ********* ROTORCMS *********               #
#              Made by  :  VANTUZ                     #
#               E-mail  :  visavi.net@mail.ru         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#        для его дальнейшего распространения          #
#-----------------------------------------------------#	
require_once "../includes/start.php";
require_once "../includes/functions.php";

if (isset($_SESSION['protect']) && $_SESSION['protect'] != "") {
    $pkod = str_split(intval($_SESSION['protect']));

    $img = imagecreate(50, 22);
    $bgcolor = imagecolorallocate($img, 255, 255, 255);
    $fon = imageColorTransparent($img, $bgcolor);
    imagefill($img, 0, 0, $fon);

    $color1 = imagecolorallocate($img, mt_rand(0, 204), mt_rand(0, 204), mt_rand(0, 204));
    $color2 = imagecolorallocate($img, mt_rand(0, 204), mt_rand(0, 204), mt_rand(0, 204));
    $color3 = imagecolorallocate($img, mt_rand(0, 204), mt_rand(0, 204), mt_rand(0, 204));
    $color4 = imagecolorallocate($img, mt_rand(0, 204), mt_rand(0, 204), mt_rand(0, 204));

    imageTTFtext($img, 16, 0, mt_rand(1, 2), mt_rand(17, 20), $color1, BASEDIR . "gallery/fonts/font2.ttf", $pkod[0]);
    imageTTFtext($img, 16, 0, mt_rand(13, 14), mt_rand(17, 20), $color2, BASEDIR . "gallery/fonts/font2.ttf", $pkod[1]);
    imageTTFtext($img, 16, 0, mt_rand(25, 26), mt_rand(17, 20), $color3, BASEDIR . "gallery/fonts/font2.ttf", $pkod[2]);
    imageTTFtext($img, 16, 0, mt_rand(37, 38), mt_rand(17, 20), $color4, BASEDIR . "gallery/fonts/font2.ttf", $pkod[3]);

    if ($config['protectdef'] == 1) {
        for ($i = 0; $i < 5; $i++) {
            $temp_color = imagecolorallocate ($img, mt_rand(155, 204), mt_rand(155, 204), mt_rand(155, 204));
            imageline($img, mt_rand(0, 50), mt_rand(0, 22), mt_rand(0, 50), mt_rand(0, 22), $temp_color);
        } 

        for ($i = 0; $i < 30; $i++) {
            $temp_color = imagecolorallocate ($img, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
            imagesetpixel ($img, mt_rand(0, 50), mt_rand(0, 22), $temp_color);
        } 
    } 

    Header("Content-type: image/gif");
    ImageGIF($img);
    ImageDestroy($img);
} 

?>