Repository navigation
Expand file tree
/
Copy pathflushghosts.php
More file actions
91 lines (65 loc) · 2.24 KB
/
Copy pathflushghosts.php
File metadata and controls
91 lines (65 loc) · 2.24 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
**************************
** FreeTSP Version: 1.0 **
**************************
** http://www.freetsp.info
** https://github.com/Krypto/FreeTSP
** Licence Info: GPL
** Copyright (C) 2010 FreeTSP v1.0
** A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
** Project Leaders: Krypto, Fireknight.
**/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'functions'.DIRECTORY_SEPARATOR.'function_main.php');
require_once(FUNC_DIR.'function_user.php');
require_once(FUNC_DIR.'function_vfunctions.php');
db_connect();
logged_in();
$id = 0 + $_GET['id'];
$res = sql_query("SELECT id
FROM users
WHERE id = ".sqlesc($id)) or die();
$row = mysql_fetch_assoc($res) or error_message("error", "Error", "User was not found");
$userid = $row['id'];
if ($userid == $CURUSER['id'])
{
$res = sql_query("SELECT
COUNT(id)
FROM peers
WHERE userid = $userid") or sqlerr();
$ghost = mysql_fetch_row($res);
$ghostnumber = $ghost[0];
sql_query("DELETE
FROM peers
WHERE userid = $userid");
site_header();
begin_frame("Flushing Your Ghost Torrents");
display_message("success", "Success", "You have Flushed $ghostnumber Ghost torrents! Please Update ALL Torrents in your Client.");
header("Refresh: 0; url='userdetails.php?id=$id'");
end_frame();
site_footer();
}
elseif (get_user_class() >= UC_MODERATOR)
{
$res = sql_query("SELECT COUNT(id)
FROM peers
WHERE userid = $userid") or sqlerr();
$ghost = mysql_fetch_row($res);
$ghostnumber = $ghost[0];
sql_query("DELETE
FROM peers
WHERE userid = $userid");
site_header();
begin_frame("Flushing Your Ghost Torrents");
display_message("success", "Success", "You have Flushed $ghostnumber Ghost torrents! Please Update ALL Torrents in your Client.");
header("Refresh: 0; url='userdetails.php?id=$id'");
end_frame();
}
else
{
error_message("warn", "Sorry", "You Cant Flush Other Peoples Torrents!!");
header("Refresh: 0; url='userdetails.php?id=$id'");
end_frame();
}
site_footer();
?>