stray closing /TABLE in the no-ticket case
[freeside.git] / FS / FS / AuthCookieHandler24.pm
index fa24890..d65934f 100644 (file)
@@ -1,46 +1,12 @@
 package FS::AuthCookieHandler24;
-use base qw( Apache2::AuthCookie );
+use base qw( FS::AuthCookieHandler );
 
 use strict;
-use FS::UID qw( adminsuidsetup preuser_setup );
-use FS::CurrentUser;
-use FS::Auth;
 
-sub authen_cred {
-  my( $self, $r, $username, $password ) = @_;
-
-  preuser_setup();
-
-  my $info = {};
-
-  unless ( FS::Auth->authenticate($username, $password, $info) ) {
-    warn "failed auth $username from ". $r->useragent_ip. "\n";
-    return undef;
-  }
-
-  warn "authenticated $username from ". $r->useragent_ip. "\n";
-
-  FS::CurrentUser->load_user( $username,
-                              'autocreate' => FS::Auth->auth_class->autocreate,
-                              %$info,
-                            );
-
-  FS::CurrentUser->new_session;
-}
-
-sub authen_ses_key {
-  my( $self, $r, $sessionkey ) = @_;
-
-  preuser_setup();
-
-  my $curuser = FS::CurrentUser->load_user_session( $sessionkey );
-
-  unless ( $curuser ) {
-    warn "bad session $sessionkey from ". $r->useragent_ip. "\n";
-    return undef;
-  }
-
-  $curuser->username;
+#Apache 2.4+ / Apache2::AuthCookie 3.19+
+sub useragent_ip {
+  my( $self, $r ) = @_;
+  $r->useragent_ip;
 }
 
 1;