-
Notifications
You must be signed in to change notification settings - Fork 0
/
logout.php
36 lines (24 loc) · 867 Bytes
/
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
<?php
// Start session
session_start();
require('include/config.inc.php');
if ($config->error_handler == 'enabled') {
include('$config->error_handler_path');
}
include($config->path_root. '/include/accesscontrol.inc.php');
if(isset($_COOKIE['amxbans'])) {
$res = mysql_query('UPDATE `' .$config->webadmins. '` SET `user_logcode` = "" WHERE `user_nick` = "' .$uid. '"');
setcookie('amxbans', 'clearing', time()-60*60*24*7, $config->document_root. '/', $_SERVER['SERVER_NAME']);
}
unset($_SESSION['uid']);
unset($_SESSION['pwd']);
unset($_SESSION['uip']);
unset($_SESSION['lvl']);
session_destroy();
// This dont seem to work on some systems.. use the javascript below instead
//header("Location: $config->document_root");
$ref = $_GET['ref'];
?>
<script type="text/javascript" language="javascript">
window.location.href = document.referrer;
</script>