diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-05-18 12:56:32 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-05-18 12:56:32 -0400 |
commit | 46eafe105fe97b7be8b8a25a72b491bef03fea8c (patch) | |
tree | c499a668b23ca6edf4cd158e4f8dc57d6b31edd6 /app/Controller/User.php | |
parent | ac6e7bdfbf3479c655d7b883e50b6b01aa08784d (diff) |
Add ical export for users
Diffstat (limited to 'app/Controller/User.php')
-rw-r--r-- | app/Controller/User.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/Controller/User.php b/app/Controller/User.php index 37f10969..c8496418 100644 --- a/app/Controller/User.php +++ b/app/Controller/User.php @@ -249,6 +249,35 @@ class User extends Base } /** + * Public access management + * + * @access public + */ + public function share() + { + $user = $this->getUser(); + $switch = $this->request->getStringParam('switch'); + + if ($switch === 'enable' || $switch === 'disable') { + + $this->checkCSRFParam(); + + if ($this->user->{$switch.'PublicAccess'}($user['id'])) { + $this->session->flash(t('User updated successfully.')); + } else { + $this->session->flashError(t('Unable to update this user.')); + } + + $this->response->redirect($this->helper->url('user', 'share', array('user_id' => $user['id']))); + } + + $this->response->html($this->layout('user/share', array( + 'user' => $user, + 'title' => t('Public access'), + ))); + } + + /** * Password modification * * @access public |