-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
52 lines (41 loc) · 1.5 KB
/
signup.php
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
<?php
include_once "functions.php"
?>
<!DOCTYPE html>
<html>
<head>
<title>Inscription - M159 - LDAP</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="signup">
<form action="" method="post" autocomplete="off">
<h1>Créer un compte</h1><br><br>
<div class="signup__field">
<input class="signup__input" type="text" name="name" id="name" required />
<label class="signup__label" for="name">Prénom</label>
</div>
<div class="signup__field">
<input class="signup__input" type="text" name="lastname" id="lastname" required />
<label class="signup__label" for="lastname">Nom de famille</label>
</div>
<div class="signup__field">
<input class="signup__input" type="text" name="username" id="username" required />
<label class="signup__label" for="username">Nom d'utilisateur</label>
</div>
<div class="signup__field">
<input class="signup__input" type="password" name="password" id="password" required />
<label class="signup__label" for="password">Mot de passe</label>
</div>
<?php
if(array_key_exists('createUser', $_POST)){
$ldapConnection = setupConnection();
addUser($ldapConnection, $_POST['name'], $_POST['lastname'], $_POST['username'], $_POST['password']);
}
?>
<button class="createUser" type="submit" name="createUser" id="createUser" value="Créer un compte">Créer un compte</button>
</form>
<a class="login" href="login.php">ou se connecter</a>
</div>
</body>
</html>