mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
external_account flag for sso accounts
This commit is contained in:
@@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
||||
|
|
||||
*/
|
||||
|
||||
$config['migration_version'] = 271;
|
||||
$config['migration_version'] = 272;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
21
application/migrations/272_external_account.php
Normal file
21
application/migrations/272_external_account.php
Normal 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user