Skip to content
Snippets Groups Projects
Commit 0f0bcb5d authored by Demian Katz's avatar Demian Katz
Browse files

Smarter "access denied" behavior in VuDL.

parent b14f37ef
No related merge requests found
...@@ -740,6 +740,7 @@ View Record = "View Record" ...@@ -740,6 +740,7 @@ View Record = "View Record"
View Records = "View Records" View Records = "View Records"
Volume = Volume Volume = Volume
Volume Holdings = "Volume Holdings" Volume Holdings = "Volume Holdings"
vudl_access_denied = "Access denied."
vudl_tab_docs = "Docs" vudl_tab_docs = "Docs"
vudl_tab_pages = "Pages" vudl_tab_pages = "Pages"
VuFind Configuration = "VuFind Configuration" VuFind Configuration = "VuFind Configuration"
......
...@@ -397,11 +397,11 @@ class VudlController extends AbstractVuDL ...@@ -397,11 +397,11 @@ class VudlController extends AbstractVuDL
try { try {
$driver = $this->getRecordLoader()->load($root, 'VuFind'); $driver = $this->getRecordLoader()->load($root, 'VuFind');
if ($driver->isProtected()) {
die('Access Denied.');
}
} catch(\Exception $e) { } catch(\Exception $e) {
} }
if (isset($driver) && $driver->isProtected()) {
return $this->forwardTo('VuDL', 'denied');
}
// File information / description // File information / description
$fileDetails = $this->getDetails($root); $fileDetails = $this->getDetails($root);
...@@ -549,6 +549,16 @@ class VudlController extends AbstractVuDL ...@@ -549,6 +549,16 @@ class VudlController extends AbstractVuDL
return $view; return $view;
} }
/**
* Access denied screen.
*
* @return mixed
*/
protected function deniedAction()
{
return $this->createViewModel();
}
/** /**
* Redirect to the appropriate sibling. * Redirect to the appropriate sibling.
* *
......
<?php
$this->headTitle('vudl_access_denied');
$this->layout()->breadcrumbs = false;
?>
<div class="<?=$this->layoutClass('mainbody')?>">
<div class="alert alert-error">
<?=$this->transEsc('vudl_access_denied')?>
</div>
</div>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment