|
|
@ -30,11 +30,12 @@ my $smb = $c->get('smb') || die "Can't find the smb service in the ConfigDB\n"; |
|
|
|
my $recycle = $smb->prop('RecycleBin') || 'disabled'; |
|
|
|
my $recycle = $smb->prop('RecycleBin') || 'disabled'; |
|
|
|
our $retention = $smb->prop('RecycleBinRetention') || 'unlimited'; |
|
|
|
our $retention = $smb->prop('RecycleBinRetention') || 'unlimited'; |
|
|
|
$retention = 'unlimited' unless ($retention =~ m/^\d+$/); |
|
|
|
$retention = 'unlimited' unless ($retention =~ m/^\d+$/); |
|
|
|
# Convert retention in seconds |
|
|
|
|
|
|
|
$retention = 60*60*24*$retention; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exit(0) if (($recycle ne 'enabled') || ($retention eq 'unlimited')); |
|
|
|
exit(0) if (($recycle ne 'enabled') || ($retention eq 'unlimited')); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Convert retention in seconds |
|
|
|
|
|
|
|
$retention = 60*60*24*$retention; |
|
|
|
|
|
|
|
|
|
|
|
foreach my $user ($a->get_all_by_prop(type=>'user')){ |
|
|
|
foreach my $user ($a->get_all_by_prop(type=>'user')){ |
|
|
|
my $key = $user->key; |
|
|
|
my $key = $user->key; |
|
|
|
# Skip the user if RecycleBin doesn't exists |
|
|
|
# Skip the user if RecycleBin doesn't exists |
|
|
|