X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FAuthentication%2FStore%2FNDWeb.pm;fp=lib%2FCatalyst%2FPlugin%2FAuthentication%2FStore%2FNDWeb.pm;h=ff90aff08cd068e612014fd26ec8142a5a3d6673;hb=49c23244b1ba61909b726bb9189665a33027a1af;hp=0000000000000000000000000000000000000000;hpb=8250eb360c341a4eeaa76e5e3fc0f57cf0014a60;p=ndwebbie.git diff --git a/lib/Catalyst/Plugin/Authentication/Store/NDWeb.pm b/lib/Catalyst/Plugin/Authentication/Store/NDWeb.pm new file mode 100644 index 0000000..ff90aff --- /dev/null +++ b/lib/Catalyst/Plugin/Authentication/Store/NDWeb.pm @@ -0,0 +1,77 @@ +package Catalyst::Plugin::Authentication::Store::NDWeb; + +use strict; +use warnings; +use base qw/Class::Accessor::Fast/; + +use NDWeb::Auth::User; + +our $VERSION= "0.104"; + + +BEGIN { + #__PACKAGE__->mk_accessors(qw/config/); +} + + +sub setup { + my $c = shift; + + $c->default_auth_store( + Catalyst::Plugin::Authentication::Store::NDWeb->new( + ) + ); + + $c->NEXT::setup(@_); + +} + +sub new { + my ( $class ) = @_; + + my $self = { + }; + + bless $self, $class; +} + +sub from_session { + my ( $self, $c, $frozenuser ) = @_; + + my $user = NDWeb::Auth::User->new(); + + return $user->from_session($frozenuser, $c); +} + +sub for_session { + my ($self, $c, $user) = @_; + return $user->for_session($c); +} + +sub find_user { + my ( $self, $authinfo, $c ) = @_; + + my $user = NDWeb::Auth::User->new();; + + return $user->load($authinfo, $c); +} + +sub user_supports { + my $self = shift; + # this can work as a class method on the user class + NDWeb::User->supports( @_ ); +} + +__PACKAGE__; + +__END__ + +=head1 AUTHOR + +Michael Andreen (harv@ruin.nu) + +=head1 LICENSE + +GPL 2.0, or later. + +=cut