Skip to content

Commit 3c56904

Browse files
authored
Merge pull request wavelog#213 from wavelog/dev
Release V1.3
2 parents de1dadd + ab3b0a7 commit 3c56904

File tree

190 files changed

+41826
-2697
lines changed

Some content is hidden

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

190 files changed

+41826
-2697
lines changed

application/config/config.sample.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
| 'callbook' Selects which Callbook lookup to use defaults "hamqth" but supports "qrz"
1313
*/
1414

15-
$config['app_name'] = "Wavelog";
16-
$config['directory'] = "logbook";
17-
$config['callbook'] = "hamqth"; // Options are hamqth or qrz
15+
$config['app_name'] = 'Wavelog';
16+
$config['directory'] = 'logbook';
17+
$config['callbook'] = 'hamqth'; // Options are hamqth or qrz
1818

1919
$config['datadir'] = null; // default to install directory
2020

@@ -28,8 +28,8 @@
2828
| 'display_freq' Show or Hide frequnecy info
2929
*/
3030

31-
$config['table_name'] = "TABLE_HRD_CONTACTS_V01";
32-
$config['locator'] = "";
31+
$config['table_name'] = 'TABLE_HRD_CONTACTS_V01';
32+
$config['locator'] = '';
3333
$config['display_freq'] = true;
3434

3535
/*
@@ -42,8 +42,8 @@
4242
| 'use_fullname' Get full names from QRZ, may not be GDPR compliant
4343
*/
4444

45-
$config['qrz_username'] = "";
46-
$config['qrz_password'] = "";
45+
$config['qrz_username'] = '';
46+
$config['qrz_password'] = '';
4747
$config['use_fullname'] = false;
4848

4949
/*
@@ -54,8 +54,8 @@
5454
| 'hamqth_username' HamQTH user login
5555
| 'hamqth_password' HamQTH user password
5656
*/
57-
$config['hamqth_username'] = "";
58-
$config['hamqth_password'] = "";
57+
$config['hamqth_username'] = '';
58+
$config['hamqth_password'] = '';
5959

6060
/*
6161
|--------------------------------------------------------------------------
@@ -70,11 +70,11 @@
7070
*/
7171

7272
$config['use_auth'] = true;
73-
$config['auth_table'] = "users";
74-
$config['auth_mode'] = "3";
73+
$config['auth_table'] = 'users';
74+
$config['auth_mode'] = '3';
7575

76-
$config['auth_level'][3] = "Operator";
77-
$config['auth_level'][99] = "Administrator";
76+
$config['auth_level'][3] = 'Operator';
77+
$config['auth_level'][99] = 'Administrator';
7878

7979
/*
8080
|--------------------------------------------------------------------------
@@ -676,4 +676,4 @@
676676
|
677677
*/
678678

679-
$config['userdata'] = "userdata";
679+
$config['userdata'] = 'userdata';

application/config/migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
|
2323
*/
2424

25-
$config['migration_version'] = 184;
25+
$config['migration_version'] = 187;
2626

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

application/controllers/Band.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ public function index()
2020
$this->load->model('bands');
2121

2222
$data['bands'] = $this->bands->get_all_bands_for_user();
23-
23+
2424
// Render Page
2525
$data['page_title'] = "Bands";
2626
$this->load->view('interface_assets/header', $data);
2727
$this->load->view('bands/index');
2828
$this->load->view('interface_assets/footer');
2929
}
3030

31-
public function create()
31+
public function create()
3232
{
3333
$this->load->model('bands');
3434
$this->load->library('form_validation');
@@ -41,7 +41,7 @@ public function create()
4141
$this->load->view('bands/create', $data);
4242
}
4343
else
44-
{
44+
{
4545
$this->bands->add();
4646
}
4747
}
@@ -55,7 +55,7 @@ public function edit()
5555
$band_query = $this->bands->getband($item_id_clean);
5656

5757
$data['my_band'] = $band_query->row();
58-
58+
5959
$data['page_title'] = "Edit Band";
6060

6161
$this->load->view('bands/edit', $data);
@@ -122,20 +122,22 @@ public function saveBand() {
122122
$band['cq'] = $this->security->xss_clean($this->input->post('cq'));
123123
$band['dok'] = $this->security->xss_clean($this->input->post('dok'));
124124
$band['dxcc'] = $this->security->xss_clean($this->input->post('dxcc'));
125-
$band['helvetia'] = $this->security->xss_clean($this->input->post('helvetia'));
125+
$band['helvetia'] = $this->security->xss_clean($this->input->post('helvetia'));
126126
$band['iota'] = $this->security->xss_clean($this->input->post('iota'));
127+
$band['jcc'] = $this->security->xss_clean($this->input->post('jcc'));
128+
$band['pota'] = $this->security->xss_clean($this->input->post('pota'));
129+
$band['rac'] = $this->security->xss_clean($this->input->post('rac'));
127130
$band['sig'] = $this->security->xss_clean($this->input->post('sig'));
128131
$band['sota'] = $this->security->xss_clean($this->input->post('sota'));
129132
$band['uscounties'] = $this->security->xss_clean($this->input->post('uscounties'));
130133
$band['was'] = $this->security->xss_clean($this->input->post('was'));
131134
$band['wwff'] = $this->security->xss_clean($this->input->post('wwff'));
132135
$band['vucc'] = $this->security->xss_clean($this->input->post('vucc'));
133136
$band['waja'] = $this->security->xss_clean($this->input->post('waja'));
134-
$band['pota'] = $this->security->xss_clean($this->input->post('pota'));
135-
137+
136138
$this->load->model('bands');
137139
$this->bands->saveBand($id, $band);
138-
140+
139141
header('Content-Type: application/json');
140142
echo json_encode(array('message' => 'OK'));
141143
return;
@@ -144,10 +146,10 @@ public function saveBand() {
144146
public function saveBandAward() {
145147
$award = $this->security->xss_clean($this->input->post('award'));
146148
$status = $this->security->xss_clean($this->input->post('status'));
147-
149+
148150
$this->load->model('bands');
149151
$this->bands->saveBandAward($award, $status);
150-
152+
151153
header('Content-Type: application/json');
152154
echo json_encode(array('message' => 'OK'));
153155
return;

application/controllers/Clublog.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66

77
class Clublog extends CI_Controller {
88

9+
function __construct()
10+
{
11+
parent::__construct();
12+
13+
if (ENVIRONMENT == 'maintenance' && $this->session->userdata('user_id') == '') {
14+
echo "Maintenance Mode is active. Try again later.\n";
15+
redirect('user/login');
16+
}
17+
}
18+
919
// Show frontend if there is one
1020
public function index() {
1121
$this->config->load('config');
@@ -99,13 +109,18 @@ function uploadUser($userid, $username, $password) {
99109
// If Clublog Accepts mark the QSOs
100110
if (preg_match('/\baccepted\b/', $response)) {
101111
echo "QSOs uploaded and Logbook QSOs marked as sent to Clublog"."<br>";
102-
103112
$this->load->model('clublog_model');
104113
$this->clublog_model->mark_qsos_sent($station_row->station_id);
105114
echo "Clublog upload for ".$station_row->station_callsign."<br>";
106115
log_message('info', 'Clublog upload for '.$station_row->station_callsign.' successfully sent.');
116+
} else if (preg_match('/checksum duplicate/',$response)) {
117+
echo "QSOs uploaded (asduplicate!) and Logbook QSOs marked as sent to Clublog"."<br>";
118+
$this->load->model('clublog_model');
119+
$this->clublog_model->mark_qsos_sent($station_row->station_id);
120+
echo "Clublog upload for ".$station_row->station_callsign."<br>";
121+
log_message('info', 'Clublog DUPLICATE upload for '.$station_row->station_callsign.' successfully sent.');
107122
} else {
108-
echo "Error ".$response;
123+
echo "Error ".$response."<br />";
109124
log_message('error', 'Clublog upload for '.$station_row->station_callsign.' failed reason '.$response);
110125
}
111126

application/controllers/Components.php

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,39 @@ function __construct() {
1313
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
1414
}
1515

16-
public function index() {
17-
$this->load->model('stations');
18-
$url = 'https://hams.at/api/alerts/upcoming';
19-
$json = file_get_contents($url);
20-
$data['rovedata'] = json_decode($json, true);
21-
$data['gridsquare'] = strtoupper($this->stations->find_gridsquare());
22-
23-
// load view
24-
$this->load->view('components/hamsat/table', $data);
25-
}
16+
public function index() {
17+
$this->load->model("user_options_model");
18+
$hkey_opt=$this->user_options_model->get_options('hamsat',array('option_name'=>'hamsat_key','option_key'=>'api'))->result();
19+
if (count($hkey_opt)>0) {
20+
$data['user_hamsat_key'] = $hkey_opt[0]->option_value;
21+
} else {
22+
$data['user_hamsat_key']='';
23+
}
24+
$url = 'https://hams.at/api/alerts/upcoming';
25+
if ($data['user_hamsat_key'] ?? '' != '') {
26+
$options = array(
27+
'http' => array(
28+
'method' => 'GET',
29+
'header' => "Authorization: Bearer ".$data['user_hamsat_key']."\r\n"
30+
)
31+
);
32+
$context = stream_context_create($options);
33+
$json = file_get_contents($url, false, $context);
34+
} else {
35+
$json = file_get_contents($url);
36+
}
37+
$hkey_opt=$this->user_options_model->get_options('hamsat',array('option_name'=>'hamsat_key','option_key'=>'workable'))->result();
38+
if (count($hkey_opt)>0) {
39+
$data['user_hamsat_workable_only'] = $hkey_opt[0]->option_value;
40+
} else {
41+
$data['user_hamsat_workable_only'] = 0;
42+
}
43+
44+
$this->load->model('stations');
45+
$data['rovedata'] = json_decode($json, true);
46+
$data['gridsquare'] = strtoupper($this->stations->find_gridsquare());
47+
48+
// load view
49+
$this->load->view('components/hamsat/table', $data);
50+
}
2651
}

application/controllers/Contesting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ public function activateall() {
178178
* Function is used for dupe-checking in contestinglogging
179179
*/
180180
public function checkIfWorkedBefore() {
181+
session_write_close();
181182
$call = $this->input->post('call');
182183
$band = $this->input->post('band');
183184
$mode = $this->input->post('mode');
@@ -186,7 +187,6 @@ public function checkIfWorkedBefore() {
186187
$this->load->model('Contesting_model');
187188

188189
$result = $this->Contesting_model->checkIfWorkedBefore($call, $band, $mode, $contest);
189-
190190
header('Content-Type: application/json');
191191
if ($result && $result->num_rows()) {
192192
$timeb4=substr($result->row()->b4,0,5);

application/controllers/Dxcalendar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function index() {
2222
// If Logged in and session exists
2323
$custom_date_format = $this->session->userdata('user_date_format');
2424
} else {
25-
// Get Default date format from /config/cloudlog.php
25+
// Get Default date format from config
2626
$custom_date_format = $this->config->item('qso_date_format');
2727
}
2828

application/controllers/Dxcluster.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ function __construct()
1313

1414
function spots($band,$age = '', $de = '') {
1515
if ($age == '') {
16-
$age = $this->optionslib->get_option('dxcluster_maxage');
16+
$age = $this->optionslib->get_option('dxcluster_maxage') ?? 60;
1717
}
1818
if ($de == '') {
19-
$de = $this->optionslib->get_option('dxcluster_decont');
19+
$de = $this->optionslib->get_option('dxcluster_decont') ?? 'EU';
2020
}
2121
$calls_found=$this->dxcluster_model->dxc_spotlist($band, $age, $de);
2222
header('Content-Type: application/json');

application/controllers/Eqsl.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ class eqsl extends CI_Controller {
44

55
/* Controls who can access the controller and its functions */
66
function __construct() {
7+
78
parent::__construct();
9+
810
$this->load->helper(array('form', 'url'));
11+
12+
if (ENVIRONMENT == 'maintenance' && $this->session->userdata('user_id') == '') {
13+
echo "Maintenance Mode is active. Try again later.\n";
14+
redirect('user/login');
15+
}
916
}
1017

1118
// Default view when loading controller.
@@ -609,8 +616,10 @@ function bulk_download_image($id) {
609616
return $error;
610617
}
611618
$filename = uniqid().'.jpg';
612-
if (file_put_contents($this->Eqsl_images->get_imagePath('p') .'/'. $filename, $content) !== false) {
613-
$this->Eqsl_images->save_image($id, $filename);
619+
if($this->Eqsl_images->get_image($id) == "No Image") {
620+
if (file_put_contents($this->Eqsl_images->get_imagePath('p') .'/'. $filename, $content) !== false) {
621+
$this->Eqsl_images->save_image($id, $filename);
622+
}
614623
}
615624
}
616625
return $error;

application/controllers/Hrdlog.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ class Hrdlog extends CI_Controller {
1111
* When called from the url wavelog/hrdlog/upload, the function loops through all station_id's with a hrdlog code defined.
1212
* All QSOs not previously uploaded, will then be uploaded, one at a time
1313
*/
14+
15+
function __construct()
16+
{
17+
parent::__construct();
18+
19+
if (ENVIRONMENT == 'maintenance' && $this->session->userdata('user_id') == '') {
20+
echo "Maintenance Mode is active. Try again later.\n";
21+
redirect('user/login');
22+
}
23+
}
24+
1425
public function upload() {
1526
$this->setOptions();
1627

@@ -34,7 +45,6 @@ public function upload() {
3445
echo "No station profiles with a hrdlog Code found.";
3546
log_message('error', "No station profiles with a hrdlog Code found.");
3647
}
37-
3848
}
3949

4050
function setOptions() {

0 commit comments

Comments
 (0)