reindenting & code cleaning

This commit is contained in:
tipaul 2003-03-19 21:03:32 +00:00
parent 547c0daf6d
commit 3205a1a3ff
2 changed files with 22 additions and 28 deletions

View File

@ -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;
}

View File

@ -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) = @_;