summaryrefslogtreecommitdiff
path: root/app/Controller/ProjectPermissionController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/ProjectPermissionController.php')
-rw-r--r--app/Controller/ProjectPermissionController.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/Controller/ProjectPermissionController.php b/app/Controller/ProjectPermissionController.php
index d043d3ec..3fb6c090 100644
--- a/app/Controller/ProjectPermissionController.php
+++ b/app/Controller/ProjectPermissionController.php
@@ -69,6 +69,10 @@ class ProjectPermissionController extends BaseController
$project = $this->getProject();
$values = $this->request->getValues();
+ if (empty($values['user_id']) && ! empty($values['external_id']) && ! empty($values['external_id_column'])) {
+ $values['user_id'] = $this->userModel->getOrCreateExternalUserId($values['username'], $values['name'], $values['external_id_column'], $values['external_id']);
+ }
+
if (empty($values['user_id'])) {
$this->flash->failure(t('User not found.'));
} elseif ($this->projectUserRoleModel->addUser($values['project_id'], $values['user_id'], $values['role'])) {