You are here

function _download_count_is_accessible_by_upload in Download Count 7.2

Same name and namespace in other branches
  1. 6.2 download_count.module \_download_count_is_accessible_by_upload()
1 call to _download_count_is_accessible_by_upload()
download_count_file_download in ./download_count.module
Implements hook_file_download().

File

./download_count.module, line 330
Tracks file downloads for files stored in the drupal files table using the private files setting or custom private filefield.

Code

function _download_count_is_accessible_by_upload($filepath) {
  if ($file = _download_count_get_file_by_upload($filepath)) {
    if (user_access('view uploaded files') && node_access('view', node_load($file->nid))) {
      return TRUE;

      // accessible
    }
    else {
      return FALSE;

      // inaccessible
    }
  }
  return NULL;

  // not known
}