<?php
session_start();

if (!isset($_SESSION['mac'])) {
  exit('Cannot access this page directly');
}

include 'parameters.php';

require __DIR__ . '/vendor/autoload.php';

$post_url = $_SESSION["post"];

?>
<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <title>
      <?php echo htmlspecialchars($business_name); ?> Free WiFi
    </title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="stylesheet" href="bulma.min.css"/>
    <link rel="stylesheet" href="font-awesome\css\font-awesome.min.css"/>
    <script defer src="vendor\fortawesome\font-awesome\js\all.js"></script>
    <link rel="icon" type="image/png" href="favicomatic\favicon-32x32.png" sizes="32x32"/>
    <link rel="icon" type="image/png" href="favicomatic\favicon-16x16.png" sizes="16x16"/>
    <link rel="stylesheet" href="style.css"/>
</head>

<body>
<div class="page">
    <div class="head">
        <br>
        <figure id="logo" class="image">
            <img src="logo.png">
            <img src="logo2.png">
        </figure>
    </div>

    <div class="main">
        <seection class="section">
            <div class="content is-size-7 has-text-centered">
                Please wait, you are being connected
            </div>
        </seection>
    </div>

    <form id="form1" name="form1" method=POST action="https://<?php echo htmlspecialchars($post_url); ?>/cgi-bin/login">
        <input name=user value="user1" type="hidden">
        <input name=password value="pass1" type="hidden">
        <input name=cmd value="authenticate" type="hidden">
        <input name=session_timeout value="3600" type="hidden">
    </form>
</div>

<script type="text/javascript">
    window.onload = function () {
        document.form1.submit();
    };

</script>
</body>
</html>
