summaryrefslogtreecommitdiff
path: root/remove.pl
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@wirdorange.org>2011-01-15 20:12:15 +0000
committerOthmar Gsenger <otti@wirdorange.org>2011-01-15 20:12:15 +0000
commit14722a2e4de3cbc1e2c99b2a736c7facd2c37169 (patch)
tree89358010d8ea993ed8876e06b89cd251d0763acc /remove.pl
parentadded db structure (diff)
added config, fixed nobr issiue on lenny
Diffstat (limited to 'remove.pl')
-rwxr-xr-xremove.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/remove.pl b/remove.pl
index 25f2a82..1b369bb 100755
--- a/remove.pl
+++ b/remove.pl
@@ -6,13 +6,16 @@ use CGI::Carp 'fatalsToBrowser';
use local::db;
use local::user;
use File::Path qw(remove_tree);
+use $config;
my $user = new local::user($ENV{REMOTE_USER});
my $del_id = param('id');
my ($dl) = local::db::download->retrieve($del_id) or die 'Error in cancel';
die "Not allowed" if not $dl->owner->owner_id() eq $user->get_id();
-remove_tree('/srv/nzbget/done/'.$dl->category->name.'/'.$dl->download_id);
+
+my $basedir = $config::config{files_dir} or die 'Missing files_dir in config';
+remove_tree($basedir.'/'.$dl->category->name.'/'.$dl->download_id);
$user->obj->quota_used($user->obj->quota_used - $dl->size);
$user->obj->update;
my @seens = local::db::seen->search(download=>$del_id);