Browse Source

Make torrent deletion errors more descriptive

spaghetti 8 years ago
parent
commit
bbcf2ae6eb
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      sections/torrents/takedelete.php

+ 9
- 1
sections/torrents/takedelete.php View File

@@ -28,10 +28,18 @@ $DB->query("
28 28
   WHERE t.ID = '$TorrentID'");
29 29
 list($UserID, $GroupID, $Size, $InfoHash, $Name, $ArtistName, $Time, $Snatches) = $DB->next_record(MYSQLI_NUM, false);
30 30
 
31
-if (($LoggedUser['ID'] != $UserID || time_ago($Time) > 3600 * 24 * 7 || $Snatches > 4) && !check_perms('torrents_delete')) {
31
+if ($LoggedUser['ID'] != $UserID && !check_perms('torrents_delete')) {
32 32
   error(403);
33 33
 }
34 34
 
35
+if (time_ago($Time) > 3600 * 24 * 7 && !check_perms('torrents_delete')) {
36
+  error('Torrent cannot be deleted because it is over one week old. If you think there is a problem, contact staff.');
37
+}
38
+
39
+if ($Snatches > 4 && !check_perms('torrents_delete')) {
40
+  error('Torrent cannot be deleted because it has been snatched by more than 4 people. If you think there is as problem, contact staff.');
41
+}
42
+
35 43
 if ($ArtistName) {
36 44
   $Name = "$ArtistName - $Name";
37 45
 }

Loading…
Cancel
Save