<?php
require_once( __DIR__ . '/../my.php' );
require_once( __DIR__ . '/../secure/include/news_helpers.php' );
?>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= htmlspecialchars(t('ITSM SelfService')) ?></title>
<link href="include/login.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css">
</head>
<body class="login-page">
<?= news_render_banners( news_fetch_items( $con, 'login', 10 ) ) ?>
<div class="login-box">
  <h1><?= htmlspecialchars(t('ITSM SelfService')) ?></h1>
  <h2><?= htmlspecialchars(t('Inloggen')) ?></h2>
  <?php if (isset($_GET['expired'])): ?>
  <p class="error">Je sessie is verlopen. Log opnieuw in.</p>
  <?php endif; ?>
  <?php if (isset($_GET['incorrect'])): ?>
  <p class="error">E-mailadres of wachtwoord is incorrect.</p>
  <?php endif; ?>
  <?php if (isset($_GET['reset_done'])): ?>
  <p class="success">Je wachtwoord is gewijzigd. Je kunt nu inloggen.</p>
  <?php endif; ?>
  <form action="authenticate.php" method="post" class="login-form">
    <div class="input-group"> <i class="fas fa-user"></i>
      <input type="text" name="username" placeholder="<?= htmlspecialchars(t('E-mail')) ?>" required>
    </div>
    <div class="input-group"> <i class="fas fa-lock"></i>
      <input type="password" name="password" placeholder="<?= htmlspecialchars(t('Wachtwoord')) ?>" required>
    </div>
    <button type="submit" class="login-button"><?= htmlspecialchars(t('Login')) ?></button>
  </form>
  <p><a href="forgot_password.php" class="login-helper-link">Wachtwoord vergeten?</a></p>
</div>
<?php itsm_render_local_datetime_script(); ?>
</body>
</html>
