Skip to content

Commit 2260b6f

Browse files
authored
Merge pull request #3199 from magicbug/dev
tag 2.6.16
2 parents fd910d8 + 0c55dd6 commit 2260b6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+620
-170
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ sync.sh
2323
.env
2424
/node_modules
2525
/.vs
26+
.vscode/sftp.json

application/config/migration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
|
2323
*/
2424

25-
$config['migration_version'] = 186;
25+
$config['migration_version'] = 188;
2626

2727
/*
2828
|--------------------------------------------------------------------------

application/controllers/Distances.php

+22-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ public function index()
1717
$data['page_title'] = "Distances Worked";
1818

1919
$this->load->model('bands');
20+
$this->load->model('gridmap_model');
21+
2022
$data['bands_available'] = $this->bands->get_worked_bands_distances();
2123
$data['sats_available'] = $this->bands->get_worked_sats();
24+
$data['modes'] = $this->gridmap_model->get_worked_modes();
25+
$data['powers'] = $this->bands->get_worked_powers();
2226

2327
$this->load->view('interface_assets/header', $data);
2428
$this->load->view('distances/index');
@@ -72,12 +76,27 @@ public function getDistanceQsos(){
7276
$distance = $this->security->xss_clean($this->input->post('distance'));
7377
$band = $this->security->xss_clean($this->input->post('band'));
7478
$sat = $this->security->xss_clean($this->input->post('sat'));
79+
$mode = $this->security->xss_clean($this->input->post('mode'));
80+
$power = $this->security->xss_clean($this->input->post('pwr'));
81+
82+
$data['results'] = $this->distances_model->qso_details($distance, $band, $sat, $mode, $power);
7583

76-
$data['results'] = $this->distances_model->qso_details($distance, $band, $sat);
84+
// Render Page
85+
if (strtolower($band) == 'all') $band = lang('statistics_distances_bands_all');
86+
(strtolower($mode) == 'all') ? $mode = lang('statistics_distances_modes_all') : $mode = strtoupper($mode);
87+
switch (strtolower($power)) {
88+
case 'all':
89+
$power = lang('statistics_distances_bands_all');
90+
break;
91+
case '':
92+
$power = lang('general_word_undefined');
93+
break;
94+
default:
95+
$power .= 'W';
96+
}
7797

78-
// Render Page
7998
$data['page_title'] = "Log View - " . $distance;
80-
$data['filter'] = lang('statistics_distances_qsos_with') . " " . $distance . " " . lang('statistics_distances_and_band'). " " . $band;
99+
$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;
81100
$this->load->view('awards/details', $data);
82101
}
83102
}

application/controllers/Logbook.php

+50-32
Original file line numberDiff line numberDiff line change
@@ -820,18 +820,25 @@ function partial($id) {
820820
$html .= "</div>";
821821
return $html;
822822
} else {
823-
if ($this->config->item('callbook') == "qrz" && $this->config->item('qrz_username') != null && $this->config->item('qrz_password') != null) {
823+
// if session data callbook_type is qrz
824+
if ($this->session->userdata('callbook_type') == "QRZ") {
824825
// Lookup using QRZ
825826
$this->load->library('qrz');
826827

828+
// Load the encryption library
829+
$this->load->library('encryption');
830+
831+
// Decrypt the password
832+
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
833+
827834
if(!$this->session->userdata('qrz_session_key')) {
828-
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
835+
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
829836
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
830837
}
831838
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
832839

833840
if (empty($callsign['callsign']['callsign'])) {
834-
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
841+
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
835842
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
836843
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
837844
}
@@ -840,20 +847,27 @@ function partial($id) {
840847
$entity = $this->logbook_model->get_entity($callsign['callsign']['dxcc']);
841848
$callsign['callsign']['dxcc_name'] = $entity['name'];
842849
}
843-
} else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
850+
} elseif ($this->session->userdata('callbook_type') == "HamQTH") {
844851
// Load the HamQTH library
845852
$this->load->library('hamqth');
846853

854+
// Load the encryption library
855+
$this->load->library('encryption');
856+
857+
// Decrypt the password
858+
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
859+
860+
847861
if(!$this->session->userdata('hamqth_session_key')) {
848-
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
862+
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
849863
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
850864
}
851865

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

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

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

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

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

944+
// Load the encryption library
945+
$this->load->library('encryption');
946+
947+
// Decrypt the password
948+
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
949+
936950
if(!$this->session->userdata('qrz_session_key')) {
937-
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
951+
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
938952
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
939953
}
954+
$data['callsign'] = $this->qrz->search($fixedid, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
940955

941-
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
942-
if (isset($data['callsign']['gridsquare'])) {
943-
$this->load->model('logbook_model');
944-
$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'));
956+
if (empty($data['callsign']['callsign'])) {
957+
$qrz_session_key = $this->qrz->session($this->session->userdata('callbook_username'), $decrypted_password);
958+
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
959+
$data['callsign'] = $this->qrz->search($fixedid, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
945960
}
946961
if (isset($data['callsign']['dxcc'])) {
947962
$this->load->model('logbook_model');
948963
$entity = $this->logbook_model->get_entity($data['callsign']['dxcc']);
949964
$data['callsign']['dxcc_name'] = $entity['name'];
950965
}
951-
if (isset($data['callsign']['error'])) {
952-
$data['error'] = $data['callsign']['error'];
966+
if (isset($data['callsign']['gridsquare'])) {
967+
$this->load->model('logbook_model');
968+
$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'));
953969
}
954-
} else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
970+
} elseif ($this->session->userdata('callbook_type') == "HamQTH") {
955971
// Load the HamQTH library
956972
$this->load->library('hamqth');
957973

974+
// Load the encryption library
975+
$this->load->library('encryption');
976+
977+
// Decrypt the password
978+
$decrypted_password = $this->encryption->decrypt($this->session->userdata('callbook_password'));
979+
980+
958981
if(!$this->session->userdata('hamqth_session_key')) {
959-
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
982+
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
960983
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
961984
}
962985

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

965988
// If HamQTH session has expired, start a new session and retry the search.
966989
if($data['callsign']['error'] == "Session does not exist or expired") {
967-
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
990+
$hamqth_session_key = $this->hamqth->session($this->session->userdata('callbook_username'), $decrypted_password);
968991
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
969-
$data['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));
992+
$data['callsign'] = $this->hamqth->search($fixedid, $this->session->userdata('hamqth_session_key'));
970993
}
971994
if (isset($data['callsign']['gridsquare'])) {
972995
$this->load->model('logbook_model');
@@ -982,12 +1005,7 @@ function search_result($id="", $id2="") {
9821005
}
9831006
} else {
9841007
$data['error'] = 'Lookup not configured. Please review configuration.';
985-
} /*else {
986-
// Lookup using hamli
987-
$this->load->library('hamli');
988-
989-
$data['callsign'] = $this->hamli->callsign($id);
990-
}*/
1008+
}
9911009

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

application/controllers/User.php

+70-4
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ function add()
210210
$this->input->post('user_quicklog_enter'),
211211
$this->input->post('language'),
212212
$this->input->post('user_hamsat_key'),
213-
$this->input->post('user_hamsat_workable_only')
213+
$this->input->post('user_hamsat_workable_only'),
214+
$this->input->post('user_callbook_type'),
215+
$this->input->post('user_callbook_username'),
216+
$this->input->post('user_callbook_password')
214217
)) {
215218
// Check for errors
216219
case EUSERNAMEEXISTS:
@@ -228,6 +231,8 @@ function add()
228231
redirect('user');
229232
return;
230233
}
234+
235+
231236
$data['page_title'] = "Users";
232237

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

579+
$this->load->model('user_options_model');
580+
$callbook_type_object = $this->user_options_model->get_options('callbook')->result();
581+
582+
if ($this->input->post('user_callbook_type', true)) {
583+
$data['user_callbook_type'] = $this->input->post('user_callbook_type', true);
584+
} else {
585+
if (isset($callbook_type_object[1]->option_value)) {
586+
$data['user_callbook_type'] = $callbook_type_object[1]->option_value;
587+
} else {
588+
$data['user_callbook_type'] = "";
589+
}
590+
}
591+
592+
593+
// Handle user_callbook_username
594+
if ($this->input->post('user_callbook_username', true)) {
595+
$data['user_callbook_username'] = $this->input->post('user_callbook_username', true);
596+
} else {
597+
if (isset($callbook_type_object[2]->option_value)) {
598+
$data['user_callbook_username'] = $callbook_type_object[2]->option_value;
599+
} else {
600+
$data['user_callbook_username'] = "";
601+
}
602+
}
603+
604+
// Handle user_callbook_password
605+
if ($this->input->post('user_callbook_password', true)) {
606+
$data['user_callbook_password'] = $this->input->post('user_callbook_password', true);
607+
} else {
608+
if (isset($callbook_type_object[0]->option_value)) {
609+
$data['user_callbook_password'] = $callbook_type_object[0]->option_value;
610+
} else {
611+
$data['user_callbook_password'] = "";
612+
}
613+
}
614+
615+
574616
$this->load->model('user_options_model');
575617
$hamsat_user_object = $this->user_options_model->get_options('hamsat')->result();
576618

@@ -595,8 +637,6 @@ function edit()
595637
}
596638
}
597639

598-
// Get Settings for Dashboard
599-
600640
// Set defaults
601641
$data['dashboard_upcoming_dx_card'] = false;
602642
$data['dashboard_qslcard_card'] = false;
@@ -715,6 +755,33 @@ function edit()
715755
$this->input->set_cookie($cookie);
716756
}
717757
if ($this->session->userdata('user_id') == $this->input->post('id', true)) {
758+
759+
// Handle user_callbook_type
760+
if (isset($_POST['user_callbook_type'])) {
761+
$this->user_options_model->set_option('callbook', 'callbook_type', array('value' => $_POST['user_callbook_type']));
762+
} else {
763+
$this->user_options_model->set_option('callbook', 'callbook_type', array('value' => ''));
764+
}
765+
766+
// Handle user_callbook_username
767+
if (isset($_POST['user_callbook_username'])) {
768+
$this->user_options_model->set_option('callbook', 'callbook_username', array('value' => $_POST['user_callbook_username']));
769+
} else {
770+
$this->user_options_model->set_option('callbook', 'callbook_username', array('value' => ''));
771+
}
772+
773+
// Handle user_callbook_password
774+
if (isset($_POST['user_callbook_password']) && !empty($_POST['user_callbook_password'])) {
775+
// Load the encryption library
776+
$this->load->library('encryption');
777+
778+
// Encrypt the password
779+
$encrypted_password = $this->encryption->encrypt($_POST['user_callbook_password']);
780+
781+
// Save the encrypted password
782+
$this->user_options_model->set_option('callbook', 'callbook_password', array('value' => $encrypted_password));
783+
}
784+
718785
if (isset($_POST['user_dashboard_enable_dxpedition_card'])) {
719786
$this->user_options_model->set_option('dashboard', 'dashboard_upcoming_dx_card', array('enabled' => 'true'));
720787
} else {
@@ -958,7 +1025,6 @@ function login()
9581025
'secure' => FALSE
9591026

9601027
);
961-
$this->input->set_cookie($cookie);
9621028

9631029
// Create a remember me cookie
9641030
if ($this->input->post('remember_me') == '1') {

application/language/bulgarian/general_words_lang.php

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
$lang['general_word_not_display'] = "Not display";
2727
$lang['general_word_icon'] = "Icon";
2828
$lang['general_word_never'] = "Never";
29+
$lang['general_word_undefined'] = "Undefined";
2930

3031
$lang['general_word_date'] = 'Дата';
3132
$lang['general_word_startdate'] = "Start Date";

application/language/bulgarian/statistics_lang.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,18 @@
2626
*/
2727

2828
$lang['statistics_distances_bands_all'] = "All";
29+
$lang['statistics_distances_modes_all'] = "All";
2930
$lang['statistics_distances_worked'] = "Distances Worked";
3031
$lang['statistics_distances_part1_contacts_were_plotted_furthest'] = "contacts were plotted.<br /> Your furthest contact was with";
3132
$lang['statistics_distances_part2_contacts_were_plotted_furthest'] = "in gridsquare";
3233
$lang['statistics_distances_part3_contacts_were_plotted_furthest'] = "The distance was";
3334
$lang['statistics_distances_part4_contacts_were_plotted_furthest'] = "The average distance is";
3435
$lang['statistics_distances_number_of_qsos'] = "Number of QSOs";
3536
$lang['statistics_distances_callsigns_worked'] = "Callsign(s) worked (max 5 shown)";
36-
$lang['statistics_distances_qsos_with'] = "QSOs with";
37-
$lang['statistics_distances_and_band'] = "and band";
37+
$lang['statistics_distances_qsos_with'] = "QSOs with distance : ";
38+
$lang['statistics_distances_and_band'] = ", band : ";
39+
$lang['statistics_distances_and_mode'] = ", mode : ";
40+
$lang['statistics_distances_and_power'] = ", power : ";
3841

3942
/*
4043
*

application/language/chinese_simplified/general_words_lang.php

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
$lang['general_word_not_display'] = "不显示";
2727
$lang['general_word_icon'] = "图标";
2828
$lang['general_word_never'] = "从不";
29+
$lang['general_word_undefined'] = "Undefined";
2930

3031
$lang['general_word_date'] = '日期';
3132
$lang['general_word_startdate'] = "开始时间";

application/language/chinese_simplified/statistics_lang.php

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*/
2727

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

3942
/*
4043
*

application/language/czech/general_words_lang.php

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
$lang['general_word_not_display'] = "Not display";
2727
$lang['general_word_icon'] = "Icon";
2828
$lang['general_word_never'] = "Never";
29+
$lang['general_word_undefined'] = "Undefined";
2930

3031
$lang['general_word_date'] = 'Datum';
3132
$lang['general_word_startdate'] = "Start Date";

0 commit comments

Comments
 (0)