initial commit of file from CVS for smeserver-webshare on Sat Sep 7 21:15:27 AEST 2024
This commit is contained in:
45
root/etc/e-smith/events/actions/webshare-deluser
Executable file
45
root/etc/e-smith/events/actions/webshare-deluser
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/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)
|
Reference in New Issue
Block a user