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 1336-1341
sub checkauth {
Link Here
|
1336 |
$LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg; |
1339 |
$LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg; |
1337 |
|
1340 |
|
1338 |
my $auth_template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt'; |
1341 |
my $auth_template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt'; |
|
|
1342 |
my $auth_error = $query->param('auth_error'); |
1339 |
my $template = C4::Templates::gettemplate( $auth_template_name, $type, $query ); |
1343 |
my $template = C4::Templates::gettemplate( $auth_template_name, $type, $query ); |
1340 |
$template->param( |
1344 |
$template->param( |
1341 |
login => 1, |
1345 |
login => 1, |
Lines 1373-1378
sub checkauth {
Link Here
|
1373 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1377 |
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, |
1374 |
too_many_login_attempts => ( $patron and $patron->account_locked ), |
1378 |
too_many_login_attempts => ( $patron and $patron->account_locked ), |
1375 |
password_has_expired => ( $patron and $patron->password_expired ), |
1379 |
password_has_expired => ( $patron and $patron->password_expired ), |
|
|
1380 |
auth_error => $auth_error, |
1376 |
); |
1381 |
); |
1377 |
|
1382 |
|
1378 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
1383 |
$template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); |
Lines 1556-1561
sub check_api_auth {
Link Here
|
1556 |
# new login |
1561 |
# new login |
1557 |
my $userid = $query->param('userid'); |
1562 |
my $userid = $query->param('userid'); |
1558 |
my $password = $query->param('password'); |
1563 |
my $password = $query->param('password'); |
|
|
1564 |
my $auth_client_login = $query->param('auth_client_login'); |
1559 |
my ( $return, $cardnumber, $cas_ticket ); |
1565 |
my ( $return, $cardnumber, $cas_ticket ); |
1560 |
|
1566 |
|
1561 |
# Proxy CAS auth |
1567 |
# Proxy CAS auth |
Lines 1565-1570
sub check_api_auth {
Link Here
|
1565 |
# In case of a CAS authentication, we use the ticket instead of the password |
1571 |
# In case of a CAS authentication, we use the ticket instead of the password |
1566 |
my $PT = $query->param('PT'); |
1572 |
my $PT = $query->param('PT'); |
1567 |
( $return, $cardnumber, $userid, $cas_ticket ) = check_api_auth_cas( $PT, $query ); # EXTERNAL AUTH |
1573 |
( $return, $cardnumber, $userid, $cas_ticket ) = check_api_auth_cas( $PT, $query ); # EXTERNAL AUTH |
|
|
1574 |
} elsif ( $auth_client_login && ( $userid || $query->param('cardnumber') ) ) { |
1575 |
$cardnumber = $query->param('cardnumber'); |
1576 |
$return = 1; |
1568 |
} else { |
1577 |
} else { |
1569 |
|
1578 |
|
1570 |
# User / password auth |
1579 |
# User / password auth |
Lines 1769-1775
sub check_cookie_auth {
Link Here
|
1769 |
} elsif ( $userid ) { |
1778 |
} elsif ( $userid ) { |
1770 |
$session->param( 'lasttime', time() ); |
1779 |
$session->param( 'lasttime', time() ); |
1771 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
1780 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
1772 |
$patron = Koha::Patron->find({ cardnumber => $userid }) unless $patron; |
1781 |
$patron = Koha::Patrons->find({ cardnumber => $userid }) |
|
|
1782 |
unless $patron; |
1773 |
return ("password_expired", undef ) if $patron->password_expired; |
1783 |
return ("password_expired", undef ) if $patron->password_expired; |
1774 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1784 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1775 |
if ($flags) { |
1785 |
if ($flags) { |
1776 |
- |
|
|