aboutsummaryrefslogtreecommitdiff
path: root/public/register.php
blob: 0ef7e18bb2bc94d67d359c4a044087fff530d91f (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!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: create new user in database

	// if all guards passed, successful login occurred
	cookie_redir($_POST['username'], $_POST['password'], "/");
} while (false);
?>
<html>
<head>
	<?php include 'head.php' ?>
	<title>registeren</title>
	<link rel='stylesheet' type='text/css' media='screen' href='login.css'>
	<link rel='stylesheet' type='text/css' media='screen' href='register.css'>
	<script defer src="register.js"></script>
</head>
<body>
	<?php include 'navbar.php' ?>
	<div class="main limwidth">
		<h1>Registreren</h1>
		<div class="modal">
			<form action="/register.php" method="post">
				<label for="username">Gebruikersnaam</label>
				<input id="username" name="username" type="text" placeholder="gebruikersnaam" class="buttonstyle" autocomplete="username" autofocus>
				<div class="check-popup check-username">
					<ul id="username-requirements" class="requirements">
						<li class="requirement len-3"><span class="inner">Minimaal 3 letters lang</span></li>
						<li class="requirement nosymbol"><span class="inner">Geen symbolen</span></li>
						<li class="requirement nospace"><span class="inner">Geen spaties</span></li>
					</ul>
				</div>
				<label for="username">E-mail adres</label>
				<input id="email" name="email" type="text" placeholder="e-mail" class="buttonstyle" autocomplete="email">
				<div class="check-popup check-email">
					<ul id="email-requirements" class="requirements">
						<li class="requirement valid"><span class="inner">Geldig e-mail adres</span></li>
					</ul>
				</div>
				<label for="password">Wachtwoord</label>
				<input id="password" name="password" type="password" placeholder="wachtwoord" class="buttonstyle" autocomplete="new-password">
				<div class="check-popup check-password">
					<ul id="password-requirements" class="requirements">
						<li class="requirement len-8"><span class="inner">Minimaal 8 tekens lang</span></li>
						<li class="requirement digit-2"><span class="inner">Minimaal 2 cijfers</span></li>
						<li class="requirement symbol-2"><span class="inner">Minimaal 2 symbolen</span></li>
						<li class="requirement has-uppercase"><span class="inner">Bevat hoofdletter(s)</span></li>
						<li class="requirement has-lowercase"><span class="inner">Bevat kleine letter(s)</span></li>
					</ul>
				</div>
				<input id="register-submit" type="submit" value="Registreren" class="button filled">
			</form>
			<span class="register">Of <a href="/login.php">inloggen</a></span>
		</div>
	</div>
	<?php include 'footer.php' ?>
</body>
</html>