aboutsummaryrefslogtreecommitdiff
path: root/public/login.php
blob: a8a10216caae5990344ba44992a156d37e4a496b (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
<!DOCTYPE html>
<?php include "../lib/login.php" ?>
<?php if_logged_in(true, "/") ?>
<?php
do {
	if ($_SERVER['REQUEST_METHOD'] !== 'POST') break;
	if (!$_POST['username']) break;
	if (!$_POST['password']) break;

	//TODO: check if user exists in database

	// if all guards passed, successful login occurred
	cookie_redir($_POST['username'], $_POST['password']);
} while (false);
?>
<html>
<head>
	<?php include 'head.php' ?>
	<title>login</title>
	<link rel='stylesheet' type='text/css' media='screen' href='login.css'>
</head>
<body>
	<?php include 'navbar.php' ?>
	<div class="main limwidth">
		<h1>Inloggen</h1>
		<div class="modal">
			<form action="/login.php" method="post">
				<label for="username">Gebruikersnaam</label>
				<input id="username" name="username" type="text" placeholder="gebruikersnaam" class="buttonstyle">
				<label for="password">Wachtwoord</label>
				<input id="password" name="password" type="password" placeholder="wachtwoord" class="buttonstyle">
				<input type="submit" value="Inloggen" class="button filled">
			</form>
			<span class="register">Of <a href="/register.php">een nieuw account maken</a></span>
		</div>
	</div>
	<?php include 'footer.php' ?>
</body>
</html>