36 |
kaklik |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*************************************************************
|
|
|
4 |
* TorrentFlux - PHP Torrent Manager
|
|
|
5 |
* www.torrentflux.com
|
|
|
6 |
**************************************************************/
|
|
|
7 |
/*
|
|
|
8 |
This file is part of TorrentFlux.
|
|
|
9 |
|
|
|
10 |
TorrentFlux is free software; you can redistribute it and/or modify
|
|
|
11 |
it under the terms of the GNU General Public License as published by
|
|
|
12 |
the Free Software Foundation; either version 2 of the License, or
|
|
|
13 |
(at your option) any later version.
|
|
|
14 |
|
|
|
15 |
TorrentFlux is distributed in the hope that it will be useful,
|
|
|
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
18 |
GNU General Public License for more details.
|
|
|
19 |
|
|
|
20 |
You should have received a copy of the GNU General Public License
|
|
|
21 |
along with TorrentFlux; if not, write to the Free Software
|
|
|
22 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
include_once("config.php");
|
|
|
27 |
|
|
|
28 |
// Start Session and grab user
|
|
|
29 |
session_start("TorrentFlux");
|
|
|
30 |
$cfg["user"] = strtolower($_SESSION['user']);
|
|
|
31 |
|
|
|
32 |
// 2004-12-09 PFM
|
|
|
33 |
include_once('db.php');
|
|
|
34 |
|
|
|
35 |
// Create Connection.
|
|
|
36 |
$db = getdb();
|
|
|
37 |
|
|
|
38 |
logoutUser();
|
|
|
39 |
session_destroy();
|
|
|
40 |
header('location: login.php');
|
|
|
41 |
|
|
|
42 |
// Remove history for user so they are logged off from screen
|
|
|
43 |
function logoutUser()
|
|
|
44 |
{
|
|
|
45 |
global $cfg, $db;
|
|
|
46 |
|
|
|
47 |
$sql = "DELETE FROM tf_log WHERE user_id=".$db->qstr($cfg["user"])." and action=".$db->qstr($cfg["constants"]["hit"]);
|
|
|
48 |
|
|
|
49 |
// do the SQL
|
|
|
50 |
$result = $db->Execute($sql);
|
|
|
51 |
showError($db, $sql);
|
|
|
52 |
}
|
|
|
53 |
?>
|