Skip to content

Commit

Permalink
Merge pull request #66 from wavelog/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
m0urs authored Dec 28, 2024
2 parents 212b15f + 5fb306f commit ed80813
Show file tree
Hide file tree
Showing 124 changed files with 42,784 additions and 21,892 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Special thanks to our contributors, who are part of Wavelog by improving code!

Translators:

[Ondřej Koloničný (OK1CDJ)](https://translate.wavelog.org/user/ok1cdj/), [Michael Skolsky (R1BLH)](https://translate.wavelog.org/user/R1BLH/), [Karuru (BG2ELG)](https://translate.wavelog.org/user/viola/), [Byt3](https://translate.wavelog.org/user/205er/), [BG6HJE](https://translate.wavelog.org/user/BG6HJE/), [Francisco (F4VSE)](https://translate.wavelog.org/user/kikosgc/), [Kim (DG9VH)](https://translate.wavelog.org/user/dg9vh/), [Casper van Lieburg (PA7DX)](https://translate.wavelog.org/user/pa7dx/), [Halil AYYILDIZ (TA2LG)](https://translate.wavelog.org/user/TA2LG/), [Michal Šiman](https://translate.wavelog.org/user/michalsiman/), [DN4BS](https://github.com/dn4bs), [Luca (IU2FRL)](https://translate.wavelog.org/user/iu2frl/), [Dragan Đorđević (4O4A)](https://translate.wavelog.org/user/4o4a/), [Dren Imeraj (Z63DRI)](https://translate.wavelog.org/user/Dren/), [Filip Melik (OK1GOD)](https://translate.wavelog.org/user/filipmelik/), [Petr (OK1PTR)](https://translate.wavelog.org/user/OK1PTR/), [Stefan (DB4SCW)](https://translate.wavelog.org/user/DB4SCW/), [F4JSU](https://translate.wavelog.org/user/F4JSU/), [Maciej](https://translate.wavelog.org/user/maciejla/), [imlonghao](https://translate.wavelog.org/user/imlonghao/), [Reiner Herrmann](https://translate.wavelog.org/user/reinerh/), [Jian ke (BG8IXZ)](https://translate.wavelog.org/user/bg8ixz/), [Fabian Franz](https://translate.wavelog.org/user/fabianfrz/), [Fatih Önder](https://translate.wavelog.org/user/cektor/), [Qing He(BD8DHF)](https://translate.wavelog.org/user/BD8DHF), [hellofinch](https://translate.wavelog.org/user/hellofinch/), [tviitkar (ES5TVI )](https://translate.wavelog.org/user/tviitkar/), [utkuyalcin](https://translate.wavelog.org/user/utkuyalcin/), [Plamen Panteleev (LZ1PPL)](https://translate.wavelog.org/user/lz1ppl/), [Bartek](https://translate.wavelog.org/user/atimias/), [Samir (DL4DCO)](https://translate.wavelog.org/user/DL4DCO/), [Stanisław Korzeń (SP5CRO)](https://translate.wavelog.org/user/sp5cro/), [wxy (BA7NID)](https://translate.wavelog.org/user/ba7nid/), [David Quental (CT1DRB)](https://translate.wavelog.org/user/ct1drb/)
[Ondřej Koloničný (OK1CDJ)](https://translate.wavelog.org/user/ok1cdj/), [Michael Skolsky (R1BLH)](https://translate.wavelog.org/user/R1BLH/), [Karuru (BG2ELG)](https://translate.wavelog.org/user/viola/), [Byt3](https://translate.wavelog.org/user/205er/), [BG6HJE](https://translate.wavelog.org/user/BG6HJE/), [Francisco (F4VSE)](https://translate.wavelog.org/user/kikosgc/), [Kim (DG9VH)](https://translate.wavelog.org/user/dg9vh/), [Casper van Lieburg (PA7DX)](https://translate.wavelog.org/user/pa7dx/), [Halil AYYILDIZ (TA2LG)](https://translate.wavelog.org/user/TA2LG/), [Michal Šiman](https://translate.wavelog.org/user/michalsiman/), [DN4BS](https://github.com/dn4bs), [Luca (IU2FRL)](https://translate.wavelog.org/user/iu2frl/), [Dragan Đorđević (4O4A)](https://translate.wavelog.org/user/4o4a/), [Dren Imeraj (Z63DRI)](https://translate.wavelog.org/user/Dren/), [Filip Melik (OK1GOD)](https://translate.wavelog.org/user/filipmelik/), [Petr (OK1PTR)](https://translate.wavelog.org/user/OK1PTR/), [Stefan (DB4SCW)](https://translate.wavelog.org/user/DB4SCW/), [F4JSU](https://translate.wavelog.org/user/F4JSU/), [Maciej](https://translate.wavelog.org/user/maciejla/), [imlonghao](https://translate.wavelog.org/user/imlonghao/), [Reiner Herrmann](https://translate.wavelog.org/user/reinerh/), [Jian ke (BG8IXZ)](https://translate.wavelog.org/user/bg8ixz/), [Fabian Franz](https://translate.wavelog.org/user/fabianfrz/), [Fatih Önder](https://translate.wavelog.org/user/cektor/), [Qing He(BD8DHF)](https://translate.wavelog.org/user/BD8DHF), [hellofinch](https://translate.wavelog.org/user/hellofinch/), [tviitkar (ES5TVI )](https://translate.wavelog.org/user/tviitkar/), [utkuyalcin](https://translate.wavelog.org/user/utkuyalcin/), [Plamen Panteleev (LZ1PPL)](https://translate.wavelog.org/user/lz1ppl/), [Bartek](https://translate.wavelog.org/user/atimias/), [Samir (DL4DCO)](https://translate.wavelog.org/user/DL4DCO/), [Stanisław Korzeń (SP5CRO)](https://translate.wavelog.org/user/sp5cro/), [wxy (BA7NID)](https://translate.wavelog.org/user/ba7nid/), [David Quental (CT1DRB)](https://translate.wavelog.org/user/ct1drb/), [Sebastian K.](https://translate.wavelog.org/user/sebket/), [Limes](https://translate.wavelog.org/user/limes-github/)

If you would like to contribute in any way to Wavelog, it is most appreciated. This has been developed in free time, help coding new features or writing documentation is always useful.

Expand Down
11 changes: 11 additions & 0 deletions application/config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,3 +762,14 @@
// $config['trxd_connection_type'] = 'ws';
// $config['trxd_ws_path'] = '/trx-control';
// $config['trxd_timeout'] = 5;

/*
|--------------------------------------------------------------------------
| eqsl.cc Massdownloa
|--------------------------------------------------------------------------
|
| The eqsl.cc mass download function is not threadsafe. So it is disabled by default.
| Please consider enabling this carefully. Not recommended for multi-user environments.
*/

$config['enable_eqsl_massdownload'] = false;
10 changes: 10 additions & 0 deletions application/config/gettext.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,16 @@
'direction' => 'ltr',
'code' => 'tr',
'flag' => 'tr',
),
'armenian' => array(
'name' => 'Հայերեն',
'name_en' => 'Armenian',
'folder' => 'armenian',
'locale' => 'hy',
'gettext' => 'hy',
'direction' => 'ltr',
'code' => 'hy',
'flag' => 'am',
)
);

Expand Down
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'] = 230;
$config['migration_version'] = 231;

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Adif.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function import() {
};
$record=''; // free memory
try {
$custom_errors = $this->logbook_model->import_bulk($alladif, $this->input->post('station_profile', TRUE), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markEqsl'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
$custom_errors = $this->logbook_model->import_bulk($alladif, $this->input->post('station_profile', TRUE), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markEqsl'), $this->input->post('markHrd'), $this->input->post('markDcl'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
} catch (Exception $e) {
log_message('error', 'Import error: '.$e->getMessage());
$data['page_title'] = __("ADIF Import failed!");
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function qso($dryrun = false) {
};
$record=''; // free memory
gc_collect_cycles();
$custom_errors = $this->logbook_model->import_bulk($alladif, $obj['station_profile_id'], false, false, false, false, false, false, false, true, false, true, false);
$custom_errors = $this->logbook_model->import_bulk($alladif, $obj['station_profile_id'], false, false, false, false, false, false, false, false, true, false, true, false);
if ($custom_errors) {
$adif_errors++;
}
Expand Down
78 changes: 78 additions & 0 deletions application/controllers/Awards.php
Original file line number Diff line number Diff line change
Expand Up @@ -1917,4 +1917,82 @@ public function wac() {
$this->load->view('interface_assets/footer');
}

public function wae () {
$this->load->model('wae');
$this->load->model('modes');
$this->load->model('bands');

$data['orbits'] = $this->bands->get_worked_orbits();
$data['sats_available'] = $this->bands->get_worked_sats();
$data['user_default_band'] = $this->session->userdata('user_default_band');

$data['worked_bands'] = $this->bands->get_worked_bands('dxcc'); // Used in the view for band select
$data['modes'] = $this->modes->active(); // Used in the view for mode select

if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands
$bands = $data['worked_bands'];
} else {
$bands[] = $this->security->xss_clean($this->input->post('band'));
}
} else {
$bands = $data['worked_bands'];
}

$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view

if($this->input->method() === 'post') {
$postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1;
$postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1;
$postdata['eqsl'] = $this->input->post('eqsl') == 0 ? NULL: 1;
$postdata['qrz'] = $this->input->post('qrz') == 0 ? NULL: 1;
$postdata['clublog'] = $this->input->post('clublog') == 0 ? NULL: 1;
$postdata['worked'] = $this->input->post('worked') == 0 ? NULL: 1;
$postdata['confirmed'] = $this->input->post('confirmed') == 0 ? NULL: 1;
$postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1;

$postdata['includedeleted'] = $this->security->xss_clean($this->input->post('includedeleted'));
$postdata['Africa'] = $this->security->xss_clean($this->input->post('Africa'));
$postdata['Asia'] = $this->security->xss_clean($this->input->post('Asia'));
$postdata['Europe'] = $this->security->xss_clean($this->input->post('Europe'));
$postdata['NorthAmerica'] = $this->security->xss_clean($this->input->post('NorthAmerica'));
$postdata['SouthAmerica'] = $this->security->xss_clean($this->input->post('SouthAmerica'));
$postdata['Oceania'] = $this->security->xss_clean($this->input->post('Oceania'));
$postdata['Antarctica'] = $this->security->xss_clean($this->input->post('Antarctica'));
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
$postdata['sat'] = $this->security->xss_clean($this->input->post('sats'));
$postdata['orbit'] = $this->security->xss_clean($this->input->post('orbits'));
} else { // Setting default values at first load of page
$postdata['qsl'] = 1;
$postdata['lotw'] = 1;
$postdata['eqsl'] = 0;
$postdata['qrz'] = 0;
$postdata['worked'] = 1;
$postdata['confirmed'] = 1;
$postdata['notworked'] = 1;
$postdata['includedeleted'] = 0;
$postdata['Africa'] = 1;
$postdata['Asia'] = 1;
$postdata['Europe'] = 1;
$postdata['NorthAmerica'] = 1;
$postdata['SouthAmerica'] = 1;
$postdata['Oceania'] = 1;
$postdata['Antarctica'] = 1;
$postdata['band'] = 'All';
$postdata['mode'] = 'All';
$postdata['sat'] = 'All';
$postdata['orbit'] = 'All';
}

$data['wae_array'] = $this->wae->get_wae_array($bands, $postdata);
$data['wae_summary'] = $this->wae->get_wae_summary($bands, $postdata);

// Render Page
$data['page_title'] = sprintf(__("Awards - %s"), __("WAE"));
$this->load->view('interface_assets/header', $data);
$this->load->view('awards/wae/index');
$this->load->view('interface_assets/footer');
}

}
2 changes: 1 addition & 1 deletion application/controllers/Eqsl.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public function download() {
$errors = 0;
$this->load->library('electronicqsl');

if ($this->input->post('eqsldownload') == 'download') {
if ($this->input->post('eqsldownload') == 'download' && $this->config->item('enable_eqsl_massdownload')) {
$i = 0;
$this->load->model('eqslmethods_model');
$qslsnotdownloaded = $this->eqslmethods_model->eqsl_not_yet_downloaded();
Expand Down
1 change: 1 addition & 0 deletions application/controllers/Logbookadvanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ public function setUserOptions() {
$json_string['profilename']['show'] = $this->input->post('profilename');
$json_string['stationpower']['show'] = $this->input->post('stationpower');
$json_string['distance']['show'] = $this->input->post('distance');
$json_string['region']['show'] = $this->input->post('region');

$obj['column_settings']= json_encode($json_string);

Expand Down
85 changes: 84 additions & 1 deletion application/controllers/Lotw.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ public function decrypt_key($file, $password = "") {
private function loadFromFile($filepath, $station_ids, $display_view = "TRUE") {

// Figure out how we should be marking QSLs confirmed via LoTW
$query = $query = $this->db->query('SELECT lotw_rcvd_mark FROM config');
$query = $this->db->query('SELECT lotw_rcvd_mark FROM config');
$q = $query->row();
$config['lotw_rcvd_mark'] = $q->lotw_rcvd_mark;

Expand Down Expand Up @@ -723,6 +723,89 @@ function lotw_download($sync_user_id = null) {
}
}

public function check_lotw_credentials () {
$this->load->model('user_model');
if(!$this->user_model->authorize(2)) {
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
redirect('dashboard');
exit();
}
$ret=[];
$ret['status']='';


$raw = file_get_contents("php://input");
try {
$obj = json_decode($raw,true);
} catch (Exception $e) {
$ret['status']='failed_wrongcall';
log_message("Error",$ret['status']);
} finally {
$lotw_user=$obj['lotw_user'] ?? '';
$lotw_pass=$obj['lotw_pass'] ?? '';
}
$raw='';

$pw_placeholder = '**********';
if ($lotw_pass == $pw_placeholder) { // User comes with unaltered credentials - take them from database
$query = $this->user_model->get_by_id($this->session->userdata('user_id'));
$q = $query->row();
$data['user_lotw_name'] = urlencode($q->user_lotw_name ?? '');
$data['user_lotw_password'] = urlencode($q->user_lotw_password ?? '');
} else {
$data['user_lotw_name'] = urlencode($lotw_user ?? '');
$data['user_lotw_password'] = urlencode($lotw_pass ?? '');
}

if ((($data['user_lotw_name'] ?? '') != '') && (($data['user_lotw_password'] ?? '') != '') && ($ret['status'] != 'failed_wrongcall')) {

// Get URL for downloading LoTW
$query = $query = $this->db->query('SELECT lotw_login_url FROM config');
$q = $query->row();
$lotw_url = $q->lotw_login_url;

// Validate that LoTW credentials are not empty
// TODO: We don't actually see the error message
if ($data['user_lotw_name'] == '' || $data['user_lotw_password'] == '') {
$ret='No Creds set';
}

// Build URL for LoTW report file
$lotw_url .= "?";
$lotw_url .= "login=" . $data['user_lotw_name'];
$lotw_url .= "&password=" . $data['user_lotw_password'];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $lotw_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
$content = curl_exec($ch);
if ($content) {
if(curl_errno($ch)) {
$ret['status']='failed';
$ret['details']== sprintf(__("LoTW login failed for user %s: %s."), $data['user_lotw_name'], curl_strerror(curl_errno($ch))." (".curl_errno($ch).")");
} else if (str_contains($content,"Username/password incorrect</I>")) {
$ret['status']='failed_wrong_creds';
$ret['details']= sprintf(__("LoTW login failed for user %s: %s."), $data['user_lotw_name'], __("Username/password incorrect"));
} else {
$ret['status']='OK';
$ret['details']= __("LoTW login OK!");
}
} else {
$ret['status']='failed_na';
$ret['details']= __("LoTW currently not available. Try again later.");
}
} else {
if (($ret['status'] ?? '') == '') {
$ret['status']='failed_nocred';
$ret['details']= __("No LoTW credentials provided.");
}
}
header("Content-type: application/json");
echo json_encode($ret);
return $ret;
}

public function import() { // Is only called via frontend. Cron uses "upload". within download the download is called
$this->load->model('user_model');
$this->load->model('Stations');
Expand Down
16 changes: 14 additions & 2 deletions application/controllers/Qslprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ public function index($station_id = 'All')

$this->load->model('qslprint_model');
if ( ($station_id != 'All') && ($this->stations->check_station_is_accessible($station_id)) ) {
$data['qsos'] = $this->qslprint_model->get_qsos_for_print($station_id);
$qsos = $this->qslprint_model->get_qsos_for_print($station_id);
} else {
$data['qsos'] = $this->qslprint_model->get_qsos_for_print();
$qsos = $this->qslprint_model->get_qsos_for_print();
}

$data['qsos'] = $qsos;

$footerData = [];
$footerData['scripts'] = [
'assets/js/sections/qslprint.js',
Expand Down Expand Up @@ -195,6 +197,16 @@ public function show_oqrs() {
$this->load->view('oqrs/showoqrs', $data);
}

public function get_previous_qsl() {
$id = $this->security->xss_clean($this->input->post('id'));

$this->load->model('qslprint_model');

$number_qsls = $this->qslprint_model->get_previous_qsls($id);
header('Content-Type: application/json');
echo json_encode($number_qsls);
}

}

/* End of file Qslprint.php */
Expand Down
16 changes: 16 additions & 0 deletions application/controllers/Qso.php
Original file line number Diff line number Diff line change
Expand Up @@ -675,4 +675,20 @@ function log_qso() {
redirect('dashboard');
}
}

/**
* Easy modal Loader
* Used for Share Modal in QSO Details view
*/
function getShareModal() {

$data['qso'] = $this->input->post('qso_data', TRUE);

if (empty($data['qso'])) {
echo "No QSO data provided.";
return;
}

$this->load->view('qso/components/share_modal', $data, false);
}
}
2 changes: 1 addition & 1 deletion application/controllers/Radio.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function json($id) {
if (isset($cat_url) && ($cat_url != null)) {
$a_ret['cat_url'] = $cat_url;
}
$a_ret['update_minutes_ago'] = $updated_at;
$a_ret['updated_minutes_ago'] = $updated_at;
echo json_encode($a_ret, JSON_PRETTY_PRINT);
}
}
Expand Down
24 changes: 7 additions & 17 deletions application/controllers/Simplefle.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,18 @@ public function save_qsos() {
$this->load->model('logbook_model');

$qsos = json_decode($qsos, true);
$result = [];
foreach ($qsos as $qso) {
$one_result = $this->logbook_model->import($qso, $qso['station_id']);

// if the returner is not empty we have an error and should log it
if (json_encode($result) != '[]' && strpos(json_encode($one_result), __("Duplicate for")) == false) {
log_message('error', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Error: ' . json_encode($one_result));
}
if (strpos(json_encode($one_result), __("Duplicate for")) !== false) {
log_message('debug', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Warning: ' . json_encode($one_result));
}

if ($one_result != '') {
$result[] = $one_result;
}
}
$station_id = $qsos[0]['station_id']; // we can trust this value

$bulk_result = $this->logbook_model->import_bulk($qsos, $station_id);

$clean_result = str_replace(['<br><br/>'], "\n", $bulk_result);
log_message('debug', "SimpleFLE, save_qsos(); Bulk Result: \n" . $clean_result);

// Also clean up static map images
if (!$this->load->is_loaded('staticmap_model')) {
$this->load->model('staticmap_model');
}
$this->staticmap_model->remove_static_map_image($qso['station_id']);
$this->staticmap_model->remove_static_map_image($station_id);

if (empty($result)) {
echo "success";
Expand Down
15 changes: 12 additions & 3 deletions application/controllers/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,20 @@ public function update_pota() {

}

public function update_tle() {
$this->load->model('Update_model');
public function update_tle() {
$this->load->model('Update_model');
$result = $this->Update_model->tle();
echo $result;
}
}

public function update_lotw_sats() {
$this->load->model('Update_model');
$bodyData['satupdates'] = $this->Update_model->lotw_sats();
$data['page_title'] = __("LoTW SAT Update");
$this->load->view('interface_assets/header', $data);
$this->load->view('lotw/satupdate', $bodyData);
$this->load->view('interface_assets/footer');
}

function version_check() {
// set the last run in cron table for the correct cron id
Expand Down
Loading

0 comments on commit ed80813

Please sign in to comment.