Lines 966-971
sub checkauth {
Link Here
|
966 |
$info{oldip} = $more_info->{old_ip}; |
966 |
$info{oldip} = $more_info->{old_ip}; |
967 |
$info{newip} = $more_info->{new_ip}; |
967 |
$info{newip} = $more_info->{new_ip}; |
968 |
$info{different_ip} = 1; |
968 |
$info{different_ip} = 1; |
|
|
969 |
} elsif ( $return eq 'password_expired' ) { |
970 |
$info{password_has_expired} = 1; |
969 |
} |
971 |
} |
970 |
} |
972 |
} |
971 |
} |
973 |
} |
Lines 1404-1410
sub checkauth {
Link Here
|
1404 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
1406 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
1405 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
1407 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
1406 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1408 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1407 |
too_many_login_attempts => ( $patron and $patron->account_locked ) |
1409 |
too_many_login_attempts => ( $patron and $patron->account_locked ), |
|
|
1410 |
password_has_expired => ( $patron and $patron->password_expired ) |
1408 |
); |
1411 |
); |
1409 |
|
1412 |
|
1410 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
1413 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
Lines 1792-1797
sub check_cookie_auth {
Link Here
|
1792 |
|
1795 |
|
1793 |
} elsif ( $userid ) { |
1796 |
} elsif ( $userid ) { |
1794 |
$session->param( 'lasttime', time() ); |
1797 |
$session->param( 'lasttime', time() ); |
|
|
1798 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
1799 |
$patron = Koha::Patron->find({ cardnumber => $userid }) unless $patron; |
1800 |
return ("password_expired", undef ) if $patron->password_expired; |
1795 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1801 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1796 |
if ($flags) { |
1802 |
if ($flags) { |
1797 |
C4::Context->_new_userenv($sessionID); |
1803 |
C4::Context->_new_userenv($sessionID); |
Lines 1903-1910
sub checkpw {
Link Here
|
1903 |
# 0 if auth is nok |
1909 |
# 0 if auth is nok |
1904 |
# -1 if user bind failed (LDAP only) |
1910 |
# -1 if user bind failed (LDAP only) |
1905 |
|
1911 |
|
1906 |
if ( $patron and $patron->account_locked ) { |
1912 |
if ( $patron and ( $patron->account_locked || $patron->password_expired ) ) { |
1907 |
# Nothing to check, account is locked |
1913 |
# Nothing to check, account is locked or password expired |
1908 |
} elsif ($ldap && defined($password)) { |
1914 |
} elsif ($ldap && defined($password)) { |
1909 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
1915 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
1910 |
if ( $retval == 1 ) { |
1916 |
if ( $retval == 1 ) { |