You are here

function media_pdf_thumbnail_file_download in Media PDF Thumbnail 8.4

Same name and namespace in other branches
  1. 8.3 media_pdf_thumbnail.module \media_pdf_thumbnail_file_download()

Implements hook_file_download().

File

./media_pdf_thumbnail.module, line 79
Contains media_pdf_thumbnail.module.

Code

function media_pdf_thumbnail_file_download($uri) {
  if (strpos($uri, 'private://') !== FALSE) {
    if (Drupal::currentUser()
      ->isAuthenticated()) {
      return 1;
    }
    return -1;
  }
}