|
|
|
@ -15,21 +15,21 @@ if (defined $domain){ |
|
|
|
|
@domains = $d->get($domain); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
@doains = ($d->domains); |
|
|
|
|
@domains = ($d->domains); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach my $dom (@domains){ |
|
|
|
|
my $name = $dom->key; |
|
|
|
|
if (($event eq 'domain-delete') ){ |
|
|
|
|
rmtree "/home/e-smith/files/stats/$domain"; |
|
|
|
|
rmtree "/home/e-smith/files/stats/$name"; |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
my $stats = $dom->prop('Stats') || 'disabled'; |
|
|
|
|
if (($stats eq 'enabled') && (!-d "/home/e-smith/files/stats/$domain")){ |
|
|
|
|
mkdir "/home/e-smith/files/stats/$domain", 0755; |
|
|
|
|
if (($stats eq 'enabled') && (!-d "/home/e-smith/files/stats/$name")){ |
|
|
|
|
mkdir "/home/e-smith/files/stats/$name", 0755; |
|
|
|
|
} |
|
|
|
|
elsif (($stats ne 'enabled') && (-d "/home/e-smith/files/stats/$domain")){ |
|
|
|
|
rmtree "/home/e-smith/files/stats/$domain"; |
|
|
|
|
elsif (($stats ne 'enabled') && (-d "/home/e-smith/files/stats/$name")){ |
|
|
|
|
rmtree "/home/e-smith/files/stats/$name"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|