diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-08-07 01:24:52 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-08-07 01:24:52 -0700 |
commit | a9e7226724fb8eba367f8d4781ddec1ac4cf97d6 (patch) | |
tree | 129d4097ff01ac5d356abfd52002e351927c8a97 /FS | |
parent | 9a753a28cb38ddf6e500805246173a8a1d12894a (diff) |
apache 2.4
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/AuthCookieHandler24.pm | 46 | ||||
-rw-r--r-- | FS/MANIFEST | 11 |
2 files changed, 57 insertions, 0 deletions
diff --git a/FS/FS/AuthCookieHandler24.pm b/FS/FS/AuthCookieHandler24.pm new file mode 100644 index 000000000..fa24890cc --- /dev/null +++ b/FS/FS/AuthCookieHandler24.pm @@ -0,0 +1,46 @@ +package FS::AuthCookieHandler24; +use base qw( Apache2::AuthCookie ); + +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; +} + +1; diff --git a/FS/MANIFEST b/FS/MANIFEST index 7e61868a9..803c521db 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -27,6 +27,7 @@ bin/freeside-torrus-srvderive FS.pm FS/AccessRight.pm FS/AuthCookieHandler.pm +FS/AuthCookieHandler24.pm FS/Auth/external.pm FS/Auth/internal.pm FS/Auth/legacy.pm @@ -707,3 +708,13 @@ FS/part_pkg_currency.pm t/part_pkg_currency.t FS/cust_payby.pm t/cust_payby.t +FS/vend_main.pm +t/vend_main.t +FS/vend_class.pm +t/vend_class.t +FS/vend_bill.pm +t/vend_bill.t +FS/vend_pay.pm +t/vend_pay.t +FS/vend_bill_pay.pm +t/vend_bill_pay.t |