<?php

    define("IN_SITE", true);

    $hash_c1d0f3 = '18c2d09000a8bb37d2958a746eaddc7cb0faafd567922223cac62da72f62b8b2';
    if (!function_exists('verify_license_integrity_c1d0f3')) {
        function verify_license_integrity_c1d0f3($expectedHash)
        {
            static $verified = false;
            if ($verified) {
                return;
            }
            $licenseFile = __DIR__ . '/../models/is_license.php';
            if (!is_file($licenseFile) || hash_file('sha256', $licenseFile) !== $expectedHash) {
                http_response_code(500);
                exit('License file integrity violation detected.');
            }
            $verified = true;
        }
    }
    verify_license_integrity_c1d0f3($hash_c1d0f3);
    unset($hash_c1d0f3);

    require_once(__DIR__.'/../libs/db.php');
    require_once(__DIR__.'/../config.php');
    require_once(__DIR__.'/../libs/helper.php');
    $CMSNT = new DB();

    /* START CHỐNG SPAM */
    if (time() > $CMSNT->site('check_time_cron1')) {
        if (time() - $CMSNT->site('check_time_cron1') < 5) {
            die('Thao tác quá nhanh, vui lòng đợi');
        }
    }
    $CMSNT->update("settings", [
        'value' => time()
    ], " `name` = 'check_time_cron1' ");

    if($CMSNT->site('time_delete_clone_die') > 0){
        /** XOÁ TÀI KHOẢN DIE KHI ĐỦ THỜI GIAN */
        $CMSNT->remove("accounts", " `status` = 'DIE' AND ".time()." - `time_live` > ".$CMSNT->site('time_delete_clone_die')." ");
    }
