external_account flag for sso accounts

This commit is contained in:
HB9HIL
2026-03-08 23:28:03 +01:00
parent ee5dd2425f
commit c049434f2a
5 changed files with 31 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
*/
$config['migration_version'] = 271;
$config['migration_version'] = 272;
/*
|--------------------------------------------------------------------------

View File

@@ -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) {

View File

@@ -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');
}

View File

@@ -0,0 +1,21 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_external_account extends CI_Migration {
public function up() {
$this->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());
}
}
}

View File

@@ -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