Update the session language and remove password from the $account array

This commit is contained in:
Alex Tselegidis 2022-05-22 13:50:25 +02:00
parent c85d47befc
commit 48122c4cd3

View file

@ -109,7 +109,7 @@ class Account extends EA_Controller {
'language', 'language',
'settings' 'settings'
]); ]);
$this->users_model->only($account['settings'], [ $this->users_model->only($account['settings'], [
'username', 'username',
'password', 'password',
@ -117,12 +117,18 @@ class Account extends EA_Controller {
'calendar_view' 'calendar_view'
]); ]);
if (empty($account['password']))
{
unset($account['password']);
}
$this->users_model->save($account); $this->users_model->save($account);
session([ session([
'user_email' => $account['email'], 'user_email' => $account['email'],
'username' => $account['settings']['username'], 'username' => $account['settings']['username'],
'timezone' => $account['timezone'], 'timezone' => $account['timezone'],
'language' => $account['language'],
]); ]);
response(); response();