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

(-)a/C4/Auth.pm (-2 / +11 lines)
Lines 259-267 sub get_template_and_user { Link Here
259
                -sameSite => 'Lax',
259
                -sameSite => 'Lax',
260
            ));
260
            ));
261
261
262
            my $auth_error = $in->{query}->param('auth_error');
263
262
            $template->param(
264
            $template->param(
263
                loginprompt => 1,
265
                loginprompt => 1,
264
                script_name => get_script_name(),
266
                script_name => get_script_name(),
267
                auth_error  => $auth_error,
265
            );
268
            );
266
269
267
            print $in->{query}->header(
270
            print $in->{query}->header(
Lines 1320-1325 sub checkauth { Link Here
1320
    $LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;
1323
    $LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;
1321
1324
1322
    my $auth_template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt';
1325
    my $auth_template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt';
1326
    my $auth_error = $query->param('auth_error');
1323
    my $template = C4::Templates::gettemplate( $auth_template_name, $type, $query );
1327
    my $template = C4::Templates::gettemplate( $auth_template_name, $type, $query );
1324
    $template->param(
1328
    $template->param(
1325
        login                                 => 1,
1329
        login                                 => 1,
Lines 1357-1362 sub checkauth { Link Here
1357
        opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
1361
        opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
1358
        too_many_login_attempts               => ( $patron and $patron->account_locked ),
1362
        too_many_login_attempts               => ( $patron and $patron->account_locked ),
1359
        password_has_expired                  => ( $patron and $patron->password_expired ),
1363
        password_has_expired                  => ( $patron and $patron->password_expired ),
1364
        auth_error                            => $auth_error,
1360
    );
1365
    );
1361
1366
1362
    $template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') );
1367
    $template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') );
Lines 1534-1539 sub check_api_auth { Link Here
1534
        # new login
1539
        # new login
1535
        my $userid   = $query->param('userid');
1540
        my $userid   = $query->param('userid');
1536
        my $password = $query->param('password');
1541
        my $password = $query->param('password');
1542
        my $auth_client_login = $query->param('auth_client_login');
1537
        my ( $return, $cardnumber, $cas_ticket );
1543
        my ( $return, $cardnumber, $cas_ticket );
1538
1544
1539
        # Proxy CAS auth
1545
        # Proxy CAS auth
Lines 1543-1548 sub check_api_auth { Link Here
1543
            # In case of a CAS authentication, we use the ticket instead of the password
1549
            # In case of a CAS authentication, we use the ticket instead of the password
1544
            my $PT = $query->param('PT');
1550
            my $PT = $query->param('PT');
1545
            ( $return, $cardnumber, $userid, $cas_ticket ) = check_api_auth_cas( $PT, $query );    # EXTERNAL AUTH
1551
            ( $return, $cardnumber, $userid, $cas_ticket ) = check_api_auth_cas( $PT, $query );    # EXTERNAL AUTH
1552
        } elsif ( $auth_client_login && ( $userid || $query->param('cardnumber') ) ) {
1553
            $cardnumber = $query->param('cardnumber');
1554
            $return = 1;
1546
        } else {
1555
        } else {
1547
1556
1548
            # User / password auth
1557
            # User / password auth
Lines 1747-1753 sub check_cookie_auth { Link Here
1747
        } elsif ( $userid ) {
1756
        } elsif ( $userid ) {
1748
            $session->param( 'lasttime', time() );
1757
            $session->param( 'lasttime', time() );
1749
            my $patron = Koha::Patrons->find({ userid => $userid });
1758
            my $patron = Koha::Patrons->find({ userid => $userid });
1750
            $patron = Koha::Patron->find({ cardnumber => $userid }) unless $patron;
1759
            $patron = Koha::Patrons->find({ cardnumber => $userid })
1760
              unless $patron;
1751
            return ("password_expired", undef ) if $patron->password_expired;
1761
            return ("password_expired", undef ) if $patron->password_expired;
1752
            my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1;
1762
            my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1;
1753
            if ($flags) {
1763
            if ($flags) {
1754
- 

Return to bug 31378