Lines 259-267
sub get_template_and_user {
Link Here
|
259 |
-sameSite => 'Lax', |
259 |
-sameSite => 'Lax', |
260 |
)); |
260 |
)); |
261 |
|
261 |
|
|
|
262 |
my $auth_error = $in->{query}->param('auth_error'); |
263 |
|
262 |
$template->param( |
264 |
$template->param( |
263 |
loginprompt => 1, |
265 |
loginprompt => 1, |
264 |
script_name => get_script_name(), |
266 |
script_name => get_script_name(), |
|
|
267 |
auth_error => $auth_error, |
265 |
); |
268 |
); |
266 |
|
269 |
|
267 |
print $in->{query}->header( |
270 |
print $in->{query}->header( |
Lines 1328-1333
sub checkauth {
Link Here
|
1328 |
$LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg; |
1331 |
$LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg; |
1329 |
|
1332 |
|
1330 |
my $auth_template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt'; |
1333 |
my $auth_template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt'; |
|
|
1334 |
my $auth_error = $query->param('auth_error'); |
1331 |
my $template = C4::Templates::gettemplate( $auth_template_name, $type, $query ); |
1335 |
my $template = C4::Templates::gettemplate( $auth_template_name, $type, $query ); |
1332 |
$template->param( |
1336 |
$template->param( |
1333 |
login => 1, |
1337 |
login => 1, |
Lines 1365-1370
sub checkauth {
Link Here
|
1365 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1369 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1366 |
too_many_login_attempts => ( $patron and $patron->account_locked ), |
1370 |
too_many_login_attempts => ( $patron and $patron->account_locked ), |
1367 |
password_has_expired => ( $patron and $patron->password_expired ), |
1371 |
password_has_expired => ( $patron and $patron->password_expired ), |
|
|
1372 |
auth_error => $auth_error, |
1368 |
); |
1373 |
); |
1369 |
|
1374 |
|
1370 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
1375 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
Lines 1542-1547
sub check_api_auth {
Link Here
|
1542 |
# new login |
1547 |
# new login |
1543 |
my $userid = $query->param('userid'); |
1548 |
my $userid = $query->param('userid'); |
1544 |
my $password = $query->param('password'); |
1549 |
my $password = $query->param('password'); |
|
|
1550 |
my $auth_client_login = $query->param('auth_client_login'); |
1545 |
my ( $return, $cardnumber, $cas_ticket ); |
1551 |
my ( $return, $cardnumber, $cas_ticket ); |
1546 |
|
1552 |
|
1547 |
# Proxy CAS auth |
1553 |
# Proxy CAS auth |
Lines 1551-1556
sub check_api_auth {
Link Here
|
1551 |
# In case of a CAS authentication, we use the ticket instead of the password |
1557 |
# In case of a CAS authentication, we use the ticket instead of the password |
1552 |
my $PT = $query->param('PT'); |
1558 |
my $PT = $query->param('PT'); |
1553 |
( $return, $cardnumber, $userid, $cas_ticket ) = check_api_auth_cas( $PT, $query ); # EXTERNAL AUTH |
1559 |
( $return, $cardnumber, $userid, $cas_ticket ) = check_api_auth_cas( $PT, $query ); # EXTERNAL AUTH |
|
|
1560 |
} elsif ( $auth_client_login && ( $userid || $query->param('cardnumber') ) ) { |
1561 |
$cardnumber = $query->param('cardnumber'); |
1562 |
$return = 1; |
1554 |
} else { |
1563 |
} else { |
1555 |
|
1564 |
|
1556 |
# User / password auth |
1565 |
# User / password auth |
Lines 1755-1761
sub check_cookie_auth {
Link Here
|
1755 |
} elsif ( $userid ) { |
1764 |
} elsif ( $userid ) { |
1756 |
$session->param( 'lasttime', time() ); |
1765 |
$session->param( 'lasttime', time() ); |
1757 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
1766 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
1758 |
$patron = Koha::Patron->find({ cardnumber => $userid }) unless $patron; |
1767 |
$patron = Koha::Patrons->find({ cardnumber => $userid }) |
|
|
1768 |
unless $patron; |
1759 |
return ("password_expired", undef ) if $patron->password_expired; |
1769 |
return ("password_expired", undef ) if $patron->password_expired; |
1760 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1770 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1761 |
if ($flags) { |
1771 |
if ($flags) { |
1762 |
- |
|
|