From 305f8d3eb6ce3c170a984be4fbf1136ded71fdc3 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Wed, 16 Sep 2020 20:54:26 +0100 Subject: [PATCH] [User] Added missing logic to actually save date format and also measurement when creating a user --- application/controllers/User.php | 2 +- application/models/User_model.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/User.php b/application/controllers/User.php index 00c9d59b..aa1c1e4b 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -62,7 +62,7 @@ class User extends CI_Controller { } else { - switch($this->user_model->add($this->input->post('user_name'), $this->input->post('user_password'), $this->input->post('user_email'), $this->input->post('user_type'), $this->input->post('user_firstname'), $this->input->post('user_lastname'), $this->input->post('user_callsign'), $this->input->post('user_locator'), $this->input->post('user_timezone'))) { + switch($this->user_model->add($this->input->post('user_name'), $this->input->post('user_password'), $this->input->post('user_email'), $this->input->post('user_type'), $this->input->post('user_firstname'), $this->input->post('user_lastname'), $this->input->post('user_callsign'), $this->input->post('user_locator'), $this->input->post('user_timezone'), $this->input->post('user_measurement_base'), $this->input->post('user_date_format'))) { // Check for errors case EUSERNAMEEXISTS: $data['username_error'] = 'Username '.$this->input->post('user_name').' already in use!'; diff --git a/application/models/User_model.php b/application/models/User_model.php index e751f308..c83d0c7d 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -96,7 +96,7 @@ class User_Model extends CI_Model { // FUNCTION: bool add($username, $password, $email, $type) // Add a user - function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone) { + function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone, $measurement, $user_date_format) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -108,7 +108,9 @@ class User_Model extends CI_Model { 'user_lastname' => xss_clean($lastname), 'user_callsign' => xss_clean($callsign), 'user_locator' => xss_clean($locator), - 'user_timezone' => xss_clean($timezone) + 'user_timezone' => xss_clean($timezone), + 'user_measurement_base' => xss_clean($measurement), + 'user_date_format' => xss_clean($user_date_format), ); // Check the password is valid