You are here

protected function DownloadController::redirectDownload in Ubercart 8.4

Send 'em packin.

Parameters

int $uid: The user id.

1 call to DownloadController::redirectDownload()
DownloadController::download in uc_file/src/Controller/DownloadController.php
Handles file downloading and error states.

File

uc_file/src/Controller/DownloadController.php, line 486

Class

DownloadController
Handles administrative view of files that may be purchased and downloaded.

Namespace

Drupal\uc_file\Controller

Code

protected function redirectDownload($uid = NULL) {

  // Shoo away anonymous users.
  if ($uid == 0) {
    throw new AccessDeniedHttpException();
  }
  else {
    if (!headers_sent()) {
      return new RedirectResponse(Url::fromRoute('uc_file.user_downloads', [
        'user' => $uid,
      ]));
    }
  }
}