|
Lines 29-34
use C4::Context;
Link Here
|
| 29 |
use C4::Templates; # to get the template |
29 |
use C4::Templates; # to get the template |
| 30 |
use C4::Languages; |
30 |
use C4::Languages; |
| 31 |
use C4::Branch; # GetBranches |
31 |
use C4::Branch; # GetBranches |
|
|
32 |
use C4::Desks; |
| 32 |
use C4::Search::History; |
33 |
use C4::Search::History; |
| 33 |
use Koha; |
34 |
use Koha; |
| 34 |
use Koha::AuthUtils qw(hash_password); |
35 |
use Koha::AuthUtils qw(hash_password); |
|
Lines 390-395
sub get_template_and_user {
Link Here
|
| 390 |
marcflavour => C4::Context->preference("marcflavour"), |
391 |
marcflavour => C4::Context->preference("marcflavour"), |
| 391 |
persona => C4::Context->preference("persona"), |
392 |
persona => C4::Context->preference("persona"), |
| 392 |
); |
393 |
); |
|
|
394 |
if (C4::Context->userenv->{"branch"}) { |
| 395 |
my $desksaref = GetDesks(C4::Context->userenv->{"branch"}); |
| 396 |
if ($#$desksaref > -1) { |
| 397 |
$template->param( |
| 398 |
LoginDeskcode => ( C4::Context->userenv ? C4::Context->userenv->{"deskcode"} : undef ), |
| 399 |
LoginDeskname => ( C4::Context->userenv ? C4::Context->userenv->{"deskname"} : undef ), |
| 400 |
HasDesk => (1), |
| 401 |
); |
| 402 |
} |
| 403 |
else { |
| 404 |
$template->param( |
| 405 |
HasDesk => (undef), |
| 406 |
); |
| 407 |
} |
| 408 |
} |
| 393 |
if ( $in->{'type'} eq "intranet" ) { |
409 |
if ( $in->{'type'} eq "intranet" ) { |
| 394 |
$template->param( |
410 |
$template->param( |
| 395 |
AmazonCoverImages => C4::Context->preference("AmazonCoverImages"), |
411 |
AmazonCoverImages => C4::Context->preference("AmazonCoverImages"), |
|
Lines 403-408
sub get_template_and_user {
Link Here
|
| 403 |
IntranetmainUserblock => C4::Context->preference("IntranetmainUserblock"), |
419 |
IntranetmainUserblock => C4::Context->preference("IntranetmainUserblock"), |
| 404 |
LibraryName => C4::Context->preference("LibraryName"), |
420 |
LibraryName => C4::Context->preference("LibraryName"), |
| 405 |
LoginBranchname => ( C4::Context->userenv ? C4::Context->userenv->{"branchname"} : undef ), |
421 |
LoginBranchname => ( C4::Context->userenv ? C4::Context->userenv->{"branchname"} : undef ), |
|
|
422 |
LoginDeskname => ( C4::Context->userenv ? C4::Context->userenv->{"deskname"} : undef ), |
| 406 |
advancedMARCEditor => C4::Context->preference("advancedMARCEditor"), |
423 |
advancedMARCEditor => C4::Context->preference("advancedMARCEditor"), |
| 407 |
canreservefromotherbranches => C4::Context->preference('canreservefromotherbranches'), |
424 |
canreservefromotherbranches => C4::Context->preference('canreservefromotherbranches'), |
| 408 |
intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), |
425 |
intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), |
|
Lines 475-480
sub get_template_and_user {
Link Here
|
| 475 |
LibraryName => "" . C4::Context->preference("LibraryName"), |
492 |
LibraryName => "" . C4::Context->preference("LibraryName"), |
| 476 |
LibraryNameTitle => "" . $LibraryNameTitle, |
493 |
LibraryNameTitle => "" . $LibraryNameTitle, |
| 477 |
LoginBranchname => C4::Context->userenv ? C4::Context->userenv->{"branchname"} : "", |
494 |
LoginBranchname => C4::Context->userenv ? C4::Context->userenv->{"branchname"} : "", |
|
|
495 |
Logindeskname => C4::Context->userenv ? C4::Context->userenv->{"deskname"} : "", |
| 478 |
OPACAmazonCoverImages => C4::Context->preference("OPACAmazonCoverImages"), |
496 |
OPACAmazonCoverImages => C4::Context->preference("OPACAmazonCoverImages"), |
| 479 |
OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"), |
497 |
OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"), |
| 480 |
OpacHighlightedWords => C4::Context->preference("OpacHighlightedWords"), |
498 |
OpacHighlightedWords => C4::Context->preference("OpacHighlightedWords"), |
|
Lines 765-771
sub checkauth {
Link Here
|
| 765 |
$session->param('surname'), $session->param('branch'), |
783 |
$session->param('surname'), $session->param('branch'), |
| 766 |
$session->param('branchname'), $session->param('flags'), |
784 |
$session->param('branchname'), $session->param('flags'), |
| 767 |
$session->param('emailaddress'), $session->param('branchprinter'), |
785 |
$session->param('emailaddress'), $session->param('branchprinter'), |
| 768 |
$session->param('persona'), $session->param('shibboleth') |
786 |
$session->param('persona'), $session->param('shibboleth'), |
|
|
787 |
$session->param('deskcode'), $session->param('deskname') |
| 769 |
); |
788 |
); |
| 770 |
C4::Context::set_shelves_userenv( 'bar', $session->param('barshelves') ); |
789 |
C4::Context::set_shelves_userenv( 'bar', $session->param('barshelves') ); |
| 771 |
C4::Context::set_shelves_userenv( 'pub', $session->param('pubshelves') ); |
790 |
C4::Context::set_shelves_userenv( 'pub', $session->param('pubshelves') ); |
|
Lines 989-995
sub checkauth {
Link Here
|
| 989 |
C4::Context->_unset_userenv($sessionID); |
1008 |
C4::Context->_unset_userenv($sessionID); |
| 990 |
} |
1009 |
} |
| 991 |
my ( $borrowernumber, $firstname, $surname, $userflags, |
1010 |
my ( $borrowernumber, $firstname, $surname, $userflags, |
| 992 |
$branchcode, $branchname, $branchprinter, $emailaddress ); |
1011 |
$branchcode, $branchname, $branchprinter, $emailaddress, |
|
|
1012 |
$deskcode, $deskname); |
| 993 |
|
1013 |
|
| 994 |
if ( $return == 1 ) { |
1014 |
if ( $return == 1 ) { |
| 995 |
my $select = " |
1015 |
my $select = " |
|
Lines 1065-1070
sub checkauth {
Link Here
|
| 1065 |
$session->param( 'surname', $surname ); |
1085 |
$session->param( 'surname', $surname ); |
| 1066 |
$session->param( 'branch', $branchcode ); |
1086 |
$session->param( 'branch', $branchcode ); |
| 1067 |
$session->param( 'branchname', $branchname ); |
1087 |
$session->param( 'branchname', $branchname ); |
|
|
1088 |
$session->param( 'deskcode', $deskcode ); |
| 1089 |
$session->param( 'deskname', $deskname ); |
| 1068 |
$session->param( 'flags', $userflags ); |
1090 |
$session->param( 'flags', $userflags ); |
| 1069 |
$session->param( 'emailaddress', $emailaddress ); |
1091 |
$session->param( 'emailaddress', $emailaddress ); |
| 1070 |
$session->param( 'ip', $session->remote_addr() ); |
1092 |
$session->param( 'ip', $session->remote_addr() ); |
|
Lines 1083-1088
sub checkauth {
Link Here
|
| 1083 |
$session->param( 'surname', C4::Context->config('user') ); |
1105 |
$session->param( 'surname', C4::Context->config('user') ); |
| 1084 |
$session->param( 'branch', 'NO_LIBRARY_SET' ); |
1106 |
$session->param( 'branch', 'NO_LIBRARY_SET' ); |
| 1085 |
$session->param( 'branchname', 'NO_LIBRARY_SET' ); |
1107 |
$session->param( 'branchname', 'NO_LIBRARY_SET' ); |
|
|
1108 |
$session->param( 'deskcode', 'NO_DESK_SET' ); |
| 1109 |
$session->param( 'deskname', 'NO_DESK_SET' ); |
| 1086 |
$session->param( 'flags', 1 ); |
1110 |
$session->param( 'flags', 1 ); |
| 1087 |
$session->param( 'emailaddress', C4::Context->preference('KohaAdminEmailAddress') ); |
1111 |
$session->param( 'emailaddress', C4::Context->preference('KohaAdminEmailAddress') ); |
| 1088 |
$session->param( 'ip', $session->remote_addr() ); |
1112 |
$session->param( 'ip', $session->remote_addr() ); |
|
Lines 1097-1103
sub checkauth {
Link Here
|
| 1097 |
$session->param('surname'), $session->param('branch'), |
1121 |
$session->param('surname'), $session->param('branch'), |
| 1098 |
$session->param('branchname'), $session->param('flags'), |
1122 |
$session->param('branchname'), $session->param('flags'), |
| 1099 |
$session->param('emailaddress'), $session->param('branchprinter'), |
1123 |
$session->param('emailaddress'), $session->param('branchprinter'), |
| 1100 |
$session->param('persona'), $session->param('shibboleth') |
1124 |
$session->param('persona'), $session->param('shibboleth'), |
|
|
1125 |
$session->param('deskcode'), $session->param('deskname') |
| 1101 |
); |
1126 |
); |
| 1102 |
|
1127 |
|
| 1103 |
} |
1128 |
} |
|
Lines 1346-1352
sub check_api_auth {
Link Here
|
| 1346 |
$session->param('cardnumber'), $session->param('firstname'), |
1371 |
$session->param('cardnumber'), $session->param('firstname'), |
| 1347 |
$session->param('surname'), $session->param('branch'), |
1372 |
$session->param('surname'), $session->param('branch'), |
| 1348 |
$session->param('branchname'), $session->param('flags'), |
1373 |
$session->param('branchname'), $session->param('flags'), |
| 1349 |
$session->param('emailaddress'), $session->param('branchprinter') |
1374 |
$session->param('emailaddress'), $session->param('branchprinter'), |
|
|
1375 |
$session->param('persona'), $session->param('shibboleth'), |
| 1376 |
$session->param('deskcode'), $session->param('deskname') |
| 1350 |
); |
1377 |
); |
| 1351 |
|
1378 |
|
| 1352 |
my $ip = $session->param('ip'); |
1379 |
my $ip = $session->param('ip'); |
|
Lines 1433-1439
sub check_api_auth {
Link Here
|
| 1433 |
my ( |
1460 |
my ( |
| 1434 |
$borrowernumber, $firstname, $surname, |
1461 |
$borrowernumber, $firstname, $surname, |
| 1435 |
$userflags, $branchcode, $branchname, |
1462 |
$userflags, $branchcode, $branchname, |
| 1436 |
$branchprinter, $emailaddress |
1463 |
$branchprinter, $emailaddress, $deskcode, |
|
|
1464 |
$deskname |
| 1437 |
); |
1465 |
); |
| 1438 |
my $sth = |
1466 |
my $sth = |
| 1439 |
$dbh->prepare( |
1467 |
$dbh->prepare( |
|
Lines 1494-1499
sub check_api_auth {
Link Here
|
| 1494 |
$session->param( 'surname', $surname ); |
1522 |
$session->param( 'surname', $surname ); |
| 1495 |
$session->param( 'branch', $branchcode ); |
1523 |
$session->param( 'branch', $branchcode ); |
| 1496 |
$session->param( 'branchname', $branchname ); |
1524 |
$session->param( 'branchname', $branchname ); |
|
|
1525 |
$session->param( 'deskcode', $deskcode ); |
| 1526 |
$session->param( 'deskname', $deskname ); |
| 1497 |
$session->param( 'flags', $userflags ); |
1527 |
$session->param( 'flags', $userflags ); |
| 1498 |
$session->param( 'emailaddress', $emailaddress ); |
1528 |
$session->param( 'emailaddress', $emailaddress ); |
| 1499 |
$session->param( 'ip', $session->remote_addr() ); |
1529 |
$session->param( 'ip', $session->remote_addr() ); |
|
Lines 1508-1513
sub check_api_auth {
Link Here
|
| 1508 |
$session->param( 'surname', C4::Context->config('user') ); |
1538 |
$session->param( 'surname', C4::Context->config('user') ); |
| 1509 |
$session->param( 'branch', 'NO_LIBRARY_SET' ); |
1539 |
$session->param( 'branch', 'NO_LIBRARY_SET' ); |
| 1510 |
$session->param( 'branchname', 'NO_LIBRARY_SET' ); |
1540 |
$session->param( 'branchname', 'NO_LIBRARY_SET' ); |
|
|
1541 |
$session->param( 'deskcode', 'NO_DESK_SET' ); |
| 1542 |
$session->param( 'deskname', 'NO_DESK_SET' ); |
| 1511 |
$session->param( 'flags', 1 ); |
1543 |
$session->param( 'flags', 1 ); |
| 1512 |
$session->param( 'emailaddress', C4::Context->preference('KohaAdminEmailAddress') ); |
1544 |
$session->param( 'emailaddress', C4::Context->preference('KohaAdminEmailAddress') ); |
| 1513 |
$session->param( 'ip', $session->remote_addr() ); |
1545 |
$session->param( 'ip', $session->remote_addr() ); |
|
Lines 1518-1524
sub check_api_auth {
Link Here
|
| 1518 |
$session->param('cardnumber'), $session->param('firstname'), |
1550 |
$session->param('cardnumber'), $session->param('firstname'), |
| 1519 |
$session->param('surname'), $session->param('branch'), |
1551 |
$session->param('surname'), $session->param('branch'), |
| 1520 |
$session->param('branchname'), $session->param('flags'), |
1552 |
$session->param('branchname'), $session->param('flags'), |
| 1521 |
$session->param('emailaddress'), $session->param('branchprinter') |
1553 |
$session->param('emailaddress'), $session->param('branchprinter'), |
|
|
1554 |
$session->param('persona'), $session->param('shibboleth'), |
| 1555 |
$session->param('deskcode'), $session->param('deskname'), |
| 1522 |
); |
1556 |
); |
| 1523 |
return ( "ok", $cookie, $sessionID ); |
1557 |
return ( "ok", $cookie, $sessionID ); |
| 1524 |
} else { |
1558 |
} else { |
|
Lines 1599-1605
sub check_cookie_auth {
Link Here
|
| 1599 |
$session->param('cardnumber'), $session->param('firstname'), |
1633 |
$session->param('cardnumber'), $session->param('firstname'), |
| 1600 |
$session->param('surname'), $session->param('branch'), |
1634 |
$session->param('surname'), $session->param('branch'), |
| 1601 |
$session->param('branchname'), $session->param('flags'), |
1635 |
$session->param('branchname'), $session->param('flags'), |
| 1602 |
$session->param('emailaddress'), $session->param('branchprinter') |
1636 |
$session->param('emailaddress'), $session->param('branchprinter'), |
|
|
1637 |
$session->param('persona'), $session->param('shibboleth'), |
| 1638 |
$session->param('deskcode'), $session->param('deskname'), |
| 1603 |
); |
1639 |
); |
| 1604 |
|
1640 |
|
| 1605 |
my $ip = $session->param('ip'); |
1641 |
my $ip = $session->param('ip'); |