summaryrefslogtreecommitdiff
path: root/intern.gospeladlershof.de/login.php
blob: 08352e4ccac24524990d7c3b892b2f631beb0d76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
define('LOGIN_SITE', true);
require_once __DIR__ . '/code/session.php';
$title="Login";
require_once __DIR__ . '/header.php';
?>
  <body>

    <div class="container">

      <form class="form-signin" method="POST" action="/code/login.php">

<?php
if ( ! empty($_SESSION) ) {
	if ( isset($_SESSION["login"]) && $_SESSION["login"]){
		header($_SERVER["SERVER_PROTOCOL"] . " 302 Redirect");
		header("Location: /");
		exit;
	}
	if ( !is_null($_SESSION["error"]) ) {
?>
<div class="alert alert-danger" role="alert">
<?php
	echo htmlentities($_SESSION["error"]);
?>
	<script>
		_paq.push(['trackEvent', 'Login', 'Failure', '<?php echo htmlentities($_SESSION["user"]);?>']);
	</script>
<?php
	unset($_SESSION["error"]);
?>
</div>
<?php
	}
}
?>
        <h2 class="form-signin-heading">Bitte melde dich an</h2>
        <label for="inputEmail" class="sr-only">E-Mail Adresse</label>
        <input name="email" type="email" id="inputEmail" class="form-control" placeholder="E-Mail-Adresse" required autofocus>
	<span class="help-block">Es wird dir eine E-Mail an dieselbe Adresse geschickt, mit der du auch die anderen E-Mails des Chors liest.</span> 
	<br>
        <button class="btn btn-lg btn-primary btn-block" type="submit" onclick="javascript:_paq.push(['trackEvent', 'Login', 'SendMail', $('#inputEmail').val()]);">Los geht's!</button>
      </form>

    </div> <!-- /container -->
<?php
require_once __DIR__ . '/footer.php';
?>