| Lines 853-859
          sub checkauth {
      
      
        Link Here | 
        
          | 853 |                 $session->param('cardnumber'),   $session->param('firstname'), | 853 |                 $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 854 |                 $session->param('surname'),      $session->param('branch'), | 854 |                 $session->param('surname'),      $session->param('branch'), | 
        
          | 855 |                 $session->param('branchname'),   $session->param('flags'), | 855 |                 $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 856 |                 $session->param('emailaddress'), $session->param('branchprinter'), | 856 |                 $session->param('emailaddress'), | 
        
          | 857 |                 $session->param('shibboleth') | 857 |                 $session->param('shibboleth') | 
        
          | 858 |             ); | 858 |             ); | 
        
          | 859 |             C4::Context::set_shelves_userenv( 'bar', $session->param('barshelves') ); | 859 |             C4::Context::set_shelves_userenv( 'bar', $session->param('barshelves') ); | 
  
    | Lines 1076-1089
          sub checkauth {
      
      
        Link Here | 
        
          | 1076 |                     C4::Context->_unset_userenv($sessionID); | 1076 |                     C4::Context->_unset_userenv($sessionID); | 
        
          | 1077 |                 } | 1077 |                 } | 
        
          | 1078 |                 my ( $borrowernumber, $firstname, $surname, $userflags, | 1078 |                 my ( $borrowernumber, $firstname, $surname, $userflags, | 
          
            
              | 1079 |                     $branchcode, $branchname, $branchprinter, $emailaddress ); | 1079 |                     $branchcode, $branchname, $emailaddress ); | 
        
          | 1080 |  | 1080 |  | 
        
          | 1081 |                 if ( $return == 1 ) { | 1081 |                 if ( $return == 1 ) { | 
        
          | 1082 |                     my $select = " | 1082 |                     my $select = " | 
        
          | 1083 |                     SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, | 1083 |                     SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, | 
          
            
              | 1084 |                     branches.branchname    as branchname, | 1084 |                     branches.branchname    as branchname, email | 
            
              | 1085 |                     branches.branchprinter as branchprinter, |  |  | 
            
              | 1086 |                     email | 
        
          | 1087 |                     FROM borrowers | 1085 |                     FROM borrowers | 
        
          | 1088 |                     LEFT JOIN branches on borrowers.branchcode=branches.branchcode | 1086 |                     LEFT JOIN branches on borrowers.branchcode=branches.branchcode | 
        
          | 1089 |                     "; | 1087 |                     "; | 
  
    | Lines 1104-1110
          sub checkauth {
      
      
        Link Here | 
        
          | 1104 |                     } | 1102 |                     } | 
        
          | 1105 |                     if ( $sth->rows ) { | 1103 |                     if ( $sth->rows ) { | 
        
          | 1106 |                         ( $borrowernumber, $firstname, $surname, $userflags, | 1104 |                         ( $borrowernumber, $firstname, $surname, $userflags, | 
          
            
              | 1107 |                             $branchcode, $branchname, $branchprinter, $emailaddress ) = $sth->fetchrow; | 1105 |                             $branchcode, $branchname, $emailaddress ) = $sth->fetchrow; | 
        
          | 1108 |                         $debug and print STDERR "AUTH_3 results: " . | 1106 |                         $debug and print STDERR "AUTH_3 results: " . | 
        
          | 1109 |                           "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n"; | 1107 |                           "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n"; | 
        
          | 1110 |                     } else { | 1108 |                     } else { | 
  
    | Lines 1146-1153
          sub checkauth {
      
      
        Link Here | 
        
          | 1146 |                         if ( $domain && $ip =~ /^$domain/ ) { | 1144 |                         if ( $domain && $ip =~ /^$domain/ ) { | 
        
          | 1147 |                             $branchcode = $branches->{$br}->{'branchcode'}; | 1145 |                             $branchcode = $branches->{$br}->{'branchcode'}; | 
        
          | 1148 |  | 1146 |  | 
          
            
              | 1149 |                             # new op dev : add the branchprinter and branchname in the cookie | 1147 |                             # new op dev : add the branchname to the cookie | 
            
              | 1150 |                             $branchprinter = $branches->{$br}->{'branchprinter'}; |  |  | 
        
          | 1151 |                             $branchname    = $branches->{$br}->{'branchname'}; | 1148 |                             $branchname    = $branches->{$br}->{'branchname'}; | 
        
          | 1152 |                         } | 1149 |                         } | 
        
          | 1153 |                     } | 1150 |                     } | 
  
    | Lines 1171-1178
          sub checkauth {
      
      
        Link Here | 
        
          | 1171 |                     $session->param('cardnumber'),   $session->param('firstname'), | 1168 |                     $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 1172 |                     $session->param('surname'),      $session->param('branch'), | 1169 |                     $session->param('surname'),      $session->param('branch'), | 
        
          | 1173 |                     $session->param('branchname'),   $session->param('flags'), | 1170 |                     $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 1174 |                     $session->param('emailaddress'), $session->param('branchprinter'), | 1171 |                     $session->param('emailaddress'), $session->param('shibboleth') | 
            
              | 1175 |                     $session->param('shibboleth') |  |  | 
        
          | 1176 |                 ); | 1172 |                 ); | 
        
          | 1177 |  | 1173 |  | 
        
          | 1178 |             } | 1174 |             } | 
  
    | Lines 1439-1445
          sub check_api_auth {
      
      
        Link Here | 
        
          | 1439 |                 $session->param('cardnumber'),   $session->param('firstname'), | 1435 |                 $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 1440 |                 $session->param('surname'),      $session->param('branch'), | 1436 |                 $session->param('surname'),      $session->param('branch'), | 
        
          | 1441 |                 $session->param('branchname'),   $session->param('flags'), | 1437 |                 $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 1442 |                 $session->param('emailaddress'), $session->param('branchprinter') | 1438 |                 $session->param('emailaddress') | 
        
          | 1443 |             ); | 1439 |             ); | 
        
          | 1444 |  | 1440 |  | 
        
          | 1445 |             my $ip       = $session->param('ip'); | 1441 |             my $ip       = $session->param('ip'); | 
  
    | Lines 1527-1561
          sub check_api_auth {
      
      
        Link Here | 
        
          | 1527 |                 my ( | 1523 |                 my ( | 
        
          | 1528 |                     $borrowernumber, $firstname,  $surname, | 1524 |                     $borrowernumber, $firstname,  $surname, | 
        
          | 1529 |                     $userflags,      $branchcode, $branchname, | 1525 |                     $userflags,      $branchcode, $branchname, | 
          
            
              | 1530 |                     $branchprinter,  $emailaddress | 1526 |                     $emailaddress | 
        
          | 1531 |                 ); | 1527 |                 ); | 
        
          | 1532 |                 my $sth = | 1528 |                 my $sth = | 
        
          | 1533 |                   $dbh->prepare( | 1529 |                   $dbh->prepare( | 
          
            
              | 1534 | "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=?" | 1530 | "select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where userid=?" | 
        
          | 1535 |                   ); | 1531 |                   ); | 
        
          | 1536 |                 $sth->execute($userid); | 1532 |                 $sth->execute($userid); | 
        
          | 1537 |                 ( | 1533 |                 ( | 
        
          | 1538 |                     $borrowernumber, $firstname,  $surname, | 1534 |                     $borrowernumber, $firstname,  $surname, | 
        
          | 1539 |                     $userflags,      $branchcode, $branchname, | 1535 |                     $userflags,      $branchcode, $branchname, | 
          
            
              | 1540 |                     $branchprinter,  $emailaddress | 1536 |                     $emailaddress | 
        
          | 1541 |                 ) = $sth->fetchrow if ( $sth->rows ); | 1537 |                 ) = $sth->fetchrow if ( $sth->rows ); | 
        
          | 1542 |  | 1538 |  | 
        
          | 1543 |                 unless ( $sth->rows ) { | 1539 |                 unless ( $sth->rows ) { | 
        
          | 1544 |                     my $sth = $dbh->prepare( | 1540 |                     my $sth = $dbh->prepare( | 
          
            
              | 1545 | "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=?" | 1541 | "select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where cardnumber=?" | 
        
          | 1546 |                     ); | 1542 |                     ); | 
        
          | 1547 |                     $sth->execute($cardnumber); | 1543 |                     $sth->execute($cardnumber); | 
        
          | 1548 |                     ( | 1544 |                     ( | 
        
          | 1549 |                         $borrowernumber, $firstname,  $surname, | 1545 |                         $borrowernumber, $firstname,  $surname, | 
        
          | 1550 |                         $userflags,      $branchcode, $branchname, | 1546 |                         $userflags,      $branchcode, $branchname, | 
          
            
              | 1551 |                         $branchprinter,  $emailaddress | 1547 |                         $emailaddress | 
        
          | 1552 |                     ) = $sth->fetchrow if ( $sth->rows ); | 1548 |                     ) = $sth->fetchrow if ( $sth->rows ); | 
        
          | 1553 |  | 1549 |  | 
        
          | 1554 |                     unless ( $sth->rows ) { | 1550 |                     unless ( $sth->rows ) { | 
        
          | 1555 |                         $sth->execute($userid); | 1551 |                         $sth->execute($userid); | 
        
          | 1556 |                         ( | 1552 |                         ( | 
        
          | 1557 |                             $borrowernumber, $firstname,  $surname,       $userflags, | 1553 |                             $borrowernumber, $firstname,  $surname,       $userflags, | 
          
            
              | 1558 |                             $branchcode,     $branchname, $branchprinter, $emailaddress | 1554 |                             $branchcode,     $branchname, $emailaddress | 
        
          | 1559 |                         ) = $sth->fetchrow if ( $sth->rows ); | 1555 |                         ) = $sth->fetchrow if ( $sth->rows ); | 
        
          | 1560 |                     } | 1556 |                     } | 
        
          | 1561 |                 } | 1557 |                 } | 
  
    | Lines 1576-1583
          sub check_api_auth {
      
      
        Link Here | 
        
          | 1576 |                     if ( $domain && $ip =~ /^$domain/ ) { | 1572 |                     if ( $domain && $ip =~ /^$domain/ ) { | 
        
          | 1577 |                         $branchcode = $branches->{$br}->{'branchcode'}; | 1573 |                         $branchcode = $branches->{$br}->{'branchcode'}; | 
        
          | 1578 |  | 1574 |  | 
          
            
              | 1579 |                         # new op dev : add the branchprinter and branchname in the cookie | 1575 |                         # new op dev : add the branchname to the cookie | 
            
              | 1580 |                         $branchprinter = $branches->{$br}->{'branchprinter'}; |  |  | 
        
          | 1581 |                         $branchname    = $branches->{$br}->{'branchname'}; | 1576 |                         $branchname    = $branches->{$br}->{'branchname'}; | 
        
          | 1582 |                     } | 1577 |                     } | 
        
          | 1583 |                 } | 1578 |                 } | 
  
    | Lines 1599-1605
          sub check_api_auth {
      
      
        Link Here | 
        
          | 1599 |                 $session->param('cardnumber'),   $session->param('firstname'), | 1594 |                 $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 1600 |                 $session->param('surname'),      $session->param('branch'), | 1595 |                 $session->param('surname'),      $session->param('branch'), | 
        
          | 1601 |                 $session->param('branchname'),   $session->param('flags'), | 1596 |                 $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 1602 |                 $session->param('emailaddress'), $session->param('branchprinter') | 1597 |                 $session->param('emailaddress') | 
        
          | 1603 |             ); | 1598 |             ); | 
        
          | 1604 |             return ( "ok", $cookie, $sessionID ); | 1599 |             return ( "ok", $cookie, $sessionID ); | 
        
          | 1605 |         } else { | 1600 |         } else { | 
  
    | Lines 1682-1688
          sub check_cookie_auth {
      
      
        Link Here | 
        
          | 1682 |             $session->param('cardnumber'),   $session->param('firstname'), | 1677 |             $session->param('cardnumber'),   $session->param('firstname'), | 
        
          | 1683 |             $session->param('surname'),      $session->param('branch'), | 1678 |             $session->param('surname'),      $session->param('branch'), | 
        
          | 1684 |             $session->param('branchname'),   $session->param('flags'), | 1679 |             $session->param('branchname'),   $session->param('flags'), | 
          
            
              | 1685 |             $session->param('emailaddress'), $session->param('branchprinter') | 1680 |             $session->param('emailaddress') | 
        
          | 1686 |         ); | 1681 |         ); | 
        
          | 1687 |  | 1682 |  | 
        
          | 1688 |         my $ip       = $session->param('ip'); | 1683 |         my $ip       = $session->param('ip'); |