summaryrefslogtreecommitdiff
path: root/read.pl
blob: 45a428c322405090c64d0c09dc06eb7bb55460f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl
use strict;
use CGI qw(:standard);
use CGI::Carp 'fatalsToBrowser';
use utf8;
use local::db;
use local::user;
use config;
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);