From e2c6bdb96bc370241c8948734c34142110d9066e Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Tue, 9 Jan 2007 08:06:36 +0000 Subject: [PATCH] right username --- ND/Web/AuthHandler.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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(); -- 2.39.2