From 46eafe105fe97b7be8b8a25a72b491bef03fea8c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 18 May 2015 12:56:32 -0400 Subject: Add ical export for users --- app/Controller/User.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'app/Controller/User.php') 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 @@ -248,6 +248,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 * -- cgit v1.2.3