summaryrefslogtreecommitdiff
path: root/read.pl
diff options
context:
space:
mode:
Diffstat (limited to 'read.pl')
-rwxr-xr-xread.pl17
1 files changed, 17 insertions, 0 deletions
diff --git a/read.pl b/read.pl
new file mode 100755
index 0000000..882c9bc
--- /dev/null
+++ b/read.pl
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+use strict;
+use CGI qw(:standard);
+use CGI::Carp 'fatalsToBrowser';
+use utf8;
+use local::db;
+use local::user;
+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('/'.$dl->category->name.'/'.$dl->download_id);