-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
53 lines (42 loc) · 1.3 KB
/
login.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
53
<?php
include_once $_SERVER['DOCUMENT_ROOT'].'/assets/config/functions.inc.php';
session_start();
$outil = new Outils;
$isConnected = $outil->isConnected();
if($isConnected) {
$outil->redirectUrl("/");
}
if(isset($_POST['connexion'])) {
$connexion = new User(
[
'EmailUser' => $_POST['email'],
'PasswordUser' => $_POST['password']
]
);
$manager = new UserManager($db);
$manager->login($connexion);
}
?>
<!DOCTYPE html>
<html lang="<?= $defaultLanguage; ?>">
<head>
<?php include_once($headerMeta); ?>
<?php include_once($headerLink); ?>
<link rel="canonical" href="https://getbootstrap.com/docs/5.3/examples/sign-in/">
<!-- Custom styles for this template -->
<link href="assets/css/sign-in.css" rel="stylesheet">
<title>Connexion</title>
</head>
<body class="text-center">
<main class='form-signin w-100 m-auto'>
<?= $outil->generateForm([
['connexion', 'Connexion'],
['email', 'email', 'Adresse email'],
['password', 'password', 'Mot de passe']
]); ?>
<a href="#">Mot de passe oublié ?</a>
<br>
<a href="/register.php">Vous n'avez pas encore de compte ? Inscrivez vous !</a>
</main>
</body>
</html>