diff options
Diffstat (limited to 'app/Controller/ProjectPermissionController.php')
-rw-r--r-- | app/Controller/ProjectPermissionController.php | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/app/Controller/ProjectPermissionController.php b/app/Controller/ProjectPermissionController.php index 56777b25..3fb6c090 100644 --- a/app/Controller/ProjectPermissionController.php +++ b/app/Controller/ProjectPermissionController.php @@ -60,25 +60,6 @@ class ProjectPermissionController extends BaseController } /** - * Allow everybody - * - * @access public - */ - public function allowEverybody() - { - $project = $this->getProject(); - $values = $this->request->getValues() + array('is_everybody_allowed' => 0); - - if ($this->projectModel->update($values)) { - $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']))); - } - - /** * Add user to the project * * @access public @@ -88,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'])) { |