Remove the ability for users to delete their own uploads after a day

This commit is contained in:
Hyleus
2018-01-26 12:03:15 +01:00
parent f09165477b
commit f91dd4eaef
+1 -1
View File
@@ -859,7 +859,7 @@ class TorrentController extends Controller
$user = Auth::user();
$torrent = Torrent::withAnyStatus()->findOrFail($id);
$message = Request::get('message');
if ($user->group->is_modo || $user->id == $torrent->user_id) {
if ($user->group->is_modo || ($user->id == $torrent->user_id && Carbon::now()->lt($torrent->created_at->addDay()))) {
Peer::where('torrent_id', '=', $id)->delete();
History::where('info_hash', '=', $torrent->info_hash)->delete();
Warning::where('id', '=', $id)->delete();