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:
Karsten Heiken
2012-07-17 13:50:23 +02:00
parent 1f5e9923b0
commit 629be48196

View File

@@ -296,7 +296,18 @@ class User extends CI_Model {
$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;
}
/**