[User] Added missing logic to actually save date format and also measurement when creating a user

这个提交包含在:
Peter Goodhall 2020-09-16 20:54:26 +01:00
父节点 58e69f7ef4
当前提交 305f8d3eb6
共有 2 个文件被更改,包括 5 次插入3 次删除

查看文件

@ -62,7 +62,7 @@ class User extends CI_Controller {
} }
else 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 // Check for errors
case EUSERNAMEEXISTS: case EUSERNAMEEXISTS:
$data['username_error'] = 'Username <b>'.$this->input->post('user_name').'</b> already in use!'; $data['username_error'] = 'Username <b>'.$this->input->post('user_name').'</b> already in use!';

查看文件

@ -96,7 +96,7 @@ class User_Model extends CI_Model {
// FUNCTION: bool add($username, $password, $email, $type) // FUNCTION: bool add($username, $password, $email, $type)
// Add a user // 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 // Check that the user isn't already used
if(!$this->exists($username)) { if(!$this->exists($username)) {
$data = array( $data = array(
@ -108,7 +108,9 @@ class User_Model extends CI_Model {
'user_lastname' => xss_clean($lastname), 'user_lastname' => xss_clean($lastname),
'user_callsign' => xss_clean($callsign), 'user_callsign' => xss_clean($callsign),
'user_locator' => xss_clean($locator), '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 // Check the password is valid