|
Lines 930-935
sub checkauth {
Link Here
|
| 930 |
$info{oldip} = $more_info->{old_ip}; |
930 |
$info{oldip} = $more_info->{old_ip}; |
| 931 |
$info{newip} = $more_info->{new_ip}; |
931 |
$info{newip} = $more_info->{new_ip}; |
| 932 |
$info{different_ip} = 1; |
932 |
$info{different_ip} = 1; |
|
|
933 |
} elsif ( $return eq 'password_expired' ) { |
| 934 |
$info{password_has_expired} = 1; |
| 933 |
} |
935 |
} |
| 934 |
} |
936 |
} |
| 935 |
} |
937 |
} |
|
Lines 1314-1320
sub checkauth {
Link Here
|
| 1314 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
1316 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
| 1315 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
1317 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
| 1316 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1318 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
| 1317 |
too_many_login_attempts => ( $patron and $patron->account_locked ) |
1319 |
too_many_login_attempts => ( $patron and $patron->account_locked ), |
|
|
1320 |
password_has_expired => ( $patron and $patron->password_expired ) |
| 1318 |
); |
1321 |
); |
| 1319 |
|
1322 |
|
| 1320 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
1323 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
|
Lines 1702-1707
sub check_cookie_auth {
Link Here
|
| 1702 |
return ( "restricted", undef, { old_ip => $ip, new_ip => $remote_addr}); |
1705 |
return ( "restricted", undef, { old_ip => $ip, new_ip => $remote_addr}); |
| 1703 |
} else { |
1706 |
} else { |
| 1704 |
$session->param( 'lasttime', time() ); |
1707 |
$session->param( 'lasttime', time() ); |
|
|
1708 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
| 1709 |
$patron = Koha::Patron->find({ cardnumber => $userid }) unless $patron; |
| 1710 |
return ("password_expired", undef ) if $patron->password_expired; |
| 1705 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1711 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
| 1706 |
if ($flags) { |
1712 |
if ($flags) { |
| 1707 |
return ( "ok", $session ); |
1713 |
return ( "ok", $session ); |
|
Lines 1790-1797
sub checkpw {
Link Here
|
| 1790 |
# 0 if auth is nok |
1796 |
# 0 if auth is nok |
| 1791 |
# -1 if user bind failed (LDAP only) |
1797 |
# -1 if user bind failed (LDAP only) |
| 1792 |
|
1798 |
|
| 1793 |
if ( $patron and $patron->account_locked ) { |
1799 |
if ( $patron and ( $patron->account_locked || $patron->password_expired ) ) { |
| 1794 |
# Nothing to check, account is locked |
1800 |
# Nothing to check, account is locked or password expired |
| 1795 |
} elsif ($ldap && defined($password)) { |
1801 |
} elsif ($ldap && defined($password)) { |
| 1796 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
1802 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
| 1797 |
if ( $retval == 1 ) { |
1803 |
if ( $retval == 1 ) { |