1 package App::EzPz::User;
3 use Module::Runtime qw(use_module);
6 has _htpasswd_user => (
7 is => 'ro', init_arg => 'htpasswd_user', required => 1,
8 handles => [ qw(username password check_password) ],
11 has ezmlm_bindir => (is => 'rwp');
13 around BUILDARGS => sub {
14 my ($orig, $self) = (shift, shift);
15 my $args = $self->$orig(@_);
16 $args->{htpasswd_user} ||=
17 use_module('Authen::Htpasswd::User')->new(
18 delete @{$args}{qw(username password)}
25 if (my $unsplit = ($self->_htpasswd_user->extra_info||[])->[0]) {
26 return split /\s*,\s*/, $unsplit;
33 my ($self, @names) = @_;
34 my @extra = @{$self->_htpasswd_user->extra_info||[]};
35 $extra[0] = join(', ', @names);
36 $self->_htpasswd_user->extra_info(@extra);
41 my ($self, $name) = @_;
42 my %names; @names{my @names = $self->list_names} = ();
43 $self->set_list_names(@names, $name) unless exists $names{$name};
47 sub remove_list_name {
48 my ($self, $name) = @_;
49 my %names; @names{my @names = $self->list_names} = ();
50 if (exists $names{$name}) {
51 $self->set_list_names(grep !($_ eq $name), $self->list_names)