blob: 3cc30ecd91760316b4d969c1f5e247e405b15117 (
plain) (
blame)
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
|
package nzbget::read;
use strict;
use Apache2::Const -compile => qw(OK REDIRECT);
use CGI qw(:standard);
use CGI::Carp 'fatalsToBrowser';
use utf8;
use local::db;
use local::user;
use config;
sub handler
{
my $user = new local::user(%ENV);
my $dl = local::db::download->retrieve(param('id')) or die "Ungültige download id";
if (not local::db::seen->search(user=>$user->get_id,download=>$dl->download_id))
{
local::db::seen->insert({user=>$user->get_id,download=>$dl->download_id});
}
print CGI::redirect($config::config{web_dir}.'/'.$dl->category->name.'/'.$dl->download_id);
return Apache2::Const::REDIRECT;
}
1;
|