From 3205a1a3ffaae7a13d40aab6722b8ea40d228da5 Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 19 Mar 2003 21:03:32 +0000 Subject: [PATCH] reindenting & code cleaning --- C4/Auth.pm | 49 ++++++++++++++++++++++--------------------------- C4/Input.pm | 1 - 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index acd614ef12..863a4b05cc 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -347,35 +347,30 @@ sub checkpw { # (e.g. LDAP), as well as local authentication through the borrowers # tables passwd field # - - my ($dbh, $userid, $password) = @_; - { - my $sth=$dbh->prepare - ("select password,cardnumber from borrowers where userid=?"); - $sth->execute($userid); - if ($sth->rows) { - my ($md5password,$cardnumber) = $sth->fetchrow; - if (md5_base64($password) eq $md5password) { - return 1,$cardnumber; + my ($dbh, $userid, $password) = @_; + warn "$userid / $password"; + my $sth=$dbh->prepare("select password,cardnumber from borrowers where userid=?"); + $sth->execute($userid); + if ($sth->rows) { + my ($md5password,$cardnumber) = $sth->fetchrow; + warn "==> ".md5_base64($password)." = $md5password"; + if (md5_base64($password) eq $md5password) { + return 1,$cardnumber; + } } - } - } - { - my $sth=$dbh->prepare - ("select password from borrowers where cardnumber=?"); - $sth->execute($userid); - if ($sth->rows) { - my ($md5password) = $sth->fetchrow; - if (md5_base64($password) eq $md5password) { - return 1,$userid; + my $sth=$dbh->prepare("select password from borrowers where cardnumber=?"); + $sth->execute($userid); + if ($sth->rows) { + my ($md5password) = $sth->fetchrow; + if (md5_base64($password) eq $md5password) { + return 1,$userid; + } } - } - } - if ($userid eq C4::Context->config('user') && $password eq C4::Context->config('pass')) { - # Koha superuser account - return 2; - } - return 0; + if ($userid eq C4::Context->config('user') && $password eq C4::Context->config('pass')) { + # Koha superuser account + return 2; + } + return 0; } diff --git a/C4/Input.pm b/C4/Input.pm index b058d9ac6b..1dc63273a8 100644 --- a/C4/Input.pm +++ b/C4/Input.pm @@ -80,7 +80,6 @@ C<$env> is ignored. #' sub checkdigit { if (C4::Context->preference("checkdigit") eq "none") { - warn "XXcheckdigit : ".C4::Context->preference("checkdigit"); return 1; } else { my ($env,$infl) = @_; -- 2.39.5