X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FAuthHandler.pm;h=529b2d12a6878e38e1562eceaeafd01bff7fb7f5;hb=e2c6bdb96bc370241c8948734c34142110d9066e;hp=45428d8f676f1548e8f039053a46985c99930105;hpb=3fbdd3816ab065ed3ac2b5f77e7617b2c09ea00c;p=ndwebbie.git diff --git a/ND/Web/AuthHandler.pm b/ND/Web/AuthHandler.pm index 45428d8..529b2d1 100644 --- a/ND/Web/AuthHandler.pm +++ b/ND/Web/AuthHandler.pm @@ -24,7 +24,6 @@ use warnings FATAL => 'all'; use ND::DB; use Apache2::Access (); -use again; sub handler { my $r = shift; @@ -32,11 +31,11 @@ sub handler { return $res if $res != Apache2::Const::OK; my $dbh = ND::DB::DB(); - my ($count) = $dbh->selectrow_array(q{SELECT count(*) FROM users WHERE + my ($username) = $dbh->selectrow_array(q{SELECT username FROM users WHERE lower(username) = lower(?) AND password = MD5(?)},undef,$r->user,$sent_pw); $dbh->disconnect; - if ($count == 1){ - do 'reload.pl'; + if ($username){ + $r->user($username); return Apache2::Const::OK; } $r->note_basic_auth_failure();