diff options
author | Frédéric Guillot <fred@kanboard.net> | 2016-04-09 15:43:06 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2016-04-09 15:43:06 -0400 |
commit | 42813d702d1c3e5659301bc771f8dbb37a6d15cd (patch) | |
tree | 0e556d5e453efd20aaa6006870ab7a3466283218 /app/Controller/ProjectPermission.php | |
parent | c7e7b7920d974ca8ab04cf840d915fb0629b185f (diff) | |
parent | a941bfb2f9373f02f6c0656a4d42b251c4e0c62c (diff) |
Merge pull request #2105 from djpadz/userbug
Flashing an error if a nonexistent user is added to a project.
Diffstat (limited to 'app/Controller/ProjectPermission.php')
-rw-r--r-- | app/Controller/ProjectPermission.php | 4 |
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.')); |