-
Notifications
You must be signed in to change notification settings - Fork 0
/
logout.php
37 lines (31 loc) · 977 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
37
<?php
/* Developed by Kernel Team.
http://kernel-team.com
*/
require_once("admin/include/setup.php");
session_start();
if ($_SESSION['user_id'] > 0)
{
$website_ui_data = @unserialize(file_get_contents("$config[project_path]/admin/data/system/website_ui_params.dat"));
if ($website_ui_data['ENABLE_USER_ONLINE_STATUS_REFRESH'] == 1)
{
require_once("admin/include/functions_base.php");
sql_pr("update $config[tables_prefix]users set last_online_date=? where user_id=?", date("Y-m-d H:i:s"), $_SESSION['user_id']);
}
}
$domain = str_replace("www.", "", $_SERVER['HTTP_HOST']);
setcookie("kt_member", '', time() - 86400, "/", ".$domain");
foreach ($_SESSION as $key => $value)
{
if ($key != 'userdata' && $key != 'save' && $key != 'runtime_params' && $key != 'lock_ips')
{
unset($_SESSION[$key]);
}
}
if (isset($_REQUEST["redirect_to"]))
{
header("Location: $config[project_url]$_REQUEST[redirect_to]");
} else
{
header("Location: $config[project_url]");
}