Lines 948-953
sub checkauth {
Link Here
|
948 |
$info{oldip} = $more_info->{old_ip}; |
948 |
$info{oldip} = $more_info->{old_ip}; |
949 |
$info{newip} = $more_info->{new_ip}; |
949 |
$info{newip} = $more_info->{new_ip}; |
950 |
$info{different_ip} = 1; |
950 |
$info{different_ip} = 1; |
|
|
951 |
} elsif ( $return eq 'password_expired' ) { |
952 |
$info{password_has_expired} = 1; |
951 |
} |
953 |
} |
952 |
} |
954 |
} |
953 |
} |
955 |
} |
Lines 1339-1345
sub checkauth {
Link Here
|
1339 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
1341 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
1340 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
1342 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
1341 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1343 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1342 |
too_many_login_attempts => ( $patron and $patron->account_locked ) |
1344 |
too_many_login_attempts => ( $patron and $patron->account_locked ), |
|
|
1345 |
password_has_expired => ( $patron and $patron->password_expired ) |
1343 |
); |
1346 |
); |
1344 |
|
1347 |
|
1345 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
1348 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
Lines 1716-1721
sub check_cookie_auth {
Link Here
|
1716 |
|
1719 |
|
1717 |
} elsif ( $userid ) { |
1720 |
} elsif ( $userid ) { |
1718 |
$session->param( 'lasttime', time() ); |
1721 |
$session->param( 'lasttime', time() ); |
|
|
1722 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
1723 |
$patron = Koha::Patron->find({ cardnumber => $userid }) unless $patron; |
1724 |
return ("password_expired", undef ) if $patron->password_expired; |
1719 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1725 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1720 |
if ($flags) { |
1726 |
if ($flags) { |
1721 |
C4::Context->_new_userenv($sessionID); |
1727 |
C4::Context->_new_userenv($sessionID); |
Lines 1824-1831
sub checkpw {
Link Here
|
1824 |
# 0 if auth is nok |
1830 |
# 0 if auth is nok |
1825 |
# -1 if user bind failed (LDAP only) |
1831 |
# -1 if user bind failed (LDAP only) |
1826 |
|
1832 |
|
1827 |
if ( $patron and $patron->account_locked ) { |
1833 |
if ( $patron and ( $patron->account_locked || $patron->password_expired ) ) { |
1828 |
# Nothing to check, account is locked |
1834 |
# Nothing to check, account is locked or password expired |
1829 |
} elsif ($ldap && defined($password)) { |
1835 |
} elsif ($ldap && defined($password)) { |
1830 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
1836 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
1831 |
if ( $retval == 1 ) { |
1837 |
if ( $retval == 1 ) { |