diff --git a/fid_bbi/config/vufind/config.ini b/fid_bbi/config/vufind/config.ini index 020d10f75566df279efcf880a55fee7dadc86a07..d9edd4d0bd11fad42a288799b92591ba41504cfc 100644 --- a/fid_bbi/config/vufind/config.ini +++ b/fid_bbi/config/vufind/config.ini @@ -206,7 +206,11 @@ alphabet_letters = "AÄBCDEFGHIJKLMNOÖPQRSTUÜVWXYZ" alphabetical_order = true [MediaLicenses] -BookHistoryOnline = "https://fid-bbi.idm.oclc.org/login?url=https://bibliographies.brillonline.com/browse/book-history-online" +; BEWARE: currently the user authorization used in databases.phtml relies on +; ALL licenses being provided via EZproxy. This way we can show unproxied links +; for unauthorized users +; the following links will be presented to ALL users +BookHistoryOnline = "https://bibliographies.brillonline.com/browse/book-history-online" [ExternalDatabases] DBIS = true diff --git a/module/fid_bbi/src/fid_bbi/Controller/MyResearchController.php b/module/fid_bbi/src/fid_bbi/Controller/MyResearchController.php index 851c3831437168a72df979c17cb86a920a0148d5..ce7fab0ca4757c3c41bcbd9b2299194766b4ffb4 100644 --- a/module/fid_bbi/src/fid_bbi/Controller/MyResearchController.php +++ b/module/fid_bbi/src/fid_bbi/Controller/MyResearchController.php @@ -70,4 +70,21 @@ class MyResearchController extends \fid\Controller\MyResearchController } return $this->createViewModel(compact('lists','tags')); } + + + /** + * Check if licenses are specified + * overrides parent function avoiding authentication + * + * @return bool + */ + public function hasLicenses(): bool + { + // Are licenses configured + if (!isset($this->mainConfig['MediaLicenses']) || count($this->mainConfig['MediaLicenses']) == 0) { + return false; + } + + return true; + } } diff --git a/themes/fid_bbi/templates/myresearch/databases.phtml b/themes/fid_bbi/templates/myresearch/databases.phtml index eca41601b265bf6333f3f7f0b2a757593fbb51c1..613a477f9a17028ecbbb3e9233ac178365e6b48b 100644 --- a/themes/fid_bbi/templates/myresearch/databases.phtml +++ b/themes/fid_bbi/templates/myresearch/databases.phtml @@ -20,14 +20,25 @@ $account = $this->auth()->getManager(); <div class="narrow"> <h2><?=$this->translate('licenses')?></h2> - <?php if (!$account->isLoggedIn()): ?> - <p><?=$this->translate('licenses_forbidden_login_required')?></p> - <?php elseif (!$this->permission()->allowDisplay('access.Licenses')) : ?> - <p><?=$this->translate('licenses_forbidden_permission_denied')?></p> + <?php if (!empty($licenses) && $this->permission()->allowDisplay('access.Licenses')): ?> + <p><?=$this->translate('licenses_text')?></p> + + <ul class="licenses"> + <?php foreach ($licenses as $license): ?> + <li> + <?=$this->externalLink($this->proxyUrl($license['url']), $this->translate('licenses_' . $license['name']))?> + <?php if (!empty($license['desc'])): ?>(<?=$license['desc']?>)<?php endif; ?> + </li> + <?php endforeach; ?> + </ul> <?php elseif (empty($licenses)) : ?> - <p><?=$this->translate('licenses_not_available')?></p> + <p><?=$this->translate('licenses_not_available')?></p> <?php else: ?> - <p><?=$this->translate('licenses_text')?></p> + <?php if (!$account->isLoggedIn()): ?> + <p><?=$this->translate('licenses_forbidden_login_required')?></p> + <?php else: ?> + <p><?=$this->translate('licenses_forbidden_permission_denied')?></p> + <?php endif; ?> <ul class="licenses"> <?php foreach ($licenses as $license): ?> @@ -39,6 +50,7 @@ $account = $this->auth()->getManager(); </ul> <?php endif; ?> + <?php if ($this->isDbisAvailable) : ?> <?=$this->render('myresearch/dbis-content')?> <?php endif; ?>