diff options
author | Dj Padzensky <djpadz@padz.net> | 2016-04-08 15:20:34 -0700 |
---|---|---|
committer | Dj Padzensky <djpadz@padz.net> | 2016-04-08 15:20:34 -0700 |
commit | a941bfb2f9373f02f6c0656a4d42b251c4e0c62c (patch) | |
tree | f8fcb68dca43e31079f50784ea023c94fc41588a /app | |
parent | 4badb84dbaef0a81e8e292e932769aa3b96099d9 (diff) |
Flashing an error if a nonexistent user is added to a project.
Diffstat (limited to 'app')
-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.')); |