|
Lines 836-842
sub checkauth {
Link Here
|
| 836 |
$session->param('cardnumber'), $session->param('firstname'), |
836 |
$session->param('cardnumber'), $session->param('firstname'), |
| 837 |
$session->param('surname'), $session->param('branch'), |
837 |
$session->param('surname'), $session->param('branch'), |
| 838 |
$session->param('branchname'), $session->param('flags'), |
838 |
$session->param('branchname'), $session->param('flags'), |
| 839 |
$session->param('emailaddress'), $session->param('branchprinter'), |
839 |
$session->param('emailaddress'), |
| 840 |
$session->param('shibboleth') |
840 |
$session->param('shibboleth') |
| 841 |
); |
841 |
); |
| 842 |
C4::Context::set_shelves_userenv( 'bar', $session->param('barshelves') ); |
842 |
C4::Context::set_shelves_userenv( 'bar', $session->param('barshelves') ); |
|
Lines 1059-1072
sub checkauth {
Link Here
|
| 1059 |
C4::Context->_unset_userenv($sessionID); |
1059 |
C4::Context->_unset_userenv($sessionID); |
| 1060 |
} |
1060 |
} |
| 1061 |
my ( $borrowernumber, $firstname, $surname, $userflags, |
1061 |
my ( $borrowernumber, $firstname, $surname, $userflags, |
| 1062 |
$branchcode, $branchname, $branchprinter, $emailaddress ); |
1062 |
$branchcode, $branchname, $emailaddress ); |
| 1063 |
|
1063 |
|
| 1064 |
if ( $return == 1 ) { |
1064 |
if ( $return == 1 ) { |
| 1065 |
my $select = " |
1065 |
my $select = " |
| 1066 |
SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, |
1066 |
SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, |
| 1067 |
branches.branchname as branchname, |
1067 |
branches.branchname as branchname, email |
| 1068 |
branches.branchprinter as branchprinter, |
|
|
| 1069 |
email |
| 1070 |
FROM borrowers |
1068 |
FROM borrowers |
| 1071 |
LEFT JOIN branches on borrowers.branchcode=branches.branchcode |
1069 |
LEFT JOIN branches on borrowers.branchcode=branches.branchcode |
| 1072 |
"; |
1070 |
"; |
|
Lines 1087-1093
sub checkauth {
Link Here
|
| 1087 |
} |
1085 |
} |
| 1088 |
if ( $sth->rows ) { |
1086 |
if ( $sth->rows ) { |
| 1089 |
( $borrowernumber, $firstname, $surname, $userflags, |
1087 |
( $borrowernumber, $firstname, $surname, $userflags, |
| 1090 |
$branchcode, $branchname, $branchprinter, $emailaddress ) = $sth->fetchrow; |
1088 |
$branchcode, $branchname, $emailaddress ) = $sth->fetchrow; |
| 1091 |
$debug and print STDERR "AUTH_3 results: " . |
1089 |
$debug and print STDERR "AUTH_3 results: " . |
| 1092 |
"$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n"; |
1090 |
"$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n"; |
| 1093 |
} else { |
1091 |
} else { |
|
Lines 1129-1136
sub checkauth {
Link Here
|
| 1129 |
if ( $domain && $ip =~ /^$domain/ ) { |
1127 |
if ( $domain && $ip =~ /^$domain/ ) { |
| 1130 |
$branchcode = $branches->{$br}->{'branchcode'}; |
1128 |
$branchcode = $branches->{$br}->{'branchcode'}; |
| 1131 |
|
1129 |
|
| 1132 |
# new op dev : add the branchprinter and branchname in the cookie |
1130 |
# new op dev : add the branchname to the cookie |
| 1133 |
$branchprinter = $branches->{$br}->{'branchprinter'}; |
|
|
| 1134 |
$branchname = $branches->{$br}->{'branchname'}; |
1131 |
$branchname = $branches->{$br}->{'branchname'}; |
| 1135 |
} |
1132 |
} |
| 1136 |
} |
1133 |
} |
|
Lines 1154-1161
sub checkauth {
Link Here
|
| 1154 |
$session->param('cardnumber'), $session->param('firstname'), |
1151 |
$session->param('cardnumber'), $session->param('firstname'), |
| 1155 |
$session->param('surname'), $session->param('branch'), |
1152 |
$session->param('surname'), $session->param('branch'), |
| 1156 |
$session->param('branchname'), $session->param('flags'), |
1153 |
$session->param('branchname'), $session->param('flags'), |
| 1157 |
$session->param('emailaddress'), $session->param('branchprinter'), |
1154 |
$session->param('emailaddress'), $session->param('shibboleth') |
| 1158 |
$session->param('shibboleth') |
|
|
| 1159 |
); |
1155 |
); |
| 1160 |
|
1156 |
|
| 1161 |
} |
1157 |
} |
|
Lines 1422-1428
sub check_api_auth {
Link Here
|
| 1422 |
$session->param('cardnumber'), $session->param('firstname'), |
1418 |
$session->param('cardnumber'), $session->param('firstname'), |
| 1423 |
$session->param('surname'), $session->param('branch'), |
1419 |
$session->param('surname'), $session->param('branch'), |
| 1424 |
$session->param('branchname'), $session->param('flags'), |
1420 |
$session->param('branchname'), $session->param('flags'), |
| 1425 |
$session->param('emailaddress'), $session->param('branchprinter') |
1421 |
$session->param('emailaddress') |
| 1426 |
); |
1422 |
); |
| 1427 |
|
1423 |
|
| 1428 |
my $ip = $session->param('ip'); |
1424 |
my $ip = $session->param('ip'); |
|
Lines 1510-1544
sub check_api_auth {
Link Here
|
| 1510 |
my ( |
1506 |
my ( |
| 1511 |
$borrowernumber, $firstname, $surname, |
1507 |
$borrowernumber, $firstname, $surname, |
| 1512 |
$userflags, $branchcode, $branchname, |
1508 |
$userflags, $branchcode, $branchname, |
| 1513 |
$branchprinter, $emailaddress |
1509 |
$emailaddress |
| 1514 |
); |
1510 |
); |
| 1515 |
my $sth = |
1511 |
my $sth = |
| 1516 |
$dbh->prepare( |
1512 |
$dbh->prepare( |
| 1517 |
"select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname,branches.branchprinter as branchprinter, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where userid=?" |
1513 |
"select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where userid=?" |
| 1518 |
); |
1514 |
); |
| 1519 |
$sth->execute($userid); |
1515 |
$sth->execute($userid); |
| 1520 |
( |
1516 |
( |
| 1521 |
$borrowernumber, $firstname, $surname, |
1517 |
$borrowernumber, $firstname, $surname, |
| 1522 |
$userflags, $branchcode, $branchname, |
1518 |
$userflags, $branchcode, $branchname, |
| 1523 |
$branchprinter, $emailaddress |
1519 |
$emailaddress |
| 1524 |
) = $sth->fetchrow if ( $sth->rows ); |
1520 |
) = $sth->fetchrow if ( $sth->rows ); |
| 1525 |
|
1521 |
|
| 1526 |
unless ( $sth->rows ) { |
1522 |
unless ( $sth->rows ) { |
| 1527 |
my $sth = $dbh->prepare( |
1523 |
my $sth = $dbh->prepare( |
| 1528 |
"select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname, branches.branchprinter as branchprinter, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where cardnumber=?" |
1524 |
"select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where cardnumber=?" |
| 1529 |
); |
1525 |
); |
| 1530 |
$sth->execute($cardnumber); |
1526 |
$sth->execute($cardnumber); |
| 1531 |
( |
1527 |
( |
| 1532 |
$borrowernumber, $firstname, $surname, |
1528 |
$borrowernumber, $firstname, $surname, |
| 1533 |
$userflags, $branchcode, $branchname, |
1529 |
$userflags, $branchcode, $branchname, |
| 1534 |
$branchprinter, $emailaddress |
1530 |
$emailaddress |
| 1535 |
) = $sth->fetchrow if ( $sth->rows ); |
1531 |
) = $sth->fetchrow if ( $sth->rows ); |
| 1536 |
|
1532 |
|
| 1537 |
unless ( $sth->rows ) { |
1533 |
unless ( $sth->rows ) { |
| 1538 |
$sth->execute($userid); |
1534 |
$sth->execute($userid); |
| 1539 |
( |
1535 |
( |
| 1540 |
$borrowernumber, $firstname, $surname, $userflags, |
1536 |
$borrowernumber, $firstname, $surname, $userflags, |
| 1541 |
$branchcode, $branchname, $branchprinter, $emailaddress |
1537 |
$branchcode, $branchname, $emailaddress |
| 1542 |
) = $sth->fetchrow if ( $sth->rows ); |
1538 |
) = $sth->fetchrow if ( $sth->rows ); |
| 1543 |
} |
1539 |
} |
| 1544 |
} |
1540 |
} |
|
Lines 1559-1566
sub check_api_auth {
Link Here
|
| 1559 |
if ( $domain && $ip =~ /^$domain/ ) { |
1555 |
if ( $domain && $ip =~ /^$domain/ ) { |
| 1560 |
$branchcode = $branches->{$br}->{'branchcode'}; |
1556 |
$branchcode = $branches->{$br}->{'branchcode'}; |
| 1561 |
|
1557 |
|
| 1562 |
# new op dev : add the branchprinter and branchname in the cookie |
1558 |
# new op dev : add the branchname to the cookie |
| 1563 |
$branchprinter = $branches->{$br}->{'branchprinter'}; |
|
|
| 1564 |
$branchname = $branches->{$br}->{'branchname'}; |
1559 |
$branchname = $branches->{$br}->{'branchname'}; |
| 1565 |
} |
1560 |
} |
| 1566 |
} |
1561 |
} |
|
Lines 1582-1588
sub check_api_auth {
Link Here
|
| 1582 |
$session->param('cardnumber'), $session->param('firstname'), |
1577 |
$session->param('cardnumber'), $session->param('firstname'), |
| 1583 |
$session->param('surname'), $session->param('branch'), |
1578 |
$session->param('surname'), $session->param('branch'), |
| 1584 |
$session->param('branchname'), $session->param('flags'), |
1579 |
$session->param('branchname'), $session->param('flags'), |
| 1585 |
$session->param('emailaddress'), $session->param('branchprinter') |
1580 |
$session->param('emailaddress') |
| 1586 |
); |
1581 |
); |
| 1587 |
return ( "ok", $cookie, $sessionID ); |
1582 |
return ( "ok", $cookie, $sessionID ); |
| 1588 |
} else { |
1583 |
} else { |
|
Lines 1665-1671
sub check_cookie_auth {
Link Here
|
| 1665 |
$session->param('cardnumber'), $session->param('firstname'), |
1660 |
$session->param('cardnumber'), $session->param('firstname'), |
| 1666 |
$session->param('surname'), $session->param('branch'), |
1661 |
$session->param('surname'), $session->param('branch'), |
| 1667 |
$session->param('branchname'), $session->param('flags'), |
1662 |
$session->param('branchname'), $session->param('flags'), |
| 1668 |
$session->param('emailaddress'), $session->param('branchprinter') |
1663 |
$session->param('emailaddress') |
| 1669 |
); |
1664 |
); |
| 1670 |
|
1665 |
|
| 1671 |
my $ip = $session->param('ip'); |
1666 |
my $ip = $session->param('ip'); |