Whitelist incoming account update request params (#1225)

This commit is contained in:
Alex Tselegidis 2022-03-25 11:59:00 +01:00
parent 0452e9543d
commit b7833643c2

View file

@ -91,6 +91,32 @@ class Account extends EA_Controller {
$account = request('account'); $account = request('account');
$account['id'] = session('user_id');
$this->users_model->only($account, [
'id',
'first_name',
'last_name',
'email',
'mobile_number',
'phone_number',
'address',
'city',
'state',
'zip_code',
'notes',
'timezone',
'language',
'settings'
]);
$this->users_model->only($account['settings'], [
'username',
'password',
'notifications',
'calendar_view'
]);
$this->users_model->save($account); $this->users_model->save($account);
session([ session([