diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-08-11 22:18:53 -0700 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-08-11 22:18:53 -0700 |
commit | b79b18efd7a1a8b591753a4eddd473f88d55b7df (patch) | |
tree | fd5106e5f0d033e5106b46f3693931f6cc060bbf /app/Controller/UserModificationController.php | |
parent | 88dd6abbf3f519897f2f6280e95c9eec9123a4ae (diff) |
Filter variables when updating user profile
Diffstat (limited to 'app/Controller/UserModificationController.php')
-rw-r--r-- | app/Controller/UserModificationController.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/Controller/UserModificationController.php b/app/Controller/UserModificationController.php index ed145921..f4916f6f 100644 --- a/app/Controller/UserModificationController.php +++ b/app/Controller/UserModificationController.php @@ -47,9 +47,14 @@ class UserModificationController extends BaseController $values = $this->request->getValues(); if (! $this->userSession->isAdmin()) { - if (isset($values['role'])) { - unset($values['role']); - } + $values = array( + 'id' => $this->userSession->getId(), + 'username' => isset($values['username']) ? $values['username'] : '', + 'name' => isset($values['name']) ? $values['name'] : '', + 'email' => isset($values['email']) ? $values['email'] : '', + 'timezone' => isset($values['timezone']) ? $values['timezone'] : '', + 'language' => isset($values['language']) ? $values['language'] : '', + ); } list($valid, $errors) = $this->userValidator->validateModification($values); |