Lines 746-751
sub checkauth {
Link Here
|
746 |
my $authnotrequired = shift; |
746 |
my $authnotrequired = shift; |
747 |
my $flagsrequired = shift; |
747 |
my $flagsrequired = shift; |
748 |
my $type = shift; |
748 |
my $type = shift; |
|
|
749 |
my $emailaddress = shift; |
749 |
$type = 'opac' unless $type; |
750 |
$type = 'opac' unless $type; |
750 |
|
751 |
|
751 |
my $dbh = C4::Context->dbh; |
752 |
my $dbh = C4::Context->dbh; |
Lines 786-791
sub checkauth {
Link Here
|
786 |
); |
787 |
); |
787 |
$loggedin = 1; |
788 |
$loggedin = 1; |
788 |
} |
789 |
} |
|
|
790 |
elsif ( $emailaddress) { |
791 |
# the Google OpenID Connect passes an email address |
792 |
} |
789 |
elsif ( $sessionID = $query->cookie("CGISESSID") ) |
793 |
elsif ( $sessionID = $query->cookie("CGISESSID") ) |
790 |
{ # assignment, not comparison |
794 |
{ # assignment, not comparison |
791 |
my $session = get_session($sessionID); |
795 |
my $session = get_session($sessionID); |
Lines 923-929
sub checkauth {
Link Here
|
923 |
if ( ( $cas && $query->param('ticket') ) |
927 |
if ( ( $cas && $query->param('ticket') ) |
924 |
|| $userid |
928 |
|| $userid |
925 |
|| ( $shib && $shib_login ) |
929 |
|| ( $shib && $shib_login ) |
926 |
|| $pki_field ne 'None' ) |
930 |
|| $pki_field ne 'None' |
|
|
931 |
|| $emailaddress ) |
927 |
{ |
932 |
{ |
928 |
my $password = $query->param('password'); |
933 |
my $password = $query->param('password'); |
929 |
my $shibSuccess = 0; |
934 |
my $shibSuccess = 0; |
Lines 951-956
sub checkauth {
Link Here
|
951 |
$info{'invalidCasLogin'} = 1 unless ($return); |
956 |
$info{'invalidCasLogin'} = 1 unless ($return); |
952 |
} |
957 |
} |
953 |
|
958 |
|
|
|
959 |
elsif ( $emailaddress ) { |
960 |
my $value = $emailaddress; |
961 |
|
962 |
# If we're looking up the email, there's a chance that the person |
963 |
# doesn't have a userid. So if there is none, we pass along the |
964 |
# borrower number, and the bits of code that need to know the user |
965 |
# ID will have to be smart enough to handle that. |
966 |
require C4::Members; |
967 |
my @users_info = C4::Members::GetBorrowersWithEmail($value); |
968 |
if (@users_info) { |
969 |
|
970 |
# First the userid, then the borrowernum |
971 |
$value = $users_info[0][1] || $users_info[0][0]; |
972 |
} else { |
973 |
undef $value; |
974 |
} |
975 |
$return = $value ? 1 : 0; |
976 |
$userid = $value; |
977 |
} |
978 |
|
954 |
elsif ( |
979 |
elsif ( |
955 |
( $pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'} ) |
980 |
( $pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'} ) |
956 |
|| ( $pki_field eq 'emailAddress' |
981 |
|| ( $pki_field eq 'emailAddress' |
957 |
- |
|
|