summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-10-21 18:51:59 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-10-21 18:51:59 -0400
commit2c056bb9bbfd22c7c2225964d994c79a60b7f64d (patch)
treef68c0f3f503ba4fd199eed2aee2cb201a1cc3a62 /app/Controller
parent88a1120d9b4fde8b3e8cddad6d2be3cdd9fbf806 (diff)
Add option to allow everybody on a project
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Project.php26
1 files changed, 25 insertions, 1 deletions
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
@@ -184,6 +184,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)
*
* @access public
@@ -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) {