Fix bug when creatig a new user
When creating a new user, there is no data set for the users_settings table. This results in a JavaScript error that prevents the site from working correctly.
This commit is contained in:
@@ -296,7 +296,18 @@ class User extends CI_Model {
|
|||||||
|
|
||||||
$this->db->insert('users', array_merge($data, $additionalData));
|
$this->db->insert('users', array_merge($data, $additionalData));
|
||||||
|
|
||||||
return $this->db->affected_rows() > 0 ? $data['id'] : false;
|
$user_created = $this->db->affected_rows() == 1;
|
||||||
|
|
||||||
|
if($user_created) {
|
||||||
|
// set the initial user settings
|
||||||
|
$settings['user_id'] = $data['id'];
|
||||||
|
$settings['jobs_check_interval'] = 5;
|
||||||
|
|
||||||
|
$this->db->insert('users_settings', $settings);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user