From 9eeded33f68872515954a2fc177fcb47a9273ae9 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 15 Aug 2014 17:23:41 -0700 Subject: Add email notifications --- app/Controller/Config.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'app/Controller/Config.php') 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, -- cgit v1.2.3