summaryrefslogtreecommitdiff
path: root/read.pl
blob: fd4ad5061f3233b885cc43e35297714beb682f92 (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{REMOTE_USER});

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);