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

(-)a/C4/Auth.pm (+7 lines)
Lines 1451-1456 sub checkauth { Link Here
1451
        opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
1451
        opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
1452
        too_many_login_attempts               => ( $patron and $patron->account_locked ),
1452
        too_many_login_attempts               => ( $patron and $patron->account_locked ),
1453
        password_has_expired                  => ( $patron and $patron->password_expired ),
1453
        password_has_expired                  => ( $patron and $patron->password_expired ),
1454
        borrowernumber                        => ( $patron and $patron->borrowernumber ),
1455
        anonymous_patron                      => C4::Context->preference('AnonymousPatron'),
1454
        auth_error                            => $auth_error,
1456
        auth_error                            => $auth_error,
1455
    );
1457
    );
1456
1458
Lines 1977-1982 sub checkpw { Link Here
1977
    my $shib       = C4::Context->config('useshibboleth') && shib_ok();
1979
    my $shib       = C4::Context->config('useshibboleth') && shib_ok();
1978
    my $shib_login = $shib ? get_login_shib() : undef;
1980
    my $shib_login = $shib ? get_login_shib() : undef;
1979
1981
1982
    my $anonymous_patron = C4::Context->preference('AnonymousPatron');
1983
1980
    my @return;
1984
    my @return;
1981
    my $patron;
1985
    my $patron;
1982
    if ( defined $userid ) {
1986
    if ( defined $userid ) {
Lines 2053-2058 sub checkpw { Link Here
2053
            if ( $patron->password_expired ) {
2057
            if ( $patron->password_expired ) {
2054
                @return = ( -2, $patron );
2058
                @return = ( -2, $patron );
2055
            }
2059
            }
2060
            if ( $patron->borrowernumber eq $anonymous_patron ) {
2061
                @return = ( -1, $patron );
2062
            }
2056
        } elsif ( !$patron->account_locked ) {
2063
        } elsif ( !$patron->account_locked ) {
2057
            $patron->update( { login_attempts => $patron->login_attempts + 1 } );
2064
            $patron->update( { login_attempts => $patron->login_attempts + 1 } );
2058
        }
2065
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt (+2 lines)
Lines 85-90 Link Here
85
    [% END %]
85
    [% END %]
86
[% ELSIF invalid_username_or_password %]
86
[% ELSIF invalid_username_or_password %]
87
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
87
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
88
[% ELSIF borrowernumber == anonymous_patron %]
89
    <div id="login_error"><strong>Error: </strong>You can't log in as the anonymous patron!</div>
88
[% END %]
90
[% END %]
89
91
90
[% IF auth_error %]
92
[% IF auth_error %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt (-1 / +6 lines)
Lines 188-193 Link Here
188
                            [% END # /IF GoogleOpenIDConnect %]
188
                            [% END # /IF GoogleOpenIDConnect %]
189
                        [% END # /UNLESS OPACShibOnly %]
189
                        [% END # /UNLESS OPACShibOnly %]
190
190
191
                        [% IF !(invalid_username_or_password || too_many_login_attempts) and (borrowernumber == anonymous_patron) %]
192
                            <div class="alert alert-info">
193
                                <p><strong>Error: </strong>You can't log in as the anonymous patron!</p>
194
                            </div>
195
                        [% END %]
196
191
                        [% IF !(invalid_username_or_password || too_many_login_attempts) and password_has_expired %]
197
                        [% IF !(invalid_username_or_password || too_many_login_attempts) and password_has_expired %]
192
                            <div class="alert alert-info">
198
                            <div class="alert alert-info">
193
                                <p><strong>Error: </strong>Your password has expired!</p>
199
                                <p><strong>Error: </strong>Your password has expired!</p>
194
- 

Return to bug 37104