summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2016-04-09 15:43:06 -0400
committerFrédéric Guillot <fred@kanboard.net>2016-04-09 15:43:06 -0400
commit42813d702d1c3e5659301bc771f8dbb37a6d15cd (patch)
tree0e556d5e453efd20aaa6006870ab7a3466283218
parentc7e7b7920d974ca8ab04cf840d915fb0629b185f (diff)
parenta941bfb2f9373f02f6c0656a4d42b251c4e0c62c (diff)
Merge pull request #2105 from djpadz/userbug
Flashing an error if a nonexistent user is added to a project.
-rw-r--r--app/Controller/ProjectPermission.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/Controller/ProjectPermission.php b/app/Controller/ProjectPermission.php
index 800da02f..e203c0db 100644
--- a/app/Controller/ProjectPermission.php
+++ b/app/Controller/ProjectPermission.php
@@ -83,7 +83,9 @@ class ProjectPermission extends Base
$project = $this->getProject();
$values = $this->request->getValues();
- if ($this->projectUserRole->addUser($values['project_id'], $values['user_id'], $values['role'])) {
+ if (empty($values['user_id'])) {
+ $this->flash->failure(t('User not found.'));
+ } elseif ($this->projectUserRole->addUser($values['project_id'], $values['user_id'], $values['role'])) {
$this->flash->success(t('Project updated successfully.'));
} else {
$this->flash->failure(t('Unable to update this project.'));