| 
      
            Lines 32-44
          unless (C4::Context->preference('OPACpatronimages')) {
      
      
        Link Here
      
     | 
  
        
          | 32 | 
              exit;  | 
          32 | 
              exit;  | 
        
        
          | 33 | 
          }  | 
          33 | 
          }  | 
        
        
          | 34 | 
           | 
          34 | 
           | 
        
          
            
              | 35 | 
              my $needed_flags;  | 
              35 | 
              my ($auth_status) = check_cookie_auth( $query->cookie('CGISESSID') ); | 
            
            
              | 36 | 
              my %cookies = CGI::Cookie->fetch;  | 
              36 | 
              if( $auth_status ne 'ok' ) { | 
            
            
              | 37 | 
              my $sessid = $cookies{'CGISESSID'}->value; | 
              37 | 
                  print CGI::header( '-status' => '401' );  | 
            
            
              | 38 | 
              my ($auth_status) = check_cookie_auth($sessid, $needed_flags);  | 
              38 | 
                  exit 0;  | 
            
            
              | 39 | 
              my $borrowernumber = C4::Context->userenv->{'number'}; | 
              39 | 
              }  | 
            
        
          | 40 | 
           | 
          40 | 
           | 
        
          
            
              | 41 | 
              my $patron_image = Koha::Patron::Images->find($borrowernumber);  | 
              41 | 
              my $userenv = C4::Context->userenv;  | 
            
            
               | 
               | 
              42 | 
              my $patron_image = $userenv ? Koha::Patron::Images->find( $userenv->{number} ) : undef; | 
            
        
          | 42 | 
           | 
          43 | 
           | 
        
        
          | 43 | 
          if ($patron_image) { | 
          44 | 
          if ($patron_image) { | 
        
        
          | 44 | 
              print $query->header(  | 
          45 | 
              print $query->header(  | 
        
            
              | 45 | 
              -   | 
               | 
               |