diff --git a/languages/de.ini b/languages/de.ini index 4b021e61d6bf0ca89592ce25c83db74bdea13cd3..8db55d38f438ae771fd4a591c56fd3c8a6ea061d 100644 --- a/languages/de.ini +++ b/languages/de.ini @@ -730,6 +730,8 @@ past_days = "seit %%range%% Tagen" PDF Full Text = "PDF-Volltext" peer_reviewed = "Peer Reviewed" peer_reviewed_limit = "Auf Artikel aus peer-reviewed Zeitschriften einschränken" +permission_denied = "Sie haben keinen Zugriff auf die angeforderte Seite oder Aktion." +permission_denied_title = "Zugriff verweigert" Phone Number = "Telefon" Photo = "Foto" Physical Description = "Beschreibung" diff --git a/languages/en.ini b/languages/en.ini index 7761bc11bcbb49df04707ee66628c380d6e638a5..377ac6bb34c4dfbaaa32a1e21a318f0f23b9c5b6 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -733,6 +733,8 @@ past_days = "Past %%range%% Days" PDF Full Text = "PDF Full Text" peer_reviewed = "Peer Reviewed" peer_reviewed_limit = "Limit to articles from peer-reviewed journals" +permission_denied = "You have requested a page or action, but you do not have the necessary permission." +permission_denied_title = "Permission denied" Phone Number = "Phone Number" Photo = "Photo" Physical Description = "Physical Description" diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 77cebd0da92c901d4e3d4eb2235250e648836265..314f7c9631a6488295cd03f64eeeefc73b6c7da8 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -828,7 +828,8 @@ $staticRoutes = [ 'Confirm/Confirm', 'Cover/Show', 'Cover/Unavailable', 'EDS/Advanced', 'EDS/Home', 'EDS/Search', 'EIT/Advanced', 'EIT/Home', 'EIT/Search', - 'Error/Unavailable', 'Feedback/Email', 'Feedback/Home', 'Help/Home', + 'Error/PermissionDenied', 'Error/Unavailable', + 'Feedback/Email', 'Feedback/Home', 'Help/Home', 'Install/Done', 'Install/FixBasicConfig', 'Install/FixCache', 'Install/FixDatabase', 'Install/FixDependencies', 'Install/FixILS', 'Install/FixSecurity', 'Install/FixSolr', 'Install/FixSSLCerts', 'Install/Home', diff --git a/module/VuFind/src/VuFind/Controller/ErrorController.php b/module/VuFind/src/VuFind/Controller/ErrorController.php index 57ceb4120fe22a71d095168590f1c0fe6e53e639..2255beed4bda996b8281d9606c2e095b2451450b 100644 --- a/module/VuFind/src/VuFind/Controller/ErrorController.php +++ b/module/VuFind/src/VuFind/Controller/ErrorController.php @@ -50,4 +50,18 @@ class ErrorController extends AbstractActionController $this->getResponse()->setStatusCode(503); return new \Zend\View\Model\ViewModel(); } + + /** + * Display permission denied message. + * + * @return mixed + */ + public function permissionDeniedAction() + { + $this->getResponse()->setStatusCode(403); + return new \Zend\View\Model\ViewModel( + ['msg' => $this->params()->fromQuery('msg')] + ); + } + } diff --git a/themes/bootstrap3/templates/error/permissiondenied.phtml b/themes/bootstrap3/templates/error/permissiondenied.phtml new file mode 100644 index 0000000000000000000000000000000000000000..344afc5be92fc5334fd8aac1725cc98e5065c5bc --- /dev/null +++ b/themes/bootstrap3/templates/error/permissiondenied.phtml @@ -0,0 +1,25 @@ +<? + // Set page title. + $this->headTitle($this->translate('permission_denied_title')); + + // Disable top search box -- this page has a special layout. + $this->layout()->searchbox = false; + + $this->layout()->breadcrumbs = '<li class="active">Error</li>'; +?> +<div> + <h2><?=$this->transEsc('permission_denied_title')?></h2> + <p><?=$this->flashmessages()?></p> + <p> + <?=$this->transEsc('permission_denied')?> + <? if (!empty($msg)): ?> + <div class="alert alert-danger"><?=$this->transEsc($msg)?></div> + <? endif; ?> + </p> + <p> + <?=$this->transEsc('Please contact the Library Reference Department for assistance')?> + <br/> + <? $supportEmail = $this->escapeHtmlAttr($this->systemEmail()); ?> + <a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a> + </p> +</div>