Skip to content

Commit

Permalink
Merge pull request #3199 from magicbug/dev
Browse files Browse the repository at this point in the history
tag 2.6.16
  • Loading branch information
magicbug authored Oct 3, 2024
2 parents fd910d8 + 0c55dd6 commit 2260b6f
Show file tree
Hide file tree
Showing 49 changed files with 620 additions and 170 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ sync.sh
.env
/node_modules
/.vs
.vscode/sftp.json
2 changes: 1 addition & 1 deletion application/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
|
*/

$config['migration_version'] = 186;
$config['migration_version'] = 188;

/*
|--------------------------------------------------------------------------
Expand Down
25 changes: 22 additions & 3 deletions application/controllers/Distances.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ public function index()
$data['page_title'] = "Distances Worked";

$this->load->model('bands');
$this->load->model('gridmap_model');

$data['bands_available'] = $this->bands->get_worked_bands_distances();
$data['sats_available'] = $this->bands->get_worked_sats();
$data['modes'] = $this->gridmap_model->get_worked_modes();
$data['powers'] = $this->bands->get_worked_powers();

$this->load->view('interface_assets/header', $data);
$this->load->view('distances/index');
Expand Down Expand Up @@ -72,12 +76,27 @@ public function getDistanceQsos(){
$distance = $this->security->xss_clean($this->input->post('distance'));
$band = $this->security->xss_clean($this->input->post('band'));
$sat = $this->security->xss_clean($this->input->post('sat'));
$mode = $this->security->xss_clean($this->input->post('mode'));
$power = $this->security->xss_clean($this->input->post('pwr'));

$data['results'] = $this->distances_model->qso_details($distance, $band, $sat, $mode, $power);

$data['results'] = $this->distances_model->qso_details($distance, $band, $sat);
// Render Page
if (strtolower($band) == 'all') $band = lang('statistics_distances_bands_all');
(strtolower($mode) == 'all') ? $mode = lang('statistics_distances_modes_all') : $mode = strtoupper($mode);
switch (strtolower($power)) {
case 'all':
$power = lang('statistics_distances_bands_all');
break;
case '':
$power = lang('general_word_undefined');
break;
default:
$power .= 'W';
}

// Render Page
$data['page_title'] = "Log View - " . $distance;
$data['filter'] = lang('statistics_distances_qsos_with') . " " . $distance . " " . lang('statistics_distances_and_band'). " " . $band;
$data['filter'] = lang('statistics_distances_qsos_with') . " " . $distance . lang('statistics_distances_and_band') . " " . $band . lang('statistics_distances_and_mode') . $mode . lang('statistics_distances_and_power') . $power;
$this->load->view('awards/details', $data);
}
}
82 changes: 50 additions & 32 deletions application/controllers/Logbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,18 +820,25 @@ function partial($id) {
$html .= "</div>";
return $html;
} else {
if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) {
// if session data callbook_type is qrz
if ($this->session->userdata('callbook_type') == "QRZ") {
// Lookup using QRZ
$this->load->library('qrz');

// Load the encryption library
$this->load->library('encryption');

// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));

if(!$this->session->userdata('qrz_session_key')) {
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
}
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));

if (empty($callsign['callsign']['callsign'])) {
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
}
Expand All @@ -840,20 +847,27 @@ function partial($id) {
$entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']);
$callsign['callsign']['dxcc_name'] = $entity['name'];
}
} else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
} elseif ($this->session->userdata('callbook_type') == "HamQTH") {
// Load the HamQTH library
$this->load->library('hamqth');

// Load the encryption library
$this->load->library('encryption');

// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));


if(!$this->session->userdata('hamqth_session_key')) {
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
}

$callsign['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));

// If HamQTH session has expired, start a new session and retry the search.
if($callsign['callsign']['error'] == "Session does not exist or expired") {
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
$callsign['callsign'] = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key'));
}
Expand All @@ -873,13 +887,6 @@ function partial($id) {
$callsign['error'] = 'Lookup not configured. Please review configuration.';
}

// There's no hamli integration? Disabled for now.
/*else {
// Lookup using hamli
$this->load->library('hamli');
$callsign['callsign'] = $this->hamli->callsign($id);
}*/

if (isset($callsign['callsign']['gridsquare'])) {
$this->load->model('logbook_model');
Expand Down Expand Up @@ -929,44 +936,60 @@ function search_result($id="", $id2="") {

$this->load->view('view_log/partial/log_ajax.php', $data);
} else {
if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) {
// if session data callbook_type is qrz
if ($this->session->userdata('callbook_type') == "QRZ") {
// Lookup using QRZ
$this->load->library('qrz');

// Load the encryption library
$this->load->library('encryption');

// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));

if(!$this->session->userdata('qrz_session_key')) {
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
}
$data['callsign'] = $this->qrz->search($fixedid, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));

$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
if (isset($data['callsign']['gridsquare'])) {
$this->load->model('logbook_model');
$data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
if (empty($data['callsign']['callsign'])) {
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
$data['callsign'] = $this->qrz->search($fixedid, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
}
if (isset($data['callsign']['dxcc'])) {
$this->load->model('logbook_model');
$entity = $this->logbook_model->get_entity($data['callsign']['dxcc']);
$data['callsign']['dxcc_name'] = $entity['name'];
}
if (isset($data['callsign']['error'])) {
$data['error'] = $data['callsign']['error'];
if (isset($data['callsign']['gridsquare'])) {
$this->load->model('logbook_model');
$data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
}
} else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
} elseif ($this->session->userdata('callbook_type') == "HamQTH") {
// Load the HamQTH library
$this->load->library('hamqth');

// Load the encryption library
$this->load->library('encryption');

// Decrypt the password
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));


if(!$this->session->userdata('hamqth_session_key')) {
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
}

$data['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));
$data['callsign'] = $this->hamqth->search($fixedid, $this->session->userdata('hamqth_session_key'));

// If HamQTH session has expired, start a new session and retry the search.
if($data['callsign']['error'] == "Session does not exist or expired") {
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
$data['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));
$data['callsign'] = $this->hamqth->search($fixedid, $this->session->userdata('hamqth_session_key'));
}
if (isset($data['callsign']['gridsquare'])) {
$this->load->model('logbook_model');
Expand All @@ -982,12 +1005,7 @@ function search_result($id="", $id2="") {
}
} else {
$data['error'] = 'Lookup not configured. Please review configuration.';
} /*else {
// Lookup using hamli
$this->load->library('hamli');
$data['callsign'] = $this->hamli->callsign($id);
}*/
}

$data['id'] = strtoupper($id);

Expand Down
74 changes: 70 additions & 4 deletions application/controllers/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ function add()
$this->input->post('user_quicklog_enter'),
$this->input->post('language'),
$this->input->post('user_hamsat_key'),
$this->input->post('user_hamsat_workable_only')
$this->input->post('user_hamsat_workable_only'),
$this->input->post('user_callbook_type'),
$this->input->post('user_callbook_username'),
$this->input->post('user_callbook_password')
)) {
// Check for errors
case EUSERNAMEEXISTS:
Expand All @@ -228,6 +231,8 @@ function add()
redirect('user');
return;
}


$data['page_title'] = "Users";

$this->load->view('interface_assets/header', $data);
Expand Down Expand Up @@ -571,6 +576,43 @@ function edit()
$data['user_winkey'] = $q->winkey;
}

$this->load->model('user_options_model');
$callbook_type_object = $this->user_options_model->get_options('callbook')->result();

if ($this->input->post('user_callbook_type', true)) {
$data['user_callbook_type'] = $this->input->post('user_callbook_type', true);
} else {
if (isset($callbook_type_object[1]->option_value)) {
$data['user_callbook_type'] = $callbook_type_object[1]->option_value;
} else {
$data['user_callbook_type'] = "";
}
}


// Handle user_callbook_username
if ($this->input->post('user_callbook_username', true)) {
$data['user_callbook_username'] = $this->input->post('user_callbook_username', true);
} else {
if (isset($callbook_type_object[2]->option_value)) {
$data['user_callbook_username'] = $callbook_type_object[2]->option_value;
} else {
$data['user_callbook_username'] = "";
}
}

// Handle user_callbook_password
if ($this->input->post('user_callbook_password', true)) {
$data['user_callbook_password'] = $this->input->post('user_callbook_password', true);
} else {
if (isset($callbook_type_object[0]->option_value)) {
$data['user_callbook_password'] = $callbook_type_object[0]->option_value;
} else {
$data['user_callbook_password'] = "";
}
}


$this->load->model('user_options_model');
$hamsat_user_object = $this->user_options_model->get_options('hamsat')->result();

Expand All @@ -595,8 +637,6 @@ function edit()
}
}

// Get Settings for Dashboard

// Set defaults
$data['dashboard_upcoming_dx_card'] = false;
$data['dashboard_qslcard_card'] = false;
Expand Down Expand Up @@ -715,6 +755,33 @@ function edit()
$this->input->set_cookie($cookie);
}
if ($this->session->userdata('user_id') == $this->input->post('id', true)) {

// Handle user_callbook_type
if (isset($_POST['user_callbook_type'])) {
$this->user_options_model->set_option('callbook', 'callbook_type', array('value' => $_POST['user_callbook_type']));
} else {
$this->user_options_model->set_option('callbook', 'callbook_type', array('value' => ''));
}

// Handle user_callbook_username
if (isset($_POST['user_callbook_username'])) {
$this->user_options_model->set_option('callbook', 'callbook_username', array('value' => $_POST['user_callbook_username']));
} else {
$this->user_options_model->set_option('callbook', 'callbook_username', array('value' => ''));
}

// Handle user_callbook_password
if (isset($_POST['user_callbook_password']) && !empty($_POST['user_callbook_password'])) {
// Load the encryption library
$this->load->library('encryption');

// Encrypt the password
$encrypted_password = $this->encryption->encrypt($_POST['user_callbook_password']);

// Save the encrypted password
$this->user_options_model->set_option('callbook', 'callbook_password', array('value' => $encrypted_password));
}

if (isset($_POST['user_dashboard_enable_dxpedition_card'])) {
$this->user_options_model->set_option('dashboard', 'dashboard_upcoming_dx_card', array('enabled' => 'true'));
} else {
Expand Down Expand Up @@ -958,7 +1025,6 @@ function login()
'secure' => FALSE

);
$this->input->set_cookie($cookie);

// Create a remember me cookie
if ($this->input->post('remember_me') == '1') {
Expand Down
1 change: 1 addition & 0 deletions application/language/bulgarian/general_words_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
$lang['general_word_not_display'] = "Not display";
$lang['general_word_icon'] = "Icon";
$lang['general_word_never'] = "Never";
$lang['general_word_undefined'] = "Undefined";

$lang['general_word_date'] = 'Дата';
$lang['general_word_startdate'] = "Start Date";
Expand Down
7 changes: 5 additions & 2 deletions application/language/bulgarian/statistics_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@
*/

$lang['statistics_distances_bands_all'] = "All";
$lang['statistics_distances_modes_all'] = "All";
$lang['statistics_distances_worked'] = "Distances Worked";
$lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.<br /> Your furthest contact was with";
$lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare";
$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was";
$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is";
$lang['statistics_distances_number_of_qsos'] = "Number of QSOs";
$lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)";
$lang['statistics_distances_qsos_with'] = "QSOs with";
$lang['statistics_distances_and_band'] = "and band";
$lang['statistics_distances_qsos_with'] = "QSOs with distance : ";
$lang['statistics_distances_and_band'] = ", band : ";
$lang['statistics_distances_and_mode'] = ", mode : ";
$lang['statistics_distances_and_power'] = ", power : ";

/*
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
$lang['general_word_not_display'] = "不显示";
$lang['general_word_icon'] = "图标";
$lang['general_word_never'] = "从不";
$lang['general_word_undefined'] = "Undefined";

$lang['general_word_date'] = '日期';
$lang['general_word_startdate'] = "开始时间";
Expand Down
3 changes: 3 additions & 0 deletions application/language/chinese_simplified/statistics_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

$lang['statistics_distances_bands_all'] = "全部";
$lang['statistics_distances_modes_all'] = "全部";
$lang['statistics_distances_worked'] = "通联距离";
$lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "次通联<br /> 您最远的通联是与";
$lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "在网格";
Expand All @@ -35,6 +36,8 @@
$lang['statistics_distances_callsigns_worked'] = "通联的呼号(最多显示5个):";
$lang['statistics_distances_qsos_with'] = "QSO 与";
$lang['statistics_distances_and_band'] = "和波段";
$lang['statistics_distances_and_mode'] = ", 模式 : ";
$lang['statistics_distances_and_power'] = ", 发射功率 : ";

/*
*
Expand Down
1 change: 1 addition & 0 deletions application/language/czech/general_words_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
$lang['general_word_not_display'] = "Not display";
$lang['general_word_icon'] = "Icon";
$lang['general_word_never'] = "Never";
$lang['general_word_undefined'] = "Undefined";

$lang['general_word_date'] = 'Datum';
$lang['general_word_startdate'] = "Start Date";
Expand Down
Loading

0 comments on commit 2260b6f

Please sign in to comment.