smeserver-webshare/root/etc/e-smith/events/actions/webshare-deluser

46 lines
1.3 KiB
Plaintext
Raw Normal View History

#!/usr/bin/perl -w
use esmith::ConfigDB;
use Apache::Htpasswd;
my $db = esmith::ConfigDB->open_ro("WebShare");
my $projectName = $ARGV[0];
my $userName = $ARGV[1];
my $password = $ARGV[2];
#------------------------------------------------------------
# Delete the MultiAccessWebshare account
#------------------------------------------------------------
my $MultiAccessWebshare =
$db->get_prop( "MultiAccess", "WebShareName" || "undefined" );
my %MultiWebshares =
split( /,/, $db->get_prop( "MultiAccess", "WebShares" ) || "" );
if ( ( "$MultiAccessWebshare" eq "$projectName" )
&& ( "%MultiWebshares" ne "" ) )
{
my $foo =
new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$MultiAccessWebshare");
$foo->htDelete("$userName");
foreach my $MultiWebshares ( sort %MultiWebshares ) {
my $foo1 =
new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$MultiWebshares");
$foo1->htDelete("$userName");
}
}
else {
#------------------------------------------------------------
# Delete the webshare account
#------------------------------------------------------------
my $foo = new Apache::Htpasswd("/home/e-smith/db/webshare/htpasswd.$projectName");
$foo->htDelete("$userName");
}
exit(0)