diff options
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 |