|
Lines 305-314
sub get_template_and_user {
Link Here
|
| 305 |
} |
305 |
} |
| 306 |
else { # if this is an anonymous session, setup to display public lists... |
306 |
else { # if this is an anonymous session, setup to display public lists... |
| 307 |
|
307 |
|
| 308 |
# If shibboleth is enabled, and we're in an anonymous session, we should allow |
308 |
# If shibboleth is enabled, and we're in an anonymous session, we should allow |
| 309 |
# the user to attemp login via shibboleth. |
309 |
# the user to attemp login via shibboleth. |
| 310 |
if ( $shib ) { |
310 |
if ( $shib ) { |
| 311 |
$template->param( shibbolethAuthentication => $shib, |
311 |
$template->param( shibbolethAuthentication => $shib, |
| 312 |
shibbolethLoginUrl => login_shib_url($in->{'query'}), |
312 |
shibbolethLoginUrl => login_shib_url($in->{'query'}), |
| 313 |
); |
313 |
); |
| 314 |
# If shibboleth is enabled and we have a shibboleth login attribute, |
314 |
# If shibboleth is enabled and we have a shibboleth login attribute, |
|
Lines 761-767
sub checkauth {
Link Here
|
| 761 |
} |
761 |
} |
| 762 |
elsif ($logout) { |
762 |
elsif ($logout) { |
| 763 |
# voluntary logout the user |
763 |
# voluntary logout the user |
| 764 |
# check wether the user was using their shibboleth session or a local one |
764 |
# check wether the user was using their shibboleth session or a local one |
| 765 |
my $shibSuccess = C4::Context->userenv->{'shibboleth'}; |
765 |
my $shibSuccess = C4::Context->userenv->{'shibboleth'}; |
| 766 |
$session->delete(); |
766 |
$session->delete(); |
| 767 |
$session->flush; |
767 |
$session->flush; |
|
Lines 853-873
sub checkauth {
Link Here
|
| 853 |
|| $persona ) |
853 |
|| $persona ) |
| 854 |
{ |
854 |
{ |
| 855 |
my $password = $query->param('password'); |
855 |
my $password = $query->param('password'); |
| 856 |
my $shibSuccess = 0; |
856 |
my $shibSuccess = 0; |
| 857 |
|
857 |
|
| 858 |
my ( $return, $cardnumber ); |
858 |
my ( $return, $cardnumber ); |
| 859 |
# If shib is enabled and we have a shib login, does the login match a valid koha user |
859 |
# If shib is enabled and we have a shib login, does the login match a valid koha user |
| 860 |
if ( $shib && $shib_login && $type eq 'opac' ) { |
860 |
if ( $shib && $shib_login && $type eq 'opac' ) { |
| 861 |
my $retuserid; |
861 |
my $retuserid; |
| 862 |
# Do not pass password here, else shib will not be checked in checkpw. |
862 |
# Do not pass password here, else shib will not be checked in checkpw. |
| 863 |
( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, undef, $query ); |
863 |
( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, undef, $query ); |
| 864 |
$userid = $retuserid; |
864 |
$userid = $retuserid; |
| 865 |
$shibSuccess = $return; |
865 |
$shibSuccess = $return; |
| 866 |
$info{'invalidShibLogin'} = 1 unless ($return); |
866 |
$info{'invalidShibLogin'} = 1 unless ($return); |
| 867 |
} |
867 |
} |
| 868 |
# If shib login and match were successfull, skip further login methods |
868 |
# If shib login and match were successfull, skip further login methods |
| 869 |
unless ( $shibSuccess ) { |
869 |
unless ( $shibSuccess ) { |
| 870 |
if ( $cas && $query->param('ticket') ) { |
870 |
if ( $cas && $query->param('ticket') ) { |
| 871 |
my $retuserid; |
871 |
my $retuserid; |
| 872 |
( $return, $cardnumber, $retuserid ) = |
872 |
( $return, $cardnumber, $retuserid ) = |
| 873 |
checkpw( $dbh, $userid, $password, $query ); |
873 |
checkpw( $dbh, $userid, $password, $query ); |
|
Lines 934-940
sub checkauth {
Link Here
|
| 934 |
( $return, $cardnumber, $retuserid ) = |
934 |
( $return, $cardnumber, $retuserid ) = |
| 935 |
checkpw( $dbh, $userid, $password, $query ); |
935 |
checkpw( $dbh, $userid, $password, $query ); |
| 936 |
$userid = $retuserid if ( $retuserid ); |
936 |
$userid = $retuserid if ( $retuserid ); |
| 937 |
$info{'invalid_username_or_password'} = 1 unless ($return); |
937 |
$info{'invalid_username_or_password'} = 1 unless ($return); |
| 938 |
} } |
938 |
} } |
| 939 |
if ($return) { |
939 |
if ($return) { |
| 940 |
#_session_log(sprintf "%20s from %16s logged in at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime)); |
940 |
#_session_log(sprintf "%20s from %16s logged in at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime)); |
|
Lines 1023-1029
sub checkauth {
Link Here
|
| 1023 |
$session->param('emailaddress',$emailaddress); |
1023 |
$session->param('emailaddress',$emailaddress); |
| 1024 |
$session->param('ip',$session->remote_addr()); |
1024 |
$session->param('ip',$session->remote_addr()); |
| 1025 |
$session->param('lasttime',time()); |
1025 |
$session->param('lasttime',time()); |
| 1026 |
$session->param('shibboleth',$shibSuccess); |
1026 |
$session->param('shibboleth',$shibSuccess); |
| 1027 |
$debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ; |
1027 |
$debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ; |
| 1028 |
} |
1028 |
} |
| 1029 |
elsif ( $return == 2 ) { |
1029 |
elsif ( $return == 2 ) { |