summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-10 23:12:38 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-10 23:12:38 -0400
commita0227cad69aff9486fba1d7b2a19e6da97450100 (patch)
treee4585be087759022b8a3d0108eacff3494da470e /app/Controller
parent44f680cf2f1463721eb5bdb7eda4d3b339e63ba9 (diff)
Define only what is allowed for column restrictions
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/AppController.php17
-rw-r--r--app/Controller/BoardAjaxController.php2
2 files changed, 10 insertions, 9 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,
- )));
}
/**
diff --git a/app/Controller/BoardAjaxController.php b/app/Controller/BoardAjaxController.php
index 5e771fd6..cc3b846e 100644
--- a/app/Controller/BoardAjaxController.php
+++ b/app/Controller/BoardAjaxController.php
@@ -36,7 +36,7 @@ class BoardAjaxController extends BaseController
);
if (! $canMoveTask) {
- throw new AccessForbiddenException("You don't have the permission to move this task");
+ throw new AccessForbiddenException(e("You don't have the permission to move this task"));
}
$result =$this->taskPositionModel->movePosition(