#!%PERL% -w


use strict;

use Data::Dumper;
use lib '%VHFFS_LIB_DIR%';
use Vhffs::Conf;
use Vhffs::User;
use Vhffs::Group;
use Vhffs::Main;
use Vhffs::Object;
use Vhffs::Services::Web;
use Vhffs::Acl;

my $princ = init Vhffs::Main;

die("Usage: $0 servername username\n") if(@ARGV != 2);

my ($servername, $username) = @ARGV;

my $user = Vhffs::User::get_by_username($princ, $username);
die("User $username not found\n") unless(defined $user);

my $httpd = Vhffs::Services::Web::get_by_servername($princ, $servername);
die("Webarea $servername not found\n") unless(defined $httpd);

die("Unable to delete ACL\n") unless(Vhffs::Acl::del_acl( $user , $httpd , $princ) > 0);
print "User $username has no longer access to webarea $servername\n";

