summaryrefslogtreecommitdiff
path: root/app/Controller/Config.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-08-15 17:23:41 -0700
committerFrédéric Guillot <fred@kanboard.net>2014-08-15 17:23:41 -0700
commit9eeded33f68872515954a2fc177fcb47a9273ae9 (patch)
treef3ef9507e087ca6bf3ce624232da240a8689b051 /app/Controller/Config.php
parentc539bdc8ab746c5afd48cf87de057dc38d50adac (diff)
Add email notifications
Diffstat (limited to 'app/Controller/Config.php')
-rw-r--r--app/Controller/Config.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/app/Controller/Config.php b/app/Controller/Config.php
index daa57790..498f3214 100644
--- a/app/Controller/Config.php
+++ b/app/Controller/Config.php
@@ -20,7 +20,8 @@ class Config extends Base
$this->response->html($this->template->layout('config_index', array(
'db_size' => $this->config->getDatabaseSize(),
'user' => $_SESSION['user'],
- 'projects' => $this->project->getList(),
+ 'user_projects' => $this->project->getAvailableList($this->acl->getUserId()),
+ 'notifications' => $this->notification->readSettings($this->acl->getUserId()),
'languages' => $this->config->getLanguages(),
'values' => $this->config->getAll(),
'errors' => array(),
@@ -32,6 +33,13 @@ class Config extends Base
)));
}
+ public function notifications()
+ {
+ $values = $this->request->getValues();
+ $this->notification->saveSettings($this->acl->getUserId(), $values);
+ $this->response->redirect('?controller=config#notifications');
+ }
+
/**
* Validate and save settings
*
@@ -57,7 +65,8 @@ class Config extends Base
$this->response->html($this->template->layout('config_index', array(
'db_size' => $this->config->getDatabaseSize(),
'user' => $_SESSION['user'],
- 'projects' => $this->project->getList(),
+ 'user_projects' => $this->project->getAvailableList($this->acl->getUserId()),
+ 'notifications' => $this->notification->readSettings($this->acl->getUserId()),
'languages' => $this->config->getLanguages(),
'values' => $values,
'errors' => $errors,