-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogout.php
44 lines (39 loc) · 1.18 KB
/
logout.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
<?php
include_once('classes/DB.php');
include_once('classes/Login.php');
include_once('assets/templates/header.php');
include_once('assets/templates/navbar.php');
if (!Login::isLoggedin()) {
header("location:login.php");
die;
}
?>
<form class="login">
<h2>Logout</h2>
<div class="form-group">
<input type="checkbox" name="alldevices" id="alldevices" value="FALSE" /> <label for="alldevices">Logout From ALL Devices?</label>
</div>
<input type="submit" name="logout" class="btn btn-sn" value="Logout" />
</form>
<script type="text/javascript">
$(function () {
"use strict";
$('input[name=logout]').click(function () {
$(':checkbox:checked').val('TRUE');
$.ajax({
url: "api/?logout",
type: "POST",
data : {
alldevices: $('input[name=alldevices]').val()
},
success: function (r) {
location.reload();
},
error: function (r) {
console.log(r);
}
});
});
});
</script>
<?php include_once('assets/templates/footer.php'); ?>