Lines 932-937
sub checkauth {
Link Here
|
932 |
$info{oldip} = $more_info->{old_ip}; |
932 |
$info{oldip} = $more_info->{old_ip}; |
933 |
$info{newip} = $more_info->{new_ip}; |
933 |
$info{newip} = $more_info->{new_ip}; |
934 |
$info{different_ip} = 1; |
934 |
$info{different_ip} = 1; |
|
|
935 |
} elsif ( $return eq 'password_expired' ) { |
936 |
$info{password_has_expired} = 1; |
935 |
} |
937 |
} |
936 |
} |
938 |
} |
937 |
} |
939 |
} |
Lines 1316-1322
sub checkauth {
Link Here
|
1316 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
1318 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
1317 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
1319 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
1318 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1320 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1319 |
too_many_login_attempts => ( $patron and $patron->account_locked ) |
1321 |
too_many_login_attempts => ( $patron and $patron->account_locked ), |
|
|
1322 |
password_has_expired => ( $patron and $patron->password_expired ) |
1320 |
); |
1323 |
); |
1321 |
|
1324 |
|
1322 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
1325 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
Lines 1693-1698
sub check_cookie_auth {
Link Here
|
1693 |
|
1696 |
|
1694 |
} elsif ( $userid ) { |
1697 |
} elsif ( $userid ) { |
1695 |
$session->param( 'lasttime', time() ); |
1698 |
$session->param( 'lasttime', time() ); |
|
|
1699 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
1700 |
$patron = Koha::Patron->find({ cardnumber => $userid }) unless $patron; |
1701 |
return ("password_expired", undef ) if $patron->password_expired; |
1696 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1702 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1697 |
if ($flags) { |
1703 |
if ($flags) { |
1698 |
C4::Context->_new_userenv($sessionID); |
1704 |
C4::Context->_new_userenv($sessionID); |
Lines 1801-1808
sub checkpw {
Link Here
|
1801 |
# 0 if auth is nok |
1807 |
# 0 if auth is nok |
1802 |
# -1 if user bind failed (LDAP only) |
1808 |
# -1 if user bind failed (LDAP only) |
1803 |
|
1809 |
|
1804 |
if ( $patron and $patron->account_locked ) { |
1810 |
if ( $patron and ( $patron->account_locked || $patron->password_expired ) ) { |
1805 |
# Nothing to check, account is locked |
1811 |
# Nothing to check, account is locked or password expired |
1806 |
} elsif ($ldap && defined($password)) { |
1812 |
} elsif ($ldap && defined($password)) { |
1807 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
1813 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
1808 |
if ( $retval == 1 ) { |
1814 |
if ( $retval == 1 ) { |