use strict;
use warnings;
-BEGIN { __PACKAGE__->mk_accessors(qw/user store/) }
+BEGIN { __PACKAGE__->mk_accessors(qw/_user _store/) }
use overload '""' => sub { shift->id }, fallback => 1;
return unless $user;
- bless { store => $store, user => $user }, $class;
+ bless { _store => $store, _user => $user }, $class;
}
sub id {
my $self = shift;
- return $self->user->username;
+ return $self->_user->username;
}
sub supported_features {
sub check_password {
my ( $self, $password ) = @_;
- return $self->user->check_password( $password );
+ return $self->_user->check_password( $password );
}
sub roles {
my $self = shift;
- my $field = $self->user->extra_info->[0];
+ my $field = $self->_user->extra_info->[0];
return defined $field ? split /,/, $field : ();
}
-sub for_session {
- my $self = shift;
- return $self->id;
-}
+*for_session = \&id;
+
+*get_object = \&_user;
sub AUTOLOAD {
my $self = shift;
return if $method eq "DESTROY";
- $self->user->$method;
+ $self->_user->$method;
}
1;
Returns data about which featurs this user module supports.
+=head2 get_object
+
+Returns the underlieing L<Authen::Htpasswd::User> object for this user
+
=head1 AUTHORS
Yuval Kogman C<nothingmuch@woobling.org>