1 package FS::AuthCookieHandler;
2 use base qw( Apache2::AuthCookie );
5 use FS::UID qw( adminsuidsetup preuser_setup );
12 $r->connection->remote_ip;
16 my( $self, $r, $username, $password ) = @_;
22 unless ( FS::Auth->authenticate($username, $password, $info) ) {
23 warn "failed auth $username from ". $self->useragent_ip($r). "\n";
27 warn "authenticated $username from ". $self->useragent_ip($r). "\n";
29 FS::CurrentUser->load_user( $username,
30 'autocreate' => FS::Auth->auth_class->autocreate,
34 FS::CurrentUser->new_session;
38 my( $self, $r, $sessionkey ) = @_;
42 my $curuser = FS::CurrentUser->load_user_session( $sessionkey );
45 warn "bad session $sessionkey from ". $self->useragent_ip($r). "\n";