sub checkpw_internal {
my ( $dbh, $userid, $password ) = @_;
+ if ( $userid && $userid eq C4::Context->config('user') ) {
+ if ( $password && $password eq C4::Context->config('pass') ) {
+ # Koha superuser account
+# C4::Context->set_userenv(0,0,C4::Context->config('user'),C4::Context->config('user'),C4::Context->config('user'),"",1);
+ return 2;
+ }
+ else {
+ return 0;
+ }
+ }
+
my $sth =
$dbh->prepare(
"select password,cardnumber,borrowernumber,userid,firstname,surname,branchcode,flags from borrowers where userid=?"
return 1, $cardnumber, $userid;
}
}
- if ( $userid && $userid eq C4::Context->config('user')
- && "$password" eq C4::Context->config('pass') )
- {
-
-# Koha superuser account
-# C4::Context->set_userenv(0,0,C4::Context->config('user'),C4::Context->config('user'),C4::Context->config('user'),"",1);
- return 2;
- }
if ( $userid && $userid eq 'demo'
&& "$password" eq 'demo'
&& C4::Context->config('demo') )
$dbh->prepare(
"SELECT * FROM borrowers WHERE userid=? AND borrowernumber != ?");
$sth->execute( $uid, $member );
- if ( ( $uid ne '' ) && ( my $row = $sth->fetchrow_hashref ) ) {
+ if ( (( $uid ne '' ) && ( my $row = $sth->fetchrow_hashref )) or
+ (( $uid ne '' ) && ( $uid eq C4::Context->config('user') )) ) {
return 0;
}
else {