diff options
| author | Frederic Guillot <fred@kanboard.net> | 2015-10-03 12:09:27 -0400 |
|---|---|---|
| committer | Frederic Guillot <fred@kanboard.net> | 2015-10-03 12:09:27 -0400 |
| commit | d67d7c54e65e80d1b484490e42dbecb969aa7686 (patch) | |
| tree | e62446885fac0d3af5b29d409d8e9a4f6c50940e /app/Controller/User.php | |
| parent | b5a2b8f9f7ac9ef947357acd3981993159d64b52 (diff) | |
Add web notifications
Diffstat (limited to 'app/Controller/User.php')
| -rw-r--r-- | app/Controller/User.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/Controller/User.php b/app/Controller/User.php index 04e57417..0b39619d 100644 --- a/app/Controller/User.php +++ b/app/Controller/User.php @@ -2,6 +2,8 @@ namespace Controller; +use Model\NotificationType; + /** * User controller * @@ -92,6 +94,11 @@ class User extends Base if ($user_id !== false) { $this->projectPermission->addMember($project_id, $user_id); + + if (! empty($values['notifications_enabled'])) { + $this->notificationType->saveUserSelectedTypes($user_id, array(NotificationType::TYPE_EMAIL)); + } + $this->session->flash(t('User created successfully.')); $this->response->redirect($this->helper->url->to('user', 'show', array('user_id' => $user_id))); } @@ -202,6 +209,8 @@ class User extends Base $this->response->html($this->layout('user/notifications', array( 'projects' => $this->projectPermission->getMemberProjects($user['id']), 'notifications' => $this->notification->readSettings($user['id']), + 'types' => $this->notificationType->getTypes(), + 'filters' => $this->notificationFilter->getFilters(), 'user' => $user, ))); } |
