View | Details | Raw Unified | Return to bug 15419
Collapse All | Expand All

(-)a/C4/SIP/ILS/Patron.pm (-2 / +9 lines)
Lines 14-19 use Carp; Link Here
14
14
15
use Sys::Syslog qw(syslog);
15
use Sys::Syslog qw(syslog);
16
use Data::Dumper;
16
use Data::Dumper;
17
use Time::Out qw(timeout);
17
18
18
use C4::Debug;
19
use C4::Debug;
19
use C4::Context;
20
use C4::Context;
Lines 199-207 sub check_password { Link Here
199
    # If the record has a NULL password, accept '' as match
200
    # If the record has a NULL password, accept '' as match
200
    return $pwd eq q{} unless $self->{password};
201
    return $pwd eq q{} unless $self->{password};
201
202
202
    my $dbh = C4::Context->dbh;
203
    my $ret = 0;
203
    my $ret = 0;
204
    ($ret) = checkpw( $dbh, $self->{userid}, $pwd, undef, undef, 1 ); # dbh, userid, query, type, no_set_userenv
204
    local $@;
205
    ($ret) = timeout (5 => sub {
206
        #        dbh, userid, query, type, no_set_userenv
207
        checkpw( C4::Context->dbh, $self->{userid}, $pwd, undef, undef, 1 );
208
    });
209
    if ($@) {
210
        ($ret) = checkpw( C4::Context->new_dbh, $self->{userid}, $pwd, undef, undef, 1 );
211
    }
205
    return $ret;
212
    return $ret;
206
}
213
}
207
214
(-)a/C4/SIP/Sip/MsgType.pm (-2 / +10 lines)
Lines 10-15 use strict; Link Here
10
use warnings;
10
use warnings;
11
use Exporter;
11
use Exporter;
12
use Sys::Syslog qw(syslog);
12
use Sys::Syslog qw(syslog);
13
use Time::Out qw(timeout);
13
14
14
use C4::SIP::Sip qw(:all);
15
use C4::SIP::Sip qw(:all);
15
use C4::SIP::Sip::Constants qw(:all);
16
use C4::SIP::Sip::Constants qw(:all);
Lines 1607-1613 sub api_auth { Link Here
1607
    if ($branch) {
1608
    if ($branch) {
1608
        $query->param( branch => $branch );
1609
        $query->param( branch => $branch );
1609
    }
1610
    }
1610
    my ( $status, $cookie, $sessionID ) = check_api_auth( $query, { circulate => 1 }, 'intranet' );
1611
1612
    local $@;
1613
    my ( $status, $cookie, $sessionID ) = timeout (5 => sub {
1614
        check_api_auth( $query, { circulate => 1 }, 'intranet' );
1615
    });
1616
    if ($@) {
1617
        C4::Context->new_dbh;
1618
        ( $status, $cookie, $sessionID ) = check_api_auth( $query, { circulate => 1 }, 'intranet' );
1619
    }
1611
    return $status;
1620
    return $status;
1612
}
1621
}
1613
1622
1614
- 

Return to bug 15419