summaryrefslogtreecommitdiff
path: root/app/Controller/ProjectPermissionController.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2018-04-06 14:06:18 -0700
committerFrédéric Guillot <fred@kanboard.net>2018-04-06 14:06:18 -0700
commitf6e2dea411246c011d3d1d21d56fda0cf8c3705f (patch)
tree553bea6d2c5a1fa9fbd9ab2b13d08199e07d0ad5 /app/Controller/ProjectPermissionController.php
parent0b306fa60ad84ea077111e0ff7b59208ba7bc8a3 (diff)
Make sure no empty group is submitted on project permissions page
Diffstat (limited to 'app/Controller/ProjectPermissionController.php')
-rw-r--r--app/Controller/ProjectPermissionController.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/Controller/ProjectPermissionController.php b/app/Controller/ProjectPermissionController.php
index 3fb6c090..1301285f 100644
--- a/app/Controller/ProjectPermissionController.php
+++ b/app/Controller/ProjectPermissionController.php
@@ -135,10 +135,14 @@ class ProjectPermissionController extends BaseController
$values['group_id'] = $this->groupModel->getOrCreateExternalGroupId($values['name'], $values['external_id']);
}
- if ($this->projectGroupRoleModel->addGroup($project['id'], $values['group_id'], $values['role'])) {
- $this->flash->success(t('Project updated successfully.'));
+ if (empty($values['group_id'])) {
+ $this->flash->failure(t('Unable to find this group.'));
} else {
- $this->flash->failure(t('Unable to update this project.'));
+ if ($this->projectGroupRoleModel->addGroup($project['id'], $values['group_id'], $values['role'])) {
+ $this->flash->success(t('Project updated successfully.'));
+ } else {
+ $this->flash->failure(t('Unable to update this project.'));
+ }
}
$this->response->redirect($this->helper->url->to('ProjectPermissionController', 'index', array('project_id' => $project['id'])));