Skip to content

Commit

Permalink
added 403 template as zfcRbac's template expects an array
Browse files Browse the repository at this point in the history
  • Loading branch information
esserj committed Nov 14, 2013
1 parent bb1b7b2 commit 1faba39
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
7 changes: 6 additions & 1 deletion config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@
)
)
)
)
),
'view_manager' => array(
'template_map' => array(
'error/403' => __DIR__ . '/../view/error/403.phtml',
)
),
);
17 changes: 17 additions & 0 deletions view/error/403.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<h1>A 403 error occured</h1>
<p>
<?php if ($error == 'error-route-unauthorized') : ?>
Identity (with roles <?php echo implode(',', $identity->getRoles() instanceof \Doctrine\ORM\PersistentCollection ? $identity->getRoles()->toArray() : $identity->getRoles());?>) is not authorized to access <?php echo $route;?>.
<?php elseif ($error == 'error-controller-unauthorized') : ?>
Identity (with roles <?php echo implode(',', $identity->getRoles()instanceof \Doctrine\ORM\PersistentCollection ? $identity->getRoles()->toArray() : $identity->getRoles());?>) is not authorized to access <?php echo $controller;?>
<?php if ($action) : ?>
::<?php echo $action;?>Action()
<?php endif;?>
.
<?php elseif ($error == 'error-rbac') : ?>
RBAC error<br/>
<?php if ($this->message) : ?>
<?php echo $this->message;?>
<?php endif;?>
<?php endif;?>
</p>

0 comments on commit 1faba39

Please sign in to comment.