From 8842e2d9181b5c9df337a564febcb2da03dc1b2a Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 12 Nov 2020 14:47:15 +0200 Subject: [PATCH] Update session date based on the current user settings page updates --- application/controllers/Backend_api.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/application/controllers/Backend_api.php b/application/controllers/Backend_api.php index 5a6e7896..0f5992ed 100755 --- a/application/controllers/Backend_api.php +++ b/application/controllers/Backend_api.php @@ -1565,7 +1565,15 @@ class Backend_api extends CI_Controller { $this->load->model('user_model'); - $this->user_model->save_user(json_decode($this->input->post('settings'), TRUE)); + $settings = json_decode($this->input->post('settings'), TRUE); + + $this->user_model->save_user($settings); + + $this->session->set_userdata([ + 'user_email' => $settings['email'], + 'username' => $settings['settings']['username'], + 'timezone' => $settings['timezone'], + ]); } }