bugfix : a missing } was placed at a wrong place. The auth did not work anymore...
This commit is contained in:
parent
e03a18467c
commit
097e2d5718
1 changed files with 14 additions and 15 deletions
29
C4/Auth.pm
29
C4/Auth.pm
|
@ -350,8 +350,8 @@ sub checkpw {
|
|||
#
|
||||
my ($dbh, $userid, $password) = @_;
|
||||
# LDAP
|
||||
my $sth=$dbh->prepare("select value from systempreferences where variable=?");
|
||||
$sth->execute("ldapserver");
|
||||
# my $sth=$dbh->prepare("select value from systempreferences where variable=?");
|
||||
# $sth->execute("ldapserver");
|
||||
my $ldapserver = C4::Context->preferences('ldapserver');
|
||||
if ($ldapserver) {
|
||||
my $ldapinfos = C4::Context->preferences('ldapinfos');
|
||||
|
@ -365,17 +365,18 @@ sub checkpw {
|
|||
# auth refused
|
||||
return 0;
|
||||
} else {
|
||||
#get the cardnumber
|
||||
my $sth=$dbh->prepare("select cardnumber from borrowers where userid=?");
|
||||
$sth->execute($userid);
|
||||
if ($sth->rows) {
|
||||
my $cardnumber = $sth->fetchrow;
|
||||
#we have the cardnumber
|
||||
return 1,$cardnumber;
|
||||
}
|
||||
if ($userid eq C4::Context->config('user') && $password eq C4::Context->config('pass')) {
|
||||
# Koha superuser account
|
||||
return 2;
|
||||
#get the cardnumber
|
||||
my $sth=$dbh->prepare("select cardnumber from borrowers where userid=?");
|
||||
$sth->execute($userid);
|
||||
if ($sth->rows) {
|
||||
my $cardnumber = $sth->fetchrow;
|
||||
#we have the cardnumber
|
||||
return 1,$cardnumber;
|
||||
}
|
||||
if ($userid eq C4::Context->config('user') && $password eq C4::Context->config('pass')) {
|
||||
# Koha superuser account
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
# INTERNAL AUTH
|
||||
|
@ -462,8 +463,6 @@ sub getborrowernumber {
|
|||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
END { } # module clean-up code here (global destructor)
|
||||
1;
|
||||
__END__
|
||||
|
|
Loading…
Reference in a new issue