Skip to content

Commit 6bd793e

Browse files
authored
Merge branch 'dev' into unique
2 parents a3d30b0 + 4655087 commit 6bd793e

File tree

10 files changed

+78
-49
lines changed

10 files changed

+78
-49
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/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/views/contesting/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@
103103
<div class="mb-3 col-md-3">
104104
<label for="callsign"><?php echo lang('gen_hamradio_callsign'); ?></label>
105105
<input type="text" class="form-control form-control-sm" id="callsign" name="callsign" required>
106-
<small id="callsign_info" class="badge text-bg-danger"></small>
106+
<small id="callsign_info" class="badge text-bg-danger"></small><br/>
107+
<small id="bearing_info" class="form-text text-muted"></small>
107108
</div>
108109

109110
<div class="mb-3 col-md-1">

application/views/view_log/qso.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@
351351
<td><?php echo lang('gen_hamradio_dok'); ?></td>
352352
<?php if (preg_match('/^[A-Y]\d{2}$/', $row->COL_DARC_DOK)) { ?>
353353
<td><a href="https://www.darc.de/<?php echo $row->COL_DARC_DOK; ?>" target="_blank"><?php echo $row->COL_DARC_DOK; ?></a></td>
354+
<?php } else if (preg_match('/^DV[ABCDEFGHIKLMNOPQRSTUVWXY]$/', $row->COL_DARC_DOK)) { ?>
355+
<td><a href="https://www.darc.de/der-club/distrikte/<?php echo strtolower(substr($row->COL_DARC_DOK, 2, 1)); ?>" target="_blank"><?php echo $row->COL_DARC_DOK; ?></a></td>
354356
<?php } else if (preg_match('/^Z\d{2}$/', $row->COL_DARC_DOK)) { ?>
355357
<td><a href="https://<?php echo $row->COL_DARC_DOK; ?>.vfdb.org" target="_blank"><?php echo $row->COL_DARC_DOK; ?></a></td>
356358
<?php } else { ?>

assets/js/sections/common.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
function setRst(mode) {
2+
if(mode == 'JT65' || mode == 'JT65B' || mode == 'JT6C' || mode == 'JTMS' || mode == 'ISCAT' || mode == 'MSK144' || mode == 'JTMSK' || mode == 'QRA64' || mode == 'FT8' || mode == 'FT4' || mode == 'JS8' || mode == 'JT9' || mode == 'JT9-1' || mode == 'ROS'){
3+
$('#rst_sent').val('-5');
4+
$('#rst_rcvd').val('-5');
5+
} else if (mode == 'FSK441' || mode == 'JT6M') {
6+
$('#rst_sent').val('26');
7+
$('#rst_rcvd').val('26');
8+
} else if (mode == 'CW' || mode == 'RTTY' || mode == 'PSK31' || mode == 'PSK63') {
9+
$('#rst_sent').val('599');
10+
$('#rst_rcvd').val('599');
11+
} else {
12+
$('#rst_sent').val('59');
13+
$('#rst_rcvd').val('59');
14+
}
15+
}
16+
117
function qsl_rcvd(id, method) {
218
$(".ld-ext-right-r-"+method).addClass('running');
319
$(".ld-ext-right-r-"+method).prop('disabled', true);

assets/js/sections/contesting.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ document.onkeyup = function (e) {
172172
reset_log_fields();
173173
// Space to jump to either callsign or the various exchanges
174174
} else if (e.which == 32) {
175+
getCallbook();
175176
var exchangetype = $("#exchangetype").val();
176177
if (exchangetype == 'Exchange') {
177178
if ($(document.activeElement).attr("id") == "callsign") {
@@ -250,6 +251,14 @@ $('#start_date').change(function() {
250251
}
251252
});
252253

254+
255+
$("#callsign").on( "blur", function() {
256+
var call = $(this).val();
257+
if ((call.length>=3) && ($("#bearing_info").html().length == 0)) {
258+
getCallbook();
259+
}
260+
});
261+
253262
// On Key up check and suggest callsigns
254263
$("#callsign").keyup(async function (e) {
255264
var call = $(this).val();
@@ -273,9 +282,21 @@ $("#callsign").keyup(async function (e) {
273282
}
274283
else if (call.length <= 2) {
275284
$('.callsign-suggestions').text("");
285+
$('#bearing_info').html("");
276286
}
277287
});
278288

289+
async function getCallbook() {
290+
var call = $("#callsign").val();
291+
if (call.length >= 3) {
292+
$.getJSON(base_url + 'index.php/logbook/json/' + call + '/0/'+$("#band").val()+'/'+$("#band").val() + '/' + current_active_location, function(result) {
293+
try {
294+
$('#bearing_info').html(result.bearing);
295+
} catch {}
296+
});
297+
}
298+
}
299+
279300
async function checkIfWorkedBefore() {
280301
var call = $("#callsign").val();
281302
if (call.length >= 3) {
@@ -309,6 +330,7 @@ async function reset_log_fields() {
309330
$("#callsign").focus();
310331
setRst($("#mode").val());
311332
$('#callsign_info').text("");
333+
$('#bearing_info').text("");
312334

313335
await refresh_qso_table(sessiondata);
314336
var qTable = $('.qsotable').DataTable();
@@ -480,7 +502,7 @@ function logQso() {
480502
}
481503

482504
$('#name').val("");
483-
505+
$('#bearing_info').html("");
484506
$('#callsign').val("");
485507
$('#comment').val("");
486508
$('#exch_rcvd').val("");

assets/js/sections/qso.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
function setRst(mode) {
2-
if(mode == 'JT65' || mode == 'JT65B' || mode == 'JT6C' || mode == 'JTMS' || mode == 'ISCAT' || mode == 'MSK144' || mode == 'JTMSK' || mode == 'QRA64' || mode == 'FT8' || mode == 'FT4' || mode == 'JS8' || mode == 'JT9' || mode == 'JT9-1' || mode == 'ROS'){
3-
$('#rst_sent').val('-5');
4-
$('#rst_rcvd').val('-5');
5-
} else if (mode == 'FSK441' || mode == 'JT6M') {
6-
$('#rst_sent').val('26');
7-
$('#rst_rcvd').val('26');
8-
} else if (mode == 'CW' || mode == 'RTTY' || mode == 'PSK31' || mode == 'PSK63') {
9-
$('#rst_sent').val('599');
10-
$('#rst_rcvd').val('599');
11-
} else {
12-
$('#rst_sent').val('59');
13-
$('#rst_rcvd').val('59');
14-
}
15-
}
16-
171
$( document ).ready(function() {
182
clearTimeout();
193
set_timers();

install/config/config.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'] = "/%directory%";
17-
$config['callbook'] = "%callbook%"; // Options are hamqth or qrz
15+
$config['app_name'] = 'Wavelog';
16+
$config['directory'] = '/%directory%';
17+
$config['callbook'] = '%callbook%'; // 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'] = "%baselocator%";
31+
$config['table_name'] = 'TABLE_HRD_CONTACTS_V01';
32+
$config['locator'] = '%baselocator%';
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'] = "%qrz_username%";
46-
$config['qrz_password'] = "%qrz_password%";
45+
$config['qrz_username'] = '%qrz_username%';
46+
$config['qrz_password'] = '%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'] = "%hamqth_username%";
58-
$config['hamqth_password'] = "%hamqth_password%";
57+
$config['hamqth_username'] = '%hamqth_username%';
58+
$config['hamqth_password'] = '%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';

install/includes/core_class.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ function write_config($data)
117117
// Open the file
118118
$database_file = file_get_contents($template_path);
119119

120+
// Sanitize DB Password from single quotes
121+
$sanitized_db_pwd = preg_replace("/\\\\/i",'\\\\\\\\',$data['db_password']); // Escape the Escape char ( '\' becomes '\\' )
122+
$sanitized_db_pwd = preg_replace("/\'/i",'\\\\\'',$sanitized_db_pwd); // Escape the ' ( ' becomes \' )
123+
120124
$new = str_replace("%HOSTNAME%", $data['db_hostname'], $database_file);
121125
$new = str_replace("%USERNAME%", $data['db_username'], $new);
122-
$new = str_replace("%PASSWORD%", $data['db_password'], $new);
126+
$new = str_replace("%PASSWORD%", $sanitized_db_pwd, $new);
123127
$new = str_replace("%DATABASE%", $data['db_name'], $new);
124128

125129
// Write the new database.php file

install/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,4 +1462,4 @@ function prevTab() {
14621462

14631463
<?php endif; ?>
14641464

1465-
</html>
1465+
</html>

0 commit comments

Comments
 (0)