diff --git a/root/etc/e-smith/web/functions/expireaccounts b/root/etc/e-smith/web/functions/expireaccounts
index 93f6974..2561dae 100755
--- a/root/etc/e-smith/web/functions/expireaccounts
+++ b/root/etc/e-smith/web/functions/expireaccounts
@@ -71,7 +71,7 @@ __DATA__
+ options="get_delete_options()">
DESC_DELETE_AFTER_LOCK
@@ -93,7 +93,7 @@ __DATA__
+ options="get_delete_options()">
DESC_DELETE_AFTER_LOCK
diff --git a/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/expireaccounts.pm b/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/expireaccounts.pm
index 2e2a164..965233c 100644
--- a/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/expireaccounts.pm
+++ b/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/expireaccounts.pm
@@ -210,6 +210,22 @@ sub get_conf_bool{
return ($val =~ m/^yes|enabled|1|on$/) ? 'enabled' : 'disabled';
}
+sub get_delete_options{
+ my ($self) = @_;
+ my $options = [ qw(never 7 30 180 365) ];
+ my $acctName = $self->{cgi}->param('acctName');
+ if ($acctName =~ /^(\w[\-\w_\.]*)$/){
+ $acctName = $1;
+ my $acct = $a->get($acctName);
+ my $pass = $acct->prop('PasswordSet') || 'no';
+ my $locked = $acct->prop('ExpireLockedOn') || '';
+ if ($pass eq 'no' && $locked !~ m/^\d{4}\-\d{1,2}\-\d{1,2}$/){
+ $options = [ qw(never) ];
+ }
+ }
+ return $options;
+}
+
sub modify_config{
my ($self) = @_;
my $rec = $c->get('ExpireAccounts') || $c->new_record('ExpireAccounts', { type => 'service' });