diff --git a/application/config/migration.php b/application/config/migration.php index dcd5de722..d6b180776 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 271; +$config['migration_version'] = 272; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Header_auth.php b/application/controllers/Header_auth.php index 36d28bc01..78b85a302 100644 --- a/application/controllers/Header_auth.php +++ b/application/controllers/Header_auth.php @@ -217,6 +217,8 @@ class Header_auth extends CI_Controller { "", // oqrs_direct_auto_matching "", // user_dxwaterfall_enable "", // user_qso_show_map + 0, // clubstation + true, // external_account ); switch ($result) { diff --git a/application/controllers/User.php b/application/controllers/User.php index 44b6df6db..49d6f4251 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -1300,6 +1300,11 @@ class User extends CI_Controller { $this->input->set_cookie('tmp_msg', json_encode(['notice', sprintf(__("User %s logged out."), $user_name)]), 10, ''); } + $logout = $this->config->item('auth_url_logout'); + if ($this->config->item('auth_header_enable') && $logout !== null && $logout !== '') { + redirect($logout); + } + redirect('user/login'); } diff --git a/application/migrations/272_external_account.php b/application/migrations/272_external_account.php new file mode 100644 index 000000000..bcb468d09 --- /dev/null +++ b/application/migrations/272_external_account.php @@ -0,0 +1,21 @@ +dbtry("ALTER TABLE users ADD COLUMN external_account tinyint DEFAULT 0 AFTER clubstation"); + } + + public function down() { + $this->dbtry("ALTER TABLE users DROP COLUMN external_account"); + } + + function dbtry($what) { + try { + $this->db->query($what); + } catch (Exception $e) { + log_message("error", "Something gone wrong while altering users table. Executing: " . $this->db->last_query()); + } + } +} diff --git a/application/models/User_model.php b/application/models/User_model.php index 3fc0e422b..c1102a6dc 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -225,7 +225,7 @@ class User_Model extends CI_Model { $user_lotw_name, $user_lotw_password, $user_eqsl_name, $user_eqsl_password, $user_clublog_name, $user_clublog_password, $user_winkey, $on_air_widget_enabled, $on_air_widget_display_last_seen, $on_air_widget_show_only_most_recent_radio, $qso_widget_display_qso_time, $dashboard_banner, $dashboard_solar, $global_oqrs_text, $oqrs_grouped_search, - $oqrs_grouped_search_show_station_name, $oqrs_auto_matching, $oqrs_direct_auto_matching,$user_dxwaterfall_enable, $user_qso_show_map, $clubstation = 0) { + $oqrs_grouped_search_show_station_name, $oqrs_auto_matching, $oqrs_direct_auto_matching,$user_dxwaterfall_enable, $user_qso_show_map, $clubstation = 0, $external_account = false) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -269,6 +269,7 @@ class User_Model extends CI_Model { 'user_clublog_password' => xss_clean($user_clublog_password), 'winkey' => xss_clean($user_winkey), 'clubstation' => $clubstation, + 'external_account' => $external_account ); // Check the password is valid