]> git.sesse.net Git - itkacl/blob - itkacl-web-1.0/web/delete.pl
Release a new version of the Apache module, with the context support.
[itkacl] / itkacl-web-1.0 / web / delete.pl
1 #! /usr/bin/perl -T
2 use strict;
3 use warnings;
4 use utf8;
5
6 use lib '../include';
7 use itkaclcommon;
8
9 itkaclcommon::init();
10 itkaclcommon::check_csrf_token();
11
12 my $entry = $itkaclcommon::cgi->param('entry');
13 my $entity = $itkaclcommon::cgi->param('entity');
14 my $entity_type = $itkaclcommon::cgi->param('entity_type');
15
16 $itkaclcommon::dbh->do('DELETE FROM aclentries WHERE object=? AND entity_type=? AND entity=?', undef,
17     $entry, $entity_type, $entity)
18         or die "Couldn't do deletion";
19
20 # Let sync-itkacl know there's updates
21 utime(time(), time(), '/etc/itkacl/updated');
22
23 print $itkaclcommon::cgi->redirect("view.pl?entry=$entry");
24