]> ruin.nu Git - ndwebbie.git/blob - lib/Catalyst/Plugin/Authentication/Store/NDWeb.pm
Login/Logout and session support with roles + convert to html 4.01.
[ndwebbie.git] / lib / Catalyst / Plugin / Authentication / Store / NDWeb.pm
1 package Catalyst::Plugin::Authentication::Store::NDWeb;
2
3 use strict;
4 use warnings;
5 use base qw/Class::Accessor::Fast/;
6
7 use NDWeb::Auth::User;
8
9 our $VERSION= "0.104";
10
11
12 BEGIN {
13         #__PACKAGE__->mk_accessors(qw/config/);
14 }
15
16
17 sub setup {
18         my $c = shift;
19
20     $c->default_auth_store(
21         Catalyst::Plugin::Authentication::Store::NDWeb->new(
22         )
23     );
24
25     $c->NEXT::setup(@_);
26
27 }
28
29 sub new {
30         my ( $class ) = @_;
31
32         my $self = {
33         };
34
35         bless $self, $class;
36 }
37
38 sub from_session {
39         my ( $self, $c, $frozenuser ) = @_;
40
41         my $user = NDWeb::Auth::User->new();
42
43         return $user->from_session($frozenuser, $c);
44 }
45
46 sub for_session {
47         my ($self, $c, $user) = @_;
48         return $user->for_session($c);
49 }
50
51 sub find_user {
52         my ( $self, $authinfo, $c ) = @_;
53
54         my $user = NDWeb::Auth::User->new();;
55
56         return $user->load($authinfo, $c);
57 }
58
59 sub user_supports {
60         my $self = shift;
61         # this can work as a class method on the user class
62         NDWeb::User->supports( @_ );
63 }
64
65 __PACKAGE__;
66
67 __END__
68
69 =head1 AUTHOR
70
71 Michael Andreen (harv@ruin.nu)
72
73 =head1 LICENSE
74
75 GPL 2.0, or later.
76
77 =cut