summaryrefslogtreecommitdiff
path: root/app/Controller/User.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-18 12:56:32 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-18 12:56:32 -0400
commit46eafe105fe97b7be8b8a25a72b491bef03fea8c (patch)
treec499a668b23ca6edf4cd158e4f8dc57d6b31edd6 /app/Controller/User.php
parentac6e7bdfbf3479c655d7b883e50b6b01aa08784d (diff)
Add ical export for users
Diffstat (limited to 'app/Controller/User.php')
-rw-r--r--app/Controller/User.php29
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