X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FApp-EzPz.git;a=blobdiff_plain;f=lib%2FApp%2FEzPz%2FUserStore.pm;fp=lib%2FApp%2FEzPz%2FUserStore.pm;h=672fec343f7a4fac342f90ccba56058eee97971d;hp=73669c553499ae5fa17f3b10fabf914db7325e76;hb=fda55d3e18008b847db5b383dc94e3fde8dcdf1e;hpb=bdab61a3b862017e4b56e242212b55a4e574be79 diff --git a/lib/App/EzPz/UserStore.pm b/lib/App/EzPz/UserStore.pm index 73669c5..672fec3 100644 --- a/lib/App/EzPz/UserStore.pm +++ b/lib/App/EzPz/UserStore.pm @@ -4,7 +4,13 @@ use Module::Runtime qw(use_module); use Scalar::Util 'blessed'; use Moo; -has ezmlm_bindir => (is => 'ro', required => 1); +has ezmlm_config => ( + is => 'ro', + coerce => sub { + return $_[0] if blessed($_[0]); + return use_module('App::EzPz::EzmlmConfig')->new($_[0]); + } +); has htpasswd_file => (is => 'ro', required => 1); @@ -38,7 +44,7 @@ sub add { my $htp_user = $user->_htpasswd_user; $htp_file->add_user($htp_user); $htp_user->file($htp_file); - $user->_set_ezmlm_bindir($self->ezmlm_bindir); + $user->_set_ezmlm_config($self->ezmlm_config); return $user; } @@ -52,7 +58,7 @@ sub _inflate_user { my ($self, $htp_user) = @_; return use_module('App::EzPz::User')->new( htpasswd_user => $htp_user, - ezmlm_bindir => $self->ezmlm_bindir, + ezmlm_config => $self->ezmlm_config, ); }