-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogout_test.php
52 lines (44 loc) · 1.28 KB
/
logout_test.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('./classes/DB.php');
include('./classes/Login.php');
include('./classes/Logout.php');
if (!Login::isLoggedIn())
{
die("Not logged in.");
}
if (isset($_POST['confirm']))
{
if (isset($_POST['alldevices']))
{
session_start();
session_destroy();
}
else
{
if (isset($_COOKIE['BCNID'])){
DB::query('DELETE FROM tb_login_tokens WHERE logintoken=:logintoken', array(':logintoken'=>sha1($_COOKIE['BCNID'])));
}
setcookie('BCNID', '1', time()-42000);
setcookie('_BCNID', '1', time()-42000);
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>logout</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="main.js"></script>
</head>
<body>
<h1>Logout of your account</h1>
<p>Are you shure you what to logout?</p>
<form action="logout.php" method="post">
<input type="checkbox" name="alldevices" value="alldevices">Logout of all devices?<br />
<input type="submit" name="confirm" value="Confirm">
</form>
</body>
</html>