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

(-)a/C4/Auth.pm (-5 / +13 lines)
Lines 183-193 sub get_template_and_user { Link Here
183
        $in->{'query'},
183
        $in->{'query'},
184
    );
184
    );
185
185
186
    my $request_method = $in->{query}->request_method // q{};
186
    if ( C4::Context->preference('AutoSelfCheckAllowed') && $in->{template_name} =~ m|sco/| ) {
187
    unless ( $request_method eq 'POST' && $in->{query}->param('op') eq 'cud-login' ) {
187
        my $AutoSelfCheckID   = C4::Context->preference('AutoSelfCheckID');
188
        for my $v ( qw( login_userid login_password ) ) {
188
        my $AutoSelfCheckPass = C4::Context->preference('AutoSelfCheckPass');
189
            $in->{query}->param($v, '')
189
        $in->{query}->param( -name => 'login_userid',       -values => [$AutoSelfCheckID] );
190
                if $in->{query}->param($v);
190
        $in->{query}->param( -name => 'login_password',     -values => [$AutoSelfCheckPass] );
191
        $in->{query}->param( -name => 'koha_login_context', -values => ['sco'] );
192
    } else {
193
        my $request_method = $in->{query}->request_method // q{};
194
        unless ( $request_method eq 'POST' && $in->{query}->param('op') eq 'cud-login' ) {
195
            for my $v (qw( login_userid login_password )) {
196
                $in->{query}->param( $v, '' )
197
                    if $in->{query}->param($v);
198
            }
191
        }
199
        }
192
    }
200
    }
193
201
(-)a/opac/sco/sco-main.pl (-9 lines)
Lines 61-74 unless ( in_iprange(C4::Context->preference('SelfCheckAllowByIPRanges')) ) { Link Here
61
    exit;
61
    exit;
62
}
62
}
63
63
64
if (C4::Context->preference('AutoSelfCheckAllowed'))
65
{
66
    my $AutoSelfCheckID = C4::Context->preference('AutoSelfCheckID');
67
    my $AutoSelfCheckPass = C4::Context->preference('AutoSelfCheckPass');
68
    $query->param(-name=>'userid',-values=>[$AutoSelfCheckID]);
69
    $query->param(-name=>'password',-values=>[$AutoSelfCheckPass]);
70
    $query->param(-name=>'koha_login_context',-values=>['sco']);
71
}
72
$query->param(-name=>'sco_user_login',-values=>[1]);
64
$query->param(-name=>'sco_user_login',-values=>[1]);
73
65
74
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
66
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
75
- 

Return to bug 36349