mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Fix case when adding new user, make widget url variable in UI conditional to preven php warning
This commit is contained in:
@@ -211,7 +211,8 @@ class User_Model extends CI_Model {
|
||||
$user_language, $user_hamsat_key, $user_hamsat_workable_only, $user_iota_to_qso_tab, $user_sota_to_qso_tab,
|
||||
$user_wwff_to_qso_tab, $user_pota_to_qso_tab, $user_sig_to_qso_tab, $user_dok_to_qso_tab,
|
||||
$user_lotw_name, $user_lotw_password, $user_eqsl_name, $user_eqsl_password, $user_clublog_name, $user_clublog_password,
|
||||
$user_winkey, $clubstation = 0) {
|
||||
$user_winkey, $on_air_widget_enabled, $on_air_widget_display_last_seen, $on_air_widget_show_only_most_recent_radio,
|
||||
$clubstation = 0) {
|
||||
// Check that the user isn't already used
|
||||
if(!$this->exists($username)) {
|
||||
$data = array(
|
||||
@@ -267,6 +268,15 @@ class User_Model extends CI_Model {
|
||||
return EEMAILEXISTS;
|
||||
}
|
||||
|
||||
// Generate user-slug
|
||||
if (!$this->load->is_loaded('encryption')) {
|
||||
$this->load->library('encryption');
|
||||
}
|
||||
$user_slug_base = md5($this->encryption->encrypt($username));
|
||||
$slug_length = 10;
|
||||
$user_slug = substr($user_slug_base, 0, $slug_length);
|
||||
$data['slug'] = $user_slug;
|
||||
|
||||
// Add user and insert bandsettings for user
|
||||
$this->db->insert($this->config->item('auth_table'), $data);
|
||||
$insert_id = $this->db->insert_id();
|
||||
@@ -286,6 +296,9 @@ class User_Model extends CI_Model {
|
||||
$this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','sig','show',".(xss_clean($user_sig_to_qso_tab ?? 'off') == "on" ? 1 : 0).");");
|
||||
$this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'qso_tab','dok','show',".(xss_clean($user_dok_to_qso_tab ?? 'off') == "on" ? 1 : 0).");");
|
||||
$this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'dashboard','show_map','boolean','".xss_clean($fields['user_dashboard_map'] ?? 'Y')."');");
|
||||
$this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'widget','on_air','enabled','".(xss_clean($on_air_widget_enabled ?? 'false'))."');");
|
||||
$this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'widget','on_air','display_last_seen','".(xss_clean($on_air_widget_display_last_seen ?? 'false'))."');");
|
||||
$this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'widget','on_air','display_only_most_recent_radio','".(xss_clean($on_air_widget_show_only_most_recent_radio ?? 'true'))."');");
|
||||
|
||||
return OK;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user