|
Lines 942-947
sub checkauth {
Link Here
|
| 942 |
$info{oldip} = $more_info->{old_ip}; |
942 |
$info{oldip} = $more_info->{old_ip}; |
| 943 |
$info{newip} = $more_info->{new_ip}; |
943 |
$info{newip} = $more_info->{new_ip}; |
| 944 |
$info{different_ip} = 1; |
944 |
$info{different_ip} = 1; |
|
|
945 |
} elsif ( $return eq 'password_expired' ) { |
| 946 |
$info{password_has_expired} = 1; |
| 945 |
} |
947 |
} |
| 946 |
} |
948 |
} |
| 947 |
} |
949 |
} |
|
Lines 1333-1339
sub checkauth {
Link Here
|
| 1333 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
1335 |
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), |
| 1334 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
1336 |
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), |
| 1335 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1337 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
| 1336 |
too_many_login_attempts => ( $patron and $patron->account_locked ) |
1338 |
too_many_login_attempts => ( $patron and $patron->account_locked ), |
|
|
1339 |
password_has_expired => ( $patron and $patron->password_expired ) |
| 1337 |
); |
1340 |
); |
| 1338 |
|
1341 |
|
| 1339 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
1342 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
|
Lines 1723-1728
sub check_cookie_auth {
Link Here
|
| 1723 |
return ( "restricted", undef, { old_ip => $ip, new_ip => $remote_addr}); |
1726 |
return ( "restricted", undef, { old_ip => $ip, new_ip => $remote_addr}); |
| 1724 |
} elsif ( $userid ) { |
1727 |
} elsif ( $userid ) { |
| 1725 |
$session->param( 'lasttime', time() ); |
1728 |
$session->param( 'lasttime', time() ); |
|
|
1729 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
| 1730 |
$patron = Koha::Patron->find({ cardnumber => $userid }) unless $patron; |
| 1731 |
return ("password_expired", undef ) if $patron->password_expired; |
| 1726 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1732 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
| 1727 |
if ($flags) { |
1733 |
if ($flags) { |
| 1728 |
return ( "ok", $session ); |
1734 |
return ( "ok", $session ); |
|
Lines 1814-1821
sub checkpw {
Link Here
|
| 1814 |
# 0 if auth is nok |
1820 |
# 0 if auth is nok |
| 1815 |
# -1 if user bind failed (LDAP only) |
1821 |
# -1 if user bind failed (LDAP only) |
| 1816 |
|
1822 |
|
| 1817 |
if ( $patron and $patron->account_locked ) { |
1823 |
if ( $patron and ( $patron->account_locked || $patron->password_expired ) ) { |
| 1818 |
# Nothing to check, account is locked |
1824 |
# Nothing to check, account is locked or password expired |
| 1819 |
} elsif ($ldap && defined($password)) { |
1825 |
} elsif ($ldap && defined($password)) { |
| 1820 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
1826 |
my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_); # EXTERNAL AUTH |
| 1821 |
if ( $retval == 1 ) { |
1827 |
if ( $retval == 1 ) { |