HEX
Server: Apache/2.4.65 (Debian)
System: Linux srv39710 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
User: root (0)
PHP: 8.4.11
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Upload Files
File: /var/www/www-root/data/www/greeen.click/rkn.php
<?php

// === КОНФИГУРАЦИЯ ===
$zoneId = "8d9a98cc0fad0d16142f01a5aebdc431";       // Замените на ваш ID зоны
$email = "meglove627@gmail.com";        // Замените на ваш Email
$apiKey = "556d931ba0ea4a4e6d662c32e565ddc5186aa";       // Замените на ваш глобальный API ключ
$apiBase = "https://api.cloudflare.com/client/v4/zones/{$zoneId}/settings";

// Список параметров для отключения
$settings = [
    'ipv6',
];

// === ФУНКЦИЯ ОТПРАВКИ PATCH-ЗАПРОСА С ПОВТОРАМИ ===
function send_patch_request($setting, $email, $apiKey, $apiBase)
{
    $maxAttempts = 5;
    $delaySeconds = 1;
    $attempt = 1;

    while ($attempt <= $maxAttempts) {
        echo "⏳ Пытаюсь отключить '$setting' (попытка $attempt из $maxAttempts)...\n";

        $ch = curl_init();
        curl_setopt_array($ch, [
            CURLOPT_URL => "{$apiBase}/{$setting}",
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_CUSTOMREQUEST => "PATCH",
            CURLOPT_HTTPHEADER => [
                "X-Auth-Email: {$email}",
                "X-Auth-Key: {$apiKey}",
                "Content-Type: application/json"
            ],
            CURLOPT_POSTFIELDS => json_encode([
                "id" => $setting,
                "value" => "off"
            ])
        ]);

        $response = curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        $error = curl_error($ch);
        curl_close($ch);

        if ($error) {
            echo "⚠️ CURL ошибка: $error\n";
        }

        $decoded = json_decode($response, true);

        if ($decoded && isset($decoded['success']) && $decoded['success'] === true) {
            echo "✅ '$setting' успешно отключен.\n";
            return;
        } else {
            echo "❌ Ошибка при отключении '$setting'. Ответ сервера:\n";
            echo $response . "\n";
        }

        $attempt++;
        sleep($delaySeconds);
    }

    echo "❗ Не удалось отключить '$setting' после $maxAttempts попыток.\n";
}

// === ОСНОВНОЙ ЦИКЛ ===
foreach ($settings as $setting) {
    send_patch_request($setting, $email, $apiKey, $apiBase);
}
exit;
?>