X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FAuthHandler.pm;h=529b2d12a6878e38e1562eceaeafd01bff7fb7f5;hb=5bdf7f1c03127ec37bd29852ebc0279431ad93aa;hp=60204b0e8171e7a4e56826607469787480dbe65a;hpb=d95a7d627e158a2885e990ba53ff46b465c8570d;p=ndwebbie.git diff --git a/ND/Web/AuthHandler.pm b/ND/Web/AuthHandler.pm index 60204b0..529b2d1 100644 --- a/ND/Web/AuthHandler.pm +++ b/ND/Web/AuthHandler.pm @@ -31,10 +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){ + if ($username){ + $r->user($username); return Apache2::Const::OK; } $r->note_basic_auth_failure();