From 2c056bb9bbfd22c7c2225964d994c79a60b7f64d Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 21 Oct 2014 18:51:59 -0400 Subject: Add option to allow everybody on a project --- app/Controller/Project.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'app/Controller') diff --git a/app/Controller/Project.php b/app/Controller/Project.php index a4ebdbc0..2b0258d5 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -183,6 +183,30 @@ class Project extends Base ))); } + /** + * Allow everybody + * + * @access public + */ + public function allowEverybody() + { + $project = $this->getProjectManagement(); + $values = $this->request->getValues() + array('is_everybody_allowed' => 0); + list($valid,) = $this->projectPermission->validateProjectModification($values); + + if ($valid) { + + if ($this->project->update($values)) { + $this->session->flash(t('Project updated successfully.')); + } + else { + $this->session->flashError(t('Unable to update this project.')); + } + } + + $this->response->redirect('?controller=project&action=users&project_id='.$project['id']); + } + /** * Allow a specific user (admin only) * @@ -191,7 +215,7 @@ class Project extends Base public function allow() { $values = $this->request->getValues(); - list($valid,) = $this->projectPermission->validateModification($values); + list($valid,) = $this->projectPermission->validateUserModification($values); if ($valid) { -- cgit v1.2.3