reindenting & code cleaning
This commit is contained in:
parent
547c0daf6d
commit
3205a1a3ff
49
C4/Auth.pm
49
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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) = @_;
|
||||
|
|
|
|||
Loading…
Reference in New Issue