forked from malnuxstarck/Sitedusavoir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeconnexion.php
40 lines (26 loc) · 955 Bytes
/
deconnexion.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
<?php
include './includes/session.php';
include './includes/identifiants.php';
include_once './includes/debut.php';
include_once('./includes/menu.php');
session_destroy();
unset($_SESSION['flash']);
unset($_COOKIE['souvenir']);
setcookie('souvenir',NULL,time()-1);
$ip = ip2long($_SERVER['REMOTE_ADDR']);
$memberDatas = array("online_id" => $id , "online_ip" => $ip);
$memberOnline = new WhoIsOnline($memberDatas);
$managerWhoIsOnline = new ManagerWhoIsOnline($bdd);
$managerWhoIsOnline->deleteMembreOnline($id);
$managerMembre = new ManagerMembre($bdd);
$managerMembre->oublieMoi($id);
if ($id == 0)
{
$_SESSION['flash']['danger'] = 'Vous devez etre connecté pour vous déconnecter.';
header('Location:connexion.php');
}
else
{
$_SESSION['flash']['success'] = 'Vous êtes à présent déconnecté.';
header('Location:connexion.php');
}