1 package FS::AuthCookieHandler;
2 use base qw( Apache2::AuthCookie );
5 use FS::UID qw( adminsuidsetup preuser_setup );
10 my( $self, $r, $username, $password ) = @_;
16 unless ( FS::Auth->authenticate($username, $password, $info) ) {
17 warn "failed auth $username from ". $r->connection->remote_ip. "\n";
21 warn "authenticated $username from ". $r->connection->remote_ip. "\n";
23 FS::CurrentUser->load_user( $username,
24 'autocreate' => FS::Auth->auth_class->autocreate,
28 FS::CurrentUser->new_session;
32 my( $self, $r, $sessionkey ) = @_;
36 my $curuser = FS::CurrentUser->load_user_session( $sessionkey );
39 warn "bad session $sessionkey from ". $r->connection->remote_ip. "\n";