From 48122c4cd348231e2c5d6c83abeee8fca3a79e8a Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sun, 22 May 2022 13:50:25 +0200 Subject: [PATCH] Update the session language and remove password from the $account array --- application/controllers/Account.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/controllers/Account.php b/application/controllers/Account.php index cb4c15fd..c7e47686 100644 --- a/application/controllers/Account.php +++ b/application/controllers/Account.php @@ -109,7 +109,7 @@ class Account extends EA_Controller { 'language', 'settings' ]); - + $this->users_model->only($account['settings'], [ 'username', 'password', @@ -117,12 +117,18 @@ class Account extends EA_Controller { 'calendar_view' ]); + if (empty($account['password'])) + { + unset($account['password']); + } + $this->users_model->save($account); session([ 'user_email' => $account['email'], 'username' => $account['settings']['username'], 'timezone' => $account['timezone'], + 'language' => $account['language'], ]); response();