summaryrefslogtreecommitdiff
path: root/app/Controller/AppController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/AppController.php')
-rw-r--r--app/Controller/AppController.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php
index 45cf39a5..34b9c8cc 100644
--- a/app/Controller/AppController.php
+++ b/app/Controller/AppController.php
@@ -16,18 +16,19 @@ class AppController extends Base
* Forbidden page
*
* @access public
- * @param bool $withoutLayout
+ * @param bool $withoutLayout
+ * @param string $message
*/
- public function accessForbidden($withoutLayout = false)
+ public function accessForbidden($withoutLayout = false, $message = '')
{
if ($this->request->isAjax()) {
- $this->response->json(array('message' => 'Access Forbidden'), 403);
+ $this->response->json(array('message' => $message ?: t('Access Forbidden')), 403);
+ } else {
+ $this->response->html($this->helper->layout->app('app/forbidden', array(
+ 'title' => t('Access Forbidden'),
+ 'no_layout' => $withoutLayout,
+ )));
}
-
- $this->response->html($this->helper->layout->app('app/forbidden', array(
- 'title' => t('Access Forbidden'),
- 'no_layout' => $withoutLayout,
- )));
}
/**