This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
prod_del.php
82 lines (70 loc) · 2.39 KB
/
prod_del.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
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
<?
require("include/top.php");
if ($SESSION_LEVEL=='administrator' || $SESSION_LEVEL=='moderator'):
if ($id && $action=='delete')
{
$query = "DELETE FROM prods WHERE id=$id LIMIT 1";
mysql_query($query);
$query = "DELETE FROM downloadlinks WHERE prod=$id";
mysql_query($query);
$query = "DELETE FROM comments WHERE which=$id";
mysql_query($query);
$query = "DELETE FROM nfos WHERE prod=$id";
mysql_query($query);
$query = "DELETE FROM screenshots WHERE prod=$id";
mysql_query($query);
$query = "DELETE FROM prods_platforms WHERE prod=$id";
mysql_query($query);
$query = "DELETE FROM sceneorgrecommended WHERE prodid=$id";
mysql_query($query);
$query = "DELETE FROM users_cdcs WHERE cdc=$id";
mysql_query($query);
$query = "DELETE FROM affiliatedprods WHERE original=$id or derivative=$id";
mysql_query($query);
$query = "DELETE FROM prods_refs WHERE prod=$id";
mysql_query($query);
$query = "DELETE FROM prodotherparty WHERE prod=$id";
mysql_query($query);
$query = "DELETE FROM cdc WHERE which=$id";
mysql_query($query);
if(file_exists("../nfo/$id.nfo"))
unlink("../nfo/$id.nfo");
if(file_exists("../screenshots/$id.gif"))
unlink("../screenshots/$id.gif");
if(file_exists("../screenshots/$id.jpg"))
unlink("../screenshots/$id.jpg");
if(file_exists("../screenshots/$id.png"))
unlink("../screenshots/$id.png");
print("prod $id deleted<br />\n");
logGloperatorAction("prod_del",$id);
}
?>
<p>DOUBLE CHECK THAT YOU'RE DELETING THE RIGHT PROD NUMBER BEFORE CLICKING!</p>
<p>THE LOBSTER WILL EAT YOUR CHILDREN IF YOU DONT!!</p>
<p>THIS IS THE ONE AND ONLY WARNING!!!</p>
<p>DOUBLE CHECK THE NUMBER!!!</p>
<form action="<?=basename($_SERVER['SCRIPT_FILENAME'])?>" method="post">
prod ID
<input type="text" name="id">
<input type="submit" name="action" value="delete">
</form>
<? else: ?>
<p>dude, that's a dangerous page...</p>
<form action="login.php" method="post">
<table cellspacing="1" cellpadding="2" class="box">
<tr bgcolor="#446688">
<td nowrap align="center">
<input type="text" name="login" value="SceneID" size="15" maxlength="16" onfocus="this.value=''">
<input type="password" name="password" value="password" size="15" onfocus="javascript:if(this.value=='password') this.value='';"><br />
</td>
</tr>
<tr>
<td bgcolor="#6688AA" align="right">
<input type="image" src="gfx/submit.gif">
</td>
</tr>
</table>
</form>
<? endif; ?>
<br />
<? require("include/bottom.php"); ?>