Skip to content
Snippets Groups Projects
Commit 6e11a244 authored by Frank Morgner's avatar Frank Morgner
Browse files

refs #7878 bugfixin false Exception namespaces at EBL service & minor removing of artefacts

parent 50c8cf2a
No related merge requests found
...@@ -28,12 +28,10 @@ ...@@ -28,12 +28,10 @@
*/ */
namespace finc\Rewrite; namespace finc\Rewrite;
use ZfcRbac\Service\AuthorizationServiceAwareTrait/*,*/ use ZfcRbac\Service\AuthorizationServiceAwareTrait;
/*ZfcRbac\Service\AuthorizationServiceAwareInterface*/
;
/** /**
* Ebl/ Schweitzer Rewrite service for VuFind. * Ebl / Schweitzer Rewrite service for VuFind.
* *
* @category VuFind2 * @category VuFind2
* @package Rewrite * @package Rewrite
...@@ -42,7 +40,7 @@ use ZfcRbac\Service\AuthorizationServiceAwareTrait/*,*/ ...@@ -42,7 +40,7 @@ use ZfcRbac\Service\AuthorizationServiceAwareTrait/*,*/
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://www.vufind.org Main Page * @link http://www.vufind.org Main Page
*/ */
class EblRewrite /*implements AuthorizationServiceAwareInterface*/ class EblRewrite
{ {
use AuthorizationServiceAwareTrait; use AuthorizationServiceAwareTrait;
...@@ -90,18 +88,19 @@ class EblRewrite /*implements AuthorizationServiceAwareInterface*/ ...@@ -90,18 +88,19 @@ class EblRewrite /*implements AuthorizationServiceAwareInterface*/
* *
* @return string $link Link as url. * @return string $link Link as url.
* @access public * @access public
* @throws Exception No user object exists * @throws \Exception No user object exists
* @throws \Exception Authorization service missing
*/ */
public function resolveLink($link, $user) public function resolveLink($link, $user)
{ {
$this->accessPermission = 'access.EblLink'; $this->accessPermission = 'access.EblLink';
if (!isset($user->username) && strlen($user->username) > 0) { if (!isset($user->username) && strlen($user->username) > 0) {
throw new Exception('No user object exists'); throw new \Exception('No user object exists');
} }
$auth = $this->getAuthorizationService(); $auth = $this->getAuthorizationService();
if (!$auth) { if (!$auth) {
throw new Exception('Authorization service missing'); throw new \Exception('Authorization service missing');
} }
// Logged in user with no permission get resolver link for view of already // Logged in user with no permission get resolver link for view of already
...@@ -159,7 +158,7 @@ class EblRewrite /*implements AuthorizationServiceAwareInterface*/ ...@@ -159,7 +158,7 @@ class EblRewrite /*implements AuthorizationServiceAwareInterface*/
* *
* @return string * @return string
* @access private * @access private
* @throws Exception There is no secret key defined in configuration * @throws \Exception There is no secret key defined in configuration
*/ */
private function getSecretKey() private function getSecretKey()
{ {
...@@ -168,7 +167,7 @@ class EblRewrite /*implements AuthorizationServiceAwareInterface*/ ...@@ -168,7 +167,7 @@ class EblRewrite /*implements AuthorizationServiceAwareInterface*/
) { ) {
return $this->config->Ebl->secret_key; return $this->config->Ebl->secret_key;
} }
throw new Exception('There is no secret key defined in configuration.'); throw new \Exception('There is no secret key defined in configuration.');
} }
/** /**
...@@ -181,6 +180,4 @@ class EblRewrite /*implements AuthorizationServiceAwareInterface*/ ...@@ -181,6 +180,4 @@ class EblRewrite /*implements AuthorizationServiceAwareInterface*/
{ {
return ($this->time == null) ? time() : $this->time; return ($this->time == null) ? time() : $this->time;
} }
} }
\ No newline at end of file
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