Add the bare minimum of what is required for the web interface to work (but be butt...
[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
11 my $entry = $itkaclcommon::cgi->param('entry');
12 my $entity = $itkaclcommon::cgi->param('entity');
13 my $entity_type = $itkaclcommon::cgi->param('entity_type');
14
15 $itkaclcommon::dbh->do('DELETE FROM aclentries WHERE object=? AND entity_type=? AND entity=?', undef,
16     $entry, $entity_type, $entity)
17         or die "Couldn't do deletion";
18
19 # Let sync-itkacl know there's updates
20 utime(time(), time(), '/etc/itkacl/updated');
21
22 print $itkaclcommon::cgi->redirect("view.pl?entry=$entry");
23