| Lines 848-854
          sub checkauth {
      
      
        Link Here | 
        
          | 848 |                 $session->param('cardnumber'),   $session->param('firstname'), | 848 |                 $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 849 |                 $session->param('surname'),      $session->param('branch'), | 849 |                 $session->param('surname'),      $session->param('branch'), | 
        
          | 850 |                 $session->param('branchname'),   $session->param('flags'), | 850 |                 $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 851 |                 $session->param('emailaddress'), $session->param('branchprinter'), | 851 |                 $session->param('emailaddress'), | 
        
          | 852 |                 $session->param('shibboleth') | 852 |                 $session->param('shibboleth') | 
        
          | 853 |             ); | 853 |             ); | 
        
          | 854 |             C4::Context::set_shelves_userenv( 'bar', $session->param('barshelves') ); | 854 |             C4::Context::set_shelves_userenv( 'bar', $session->param('barshelves') ); | 
  
    | Lines 1069-1082
          sub checkauth {
      
      
        Link Here | 
        
          | 1069 |                     C4::Context->_unset_userenv($sessionID); | 1069 |                     C4::Context->_unset_userenv($sessionID); | 
        
          | 1070 |                 } | 1070 |                 } | 
        
          | 1071 |                 my ( $borrowernumber, $firstname, $surname, $userflags, | 1071 |                 my ( $borrowernumber, $firstname, $surname, $userflags, | 
          
            
              | 1072 |                     $branchcode, $branchname, $branchprinter, $emailaddress ); | 1072 |                     $branchcode, $branchname, $emailaddress ); | 
        
          | 1073 |  | 1073 |  | 
        
          | 1074 |                 if ( $return == 1 ) { | 1074 |                 if ( $return == 1 ) { | 
        
          | 1075 |                     my $select = " | 1075 |                     my $select = " | 
        
          | 1076 |                     SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, | 1076 |                     SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, | 
          
            
              | 1077 |                     branches.branchname    as branchname, | 1077 |                     branches.branchname    as branchname, email | 
            
              | 1078 |                     branches.branchprinter as branchprinter, |  |  | 
            
              | 1079 |                     email | 
        
          | 1080 |                     FROM borrowers | 1078 |                     FROM borrowers | 
        
          | 1081 |                     LEFT JOIN branches on borrowers.branchcode=branches.branchcode | 1079 |                     LEFT JOIN branches on borrowers.branchcode=branches.branchcode | 
        
          | 1082 |                     "; | 1080 |                     "; | 
  
    | Lines 1097-1103
          sub checkauth {
      
      
        Link Here | 
        
          | 1097 |                     } | 1095 |                     } | 
        
          | 1098 |                     if ( $sth->rows ) { | 1096 |                     if ( $sth->rows ) { | 
        
          | 1099 |                         ( $borrowernumber, $firstname, $surname, $userflags, | 1097 |                         ( $borrowernumber, $firstname, $surname, $userflags, | 
          
            
              | 1100 |                             $branchcode, $branchname, $branchprinter, $emailaddress ) = $sth->fetchrow; | 1098 |                             $branchcode, $branchname, $emailaddress ) = $sth->fetchrow; | 
        
          | 1101 |                         $debug and print STDERR "AUTH_3 results: " . | 1099 |                         $debug and print STDERR "AUTH_3 results: " . | 
        
          | 1102 |                           "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n"; | 1100 |                           "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n"; | 
        
          | 1103 |                     } else { | 1101 |                     } else { | 
  
    | Lines 1139-1146
          sub checkauth {
      
      
        Link Here | 
        
          | 1139 |                         if ( $domain && $ip =~ /^$domain/ ) { | 1137 |                         if ( $domain && $ip =~ /^$domain/ ) { | 
        
          | 1140 |                             $branchcode = $branches->{$br}->{'branchcode'}; | 1138 |                             $branchcode = $branches->{$br}->{'branchcode'}; | 
        
          | 1141 |  | 1139 |  | 
          
            
              | 1142 |                             # new op dev : add the branchprinter and branchname in the cookie | 1140 |                             # new op dev : add the branchname to the cookie | 
            
              | 1143 |                             $branchprinter = $branches->{$br}->{'branchprinter'}; |  |  | 
        
          | 1144 |                             $branchname    = $branches->{$br}->{'branchname'}; | 1141 |                             $branchname    = $branches->{$br}->{'branchname'}; | 
        
          | 1145 |                         } | 1142 |                         } | 
        
          | 1146 |                     } | 1143 |                     } | 
  
    | Lines 1165-1172
          sub checkauth {
      
      
        Link Here | 
        
          | 1165 |                     $session->param('cardnumber'),   $session->param('firstname'), | 1162 |                     $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 1166 |                     $session->param('surname'),      $session->param('branch'), | 1163 |                     $session->param('surname'),      $session->param('branch'), | 
        
          | 1167 |                     $session->param('branchname'),   $session->param('flags'), | 1164 |                     $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 1168 |                     $session->param('emailaddress'), $session->param('branchprinter'), | 1165 |                     $session->param('emailaddress'), $session->param('shibboleth') | 
            
              | 1169 |                     $session->param('shibboleth') |  |  | 
        
          | 1170 |                 ); | 1166 |                 ); | 
        
          | 1171 |  | 1167 |  | 
        
          | 1172 |             } | 1168 |             } | 
  
    | Lines 1444-1450
          sub check_api_auth {
      
      
        Link Here | 
        
          | 1444 |                 $session->param('cardnumber'),   $session->param('firstname'), | 1440 |                 $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 1445 |                 $session->param('surname'),      $session->param('branch'), | 1441 |                 $session->param('surname'),      $session->param('branch'), | 
        
          | 1446 |                 $session->param('branchname'),   $session->param('flags'), | 1442 |                 $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 1447 |                 $session->param('emailaddress'), $session->param('branchprinter') | 1443 |                 $session->param('emailaddress') | 
        
          | 1448 |             ); | 1444 |             ); | 
        
          | 1449 |  | 1445 |  | 
        
          | 1450 |             my $ip       = $session->param('ip'); | 1446 |             my $ip       = $session->param('ip'); | 
  
    | Lines 1532-1566
          sub check_api_auth {
      
      
        Link Here | 
        
          | 1532 |                 my ( | 1528 |                 my ( | 
        
          | 1533 |                     $borrowernumber, $firstname,  $surname, | 1529 |                     $borrowernumber, $firstname,  $surname, | 
        
          | 1534 |                     $userflags,      $branchcode, $branchname, | 1530 |                     $userflags,      $branchcode, $branchname, | 
          
            
              | 1535 |                     $branchprinter,  $emailaddress | 1531 |                     $emailaddress | 
        
          | 1536 |                 ); | 1532 |                 ); | 
        
          | 1537 |                 my $sth = | 1533 |                 my $sth = | 
        
          | 1538 |                   $dbh->prepare( | 1534 |                   $dbh->prepare( | 
          
            
              | 1539 | "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=?" | 1535 | "select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where userid=?" | 
        
          | 1540 |                   ); | 1536 |                   ); | 
        
          | 1541 |                 $sth->execute($userid); | 1537 |                 $sth->execute($userid); | 
        
          | 1542 |                 ( | 1538 |                 ( | 
        
          | 1543 |                     $borrowernumber, $firstname,  $surname, | 1539 |                     $borrowernumber, $firstname,  $surname, | 
        
          | 1544 |                     $userflags,      $branchcode, $branchname, | 1540 |                     $userflags,      $branchcode, $branchname, | 
          
            
              | 1545 |                     $branchprinter,  $emailaddress | 1541 |                     $emailaddress | 
        
          | 1546 |                 ) = $sth->fetchrow if ( $sth->rows ); | 1542 |                 ) = $sth->fetchrow if ( $sth->rows ); | 
        
          | 1547 |  | 1543 |  | 
        
          | 1548 |                 unless ( $sth->rows ) { | 1544 |                 unless ( $sth->rows ) { | 
        
          | 1549 |                     my $sth = $dbh->prepare( | 1545 |                     my $sth = $dbh->prepare( | 
          
            
              | 1550 | "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=?" | 1546 | "select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where cardnumber=?" | 
        
          | 1551 |                     ); | 1547 |                     ); | 
        
          | 1552 |                     $sth->execute($cardnumber); | 1548 |                     $sth->execute($cardnumber); | 
        
          | 1553 |                     ( | 1549 |                     ( | 
        
          | 1554 |                         $borrowernumber, $firstname,  $surname, | 1550 |                         $borrowernumber, $firstname,  $surname, | 
        
          | 1555 |                         $userflags,      $branchcode, $branchname, | 1551 |                         $userflags,      $branchcode, $branchname, | 
          
            
              | 1556 |                         $branchprinter,  $emailaddress | 1552 |                         $emailaddress | 
        
          | 1557 |                     ) = $sth->fetchrow if ( $sth->rows ); | 1553 |                     ) = $sth->fetchrow if ( $sth->rows ); | 
        
          | 1558 |  | 1554 |  | 
        
          | 1559 |                     unless ( $sth->rows ) { | 1555 |                     unless ( $sth->rows ) { | 
        
          | 1560 |                         $sth->execute($userid); | 1556 |                         $sth->execute($userid); | 
        
          | 1561 |                         ( | 1557 |                         ( | 
        
          | 1562 |                             $borrowernumber, $firstname,  $surname,       $userflags, | 1558 |                             $borrowernumber, $firstname,  $surname,       $userflags, | 
          
            
              | 1563 |                             $branchcode,     $branchname, $branchprinter, $emailaddress | 1559 |                             $branchcode,     $branchname, $emailaddress | 
        
          | 1564 |                         ) = $sth->fetchrow if ( $sth->rows ); | 1560 |                         ) = $sth->fetchrow if ( $sth->rows ); | 
        
          | 1565 |                     } | 1561 |                     } | 
        
          | 1566 |                 } | 1562 |                 } | 
  
    | Lines 1581-1588
          sub check_api_auth {
      
      
        Link Here | 
        
          | 1581 |                     if ( $domain && $ip =~ /^$domain/ ) { | 1577 |                     if ( $domain && $ip =~ /^$domain/ ) { | 
        
          | 1582 |                         $branchcode = $branches->{$br}->{'branchcode'}; | 1578 |                         $branchcode = $branches->{$br}->{'branchcode'}; | 
        
          | 1583 |  | 1579 |  | 
          
            
              | 1584 |                         # new op dev : add the branchprinter and branchname in the cookie | 1580 |                         # new op dev : add the branchname to the cookie | 
            
              | 1585 |                         $branchprinter = $branches->{$br}->{'branchprinter'}; |  |  | 
        
          | 1586 |                         $branchname    = $branches->{$br}->{'branchname'}; | 1581 |                         $branchname    = $branches->{$br}->{'branchname'}; | 
        
          | 1587 |                     } | 1582 |                     } | 
        
          | 1588 |                 } | 1583 |                 } | 
  
    | Lines 1605-1611
          sub check_api_auth {
      
      
        Link Here | 
        
          | 1605 |                 $session->param('cardnumber'),   $session->param('firstname'), | 1600 |                 $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 1606 |                 $session->param('surname'),      $session->param('branch'), | 1601 |                 $session->param('surname'),      $session->param('branch'), | 
        
          | 1607 |                 $session->param('branchname'),   $session->param('flags'), | 1602 |                 $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 1608 |                 $session->param('emailaddress'), $session->param('branchprinter') | 1603 |                 $session->param('emailaddress') | 
        
          | 1609 |             ); | 1604 |             ); | 
        
          | 1610 |             return ( "ok", $cookie, $sessionID ); | 1605 |             return ( "ok", $cookie, $sessionID ); | 
        
          | 1611 |         } else { | 1606 |         } else { | 
  
    | Lines 1693-1699
          sub check_cookie_auth {
      
      
        Link Here | 
        
          | 1693 |             $session->param('cardnumber'),   $session->param('firstname'), | 1688 |             $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 1694 |             $session->param('surname'),      $session->param('branch'), | 1689 |             $session->param('surname'),      $session->param('branch'), | 
        
          | 1695 |             $session->param('branchname'),   $session->param('flags'), | 1690 |             $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 1696 |             $session->param('emailaddress'), $session->param('branchprinter') | 1691 |             $session->param('emailaddress') | 
        
          | 1697 |         ); | 1692 |         ); | 
        
          | 1698 |  | 1693 |  | 
        
          | 1699 |         my $ip       = $session->param('ip'); | 1694 |         my $ip       = $session->param('ip'); |