function commerce_file_exit in Commerce File 7
Same name and namespace in other branches
- 7.2 commerce_file.module \commerce_file_exit()
Implements hook_exit().
File
- ./
commerce_file.module, line 832 - Provides integration of file licenses with Commerce
Code
function commerce_file_exit($destination = NULL) {
global $user;
// check if our header is set to determine if file_download has allowed
if (drupal_get_http_header(COMMERCE_FILE_HEADER_NAME)) {
$licenses = _commerce_file_license_get_request_licenses();
if (!empty($licenses)) {
// log access for license owners
foreach ($licenses as $license) {
$license
->invoke('log_download');
}
}
}
}