mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge branch 'dev' into 803-SFLE-js-errors
This commit is contained in:
25
.github/workflows/issue_bot.yml
vendored
Normal file
25
.github/workflows/issue_bot.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Issue Bot
|
||||
on:
|
||||
schedule:
|
||||
- cron: "20 */12 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
close-issues:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/stale@v9.0.0
|
||||
with:
|
||||
any-of-labels: 'wait 4 close'
|
||||
exempt-issue-labels: 'hold'
|
||||
days-before-issue-stale: 5
|
||||
days-before-issue-close: 3
|
||||
stale-issue-label: 'stale'
|
||||
stale-issue-message: 'As this issue is marked as “wait 4 close” and there was no activity for 5 days, it is now marked as “stale.” It will be automatically closed in 3 more days.'
|
||||
close-issue-message: 'This issue was closed because it had been inactive for 3 days since being marked as "stale".'
|
||||
days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# debug-only: true
|
||||
13
.github/workflows/translation.yml
vendored
13
.github/workflows/translation.yml
vendored
@@ -1,12 +1,13 @@
|
||||
name: Run the po generator script
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
build:
|
||||
run_scripts:
|
||||
if: github.repository == 'wavelog/wavelog'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -29,9 +30,13 @@ jobs:
|
||||
run: |
|
||||
git config --global user.name "github-actions"
|
||||
git config --global user.email "github-actions@github.com"
|
||||
git add .
|
||||
git commit -m "po/mo updates"
|
||||
git push
|
||||
if [[ -n $(git status --porcelain) ]]; then
|
||||
git add .
|
||||
git commit -m "po/mo updates"
|
||||
git push
|
||||
else
|
||||
echo "No changes to commit."
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
10
README.md
10
README.md
@@ -38,7 +38,6 @@ https://demo.wavelog.org
|
||||
|
||||
Notes
|
||||
* If you want to log microwave QSOs you will need to use a 64bit operating system.
|
||||
* We do not provide Docker support, however you are free to use it if you wish but we will not handle support.
|
||||
|
||||
## Setup
|
||||
|
||||
@@ -51,8 +50,13 @@ Wavelog-support can be reached by creating an issue here at github. If you've an
|
||||
|
||||
## Contributing
|
||||
|
||||
Special thanks to our contributors, who are part of Wavelog by improving code!
|
||||
[F4ANS](https://github.com/abarrau), [DG0TM](https://github.com/dg0tm), [DG9VH](https://github.com/dg9vh), [DJ3CE](https://github.com/dj3ce), [R1BLH](https://github.com/r1blh), [BG2ELG](https://github.com/violarulan), [DF1ASH](https://github.com/derFogel), [DB4SCW](https://github.com/DB4SCW)
|
||||
Special thanks to our contributors, who are part of Wavelog by improving code!
|
||||
|
||||
[F4ANS](https://github.com/abarrau), [DG0TM](https://github.com/dg0tm), [DG9VH](https://github.com/dg9vh), [DJ3CE](https://github.com/dj3ce), [R1BLH](https://github.com/r1blh), [BG2ELG](https://github.com/violarulan), [DF1ASH](https://github.com/derFogel), [DB4SCW](https://github.com/DB4SCW), [VE2HEW](https://github.com/anthonydiiorio)
|
||||
|
||||
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/)
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -394,10 +394,9 @@ $config['cache_query_string'] = FALSE;
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you use the Encryption class, you must set an encryption key.
|
||||
| See the user guide for more info.
|
||||
| Encryption Key is used to encrypt sensitive data. Choose a strong and secure key.
|
||||
| Example: 'cnawuihp87f4g3ofb837rf93brlcve378rgf93be9837dgvzcl39rlzfbrzvc834lvvf83frgv83zrbzv'
|
||||
|
|
||||
| https://codeigniter.com/user_guide/libraries/encryption.html
|
||||
|
|
||||
*/
|
||||
$config['encryption_key'] = 'flossie1234555541';
|
||||
@@ -670,4 +669,30 @@ $config['disable_oqrs'] = false;
|
||||
$config['special_callsign'] = false;
|
||||
|
||||
// hides the usermenu; takes action only if "special_callsign" is true
|
||||
$config['sc_hide_usermenu'] = true;
|
||||
$config['sc_hide_usermenu'] = true;
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Impersonate
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This config switch disables the impersonate feature. This feauture is used to impersonate another user.
|
||||
| Impersonate is enabled by default. To disable it, set the value to false.
|
||||
|
|
||||
*/
|
||||
|
||||
$config['disable_impersonate'] = false;
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cronmanager Allow Insecure
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The cronmanager needs http or https with a valid certificate to work.
|
||||
| If you want to use it with https and a self-signed certificate, you need to set this to true.
|
||||
|
|
||||
*/
|
||||
|
||||
$config['cron_allow_insecure'] = false;
|
||||
@@ -61,6 +61,26 @@ $config['gettext_domain'] = NULL;
|
||||
*/
|
||||
$config['languages'] = array(
|
||||
|
||||
'albanian' => array(
|
||||
'name' => 'Shqip',
|
||||
'name_en' => 'Albanian',
|
||||
'folder' => 'albanian',
|
||||
'locale' => 'sq',
|
||||
'gettext' => 'sq',
|
||||
'direction' => 'ltr',
|
||||
'code' => 'sq',
|
||||
'flag' => 'al',
|
||||
),
|
||||
'bosnian' => array(
|
||||
'name' => 'Bosanski',
|
||||
'name_en' => 'Bosnian',
|
||||
'folder' => 'bosnian',
|
||||
'locale' => 'bs',
|
||||
'gettext' => 'bs',
|
||||
'direction' => 'ltr',
|
||||
'code' => 'bs',
|
||||
'flag' => 'ba',
|
||||
),
|
||||
'bulgarian' => array(
|
||||
'name' => 'Български',
|
||||
'name_en' => 'Bulgarian',
|
||||
@@ -81,6 +101,16 @@ $config['languages'] = array(
|
||||
'code' => 'zh-Hans',
|
||||
'flag' => 'cn',
|
||||
),
|
||||
'croatian' => array(
|
||||
'name' => 'Hrvatski',
|
||||
'name_en' => 'Croatian',
|
||||
'folder' => 'croatian',
|
||||
'locale' => 'hr',
|
||||
'gettext' => 'hr',
|
||||
'direction' => 'ltr',
|
||||
'code' => 'hr',
|
||||
'flag' => 'hr',
|
||||
),
|
||||
'czech' => array(
|
||||
'name' => 'Čeština',
|
||||
'name_en' => 'Czech',
|
||||
@@ -161,6 +191,16 @@ $config['languages'] = array(
|
||||
'code' => 'it',
|
||||
'flag' => 'it',
|
||||
),
|
||||
'montenegrin' => array(
|
||||
'name' => 'Crnogorski',
|
||||
'name_en' => 'Montenegrin',
|
||||
'folder' => 'montenegrin',
|
||||
'locale' => 'cnr',
|
||||
'gettext' => 'cnr',
|
||||
'direction' => 'ltr',
|
||||
'code' => 'cnr',
|
||||
'flag' => 'me',
|
||||
),
|
||||
'polish' => array(
|
||||
'name' => 'Polski',
|
||||
'name_en' => 'Polish',
|
||||
@@ -191,6 +231,16 @@ $config['languages'] = array(
|
||||
'code' => 'ru',
|
||||
'flag' => 'ru',
|
||||
),
|
||||
'serbian' => array(
|
||||
'name' => 'Srpski',
|
||||
'name_en' => 'Serbian',
|
||||
'folder' => 'serbian',
|
||||
'locale' => 'sr',
|
||||
'gettext' => 'sr',
|
||||
'direction' => 'ltr',
|
||||
'code' => 'sr',
|
||||
'flag' => 'rs',
|
||||
),
|
||||
'spanish' => array(
|
||||
'name' => 'Español',
|
||||
'name_en' => 'Spanish',
|
||||
|
||||
@@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
||||
|
|
||||
*/
|
||||
|
||||
$config['migration_version'] = 211;
|
||||
$config['migration_version'] = 214;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -37,5 +37,20 @@ $config['migration_version'] = 211;
|
||||
$config['migration_path'] = APPPATH . 'migrations/';
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Lockfile
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Path to the migration lockfile.
|
||||
| This lockfile prevents migrations from running twice
|
||||
|
|
||||
*/
|
||||
$config['migration_lockfile'] = sys_get_temp_dir() . '/.migration_running';
|
||||
|
||||
// the maximum age of the lockfile in seconds
|
||||
$config['migration_lf_maxage'] = 300;
|
||||
|
||||
|
||||
/* End of file migration.php */
|
||||
/* Location: ./application/config/migration.php */
|
||||
|
||||
@@ -10,7 +10,7 @@ class Accumulated extends CI_Controller
|
||||
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
}
|
||||
@@ -40,10 +40,10 @@ class Accumulated extends CI_Controller
|
||||
{
|
||||
//load model
|
||||
$this->load->model('accumulate_model');
|
||||
$band = $this->input->post('Band');
|
||||
$award = $this->input->post('Award');
|
||||
$mode = $this->input->post('Mode');
|
||||
$period = $this->input->post('Period');
|
||||
$band = xss_clean($this->input->post('Band'));
|
||||
$award = xss_clean($this->input->post('Award'));
|
||||
$mode = xss_clean($this->input->post('Mode'));
|
||||
$period = xss_clean($this->input->post('Period'));
|
||||
|
||||
// get data
|
||||
$data = $this->accumulate_model->get_accumulated_data($band, $award, $mode, $period);
|
||||
|
||||
@@ -10,7 +10,7 @@ class Activators extends CI_Controller
|
||||
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class Activators extends CI_Controller
|
||||
if ($this->input->post('mincount') != NULL) { // mincount is not set when page first loads.
|
||||
$mincount = $this->input->post('mincount');
|
||||
} else {
|
||||
$mincount = 2;
|
||||
$mincount = 2;
|
||||
}
|
||||
|
||||
if ($this->input->post('leogeo') != NULL) { // orbit is not set when page first loads.
|
||||
@@ -46,7 +46,6 @@ class Activators extends CI_Controller
|
||||
$data['maxactivatedgrids'] = $this->Activators_model->get_max_activated_grids();
|
||||
$data['orbit'] = $orbit;
|
||||
$data['activators_array'] = $this->Activators_model->get_activators($band, $mincount, $orbit);
|
||||
$data['activators_vucc_array'] = $this->Activators_model->get_activators_vucc($band, $orbit);
|
||||
$data['bandselect'] = $band;
|
||||
|
||||
$footerData = [];
|
||||
|
||||
@@ -10,7 +10,7 @@ class Activatorsmap extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
@@ -10,7 +10,7 @@ class adif extends CI_Controller {
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function test() {
|
||||
|
||||
@@ -325,6 +325,7 @@ class API extends CI_Controller {
|
||||
{
|
||||
http_response_code(200);
|
||||
echo json_encode(['status' => 'successfull', 'message' => 'No new QSOs available.', 'lastfetchedid' => $fetchfromid, 'exported_qsos' => 0, 'adif' => null]);
|
||||
return;
|
||||
}
|
||||
|
||||
//convert data to ADIF
|
||||
@@ -551,6 +552,11 @@ class API extends CI_Controller {
|
||||
|
||||
$user_id = $this->api_model->key_userid($obj['key']);
|
||||
|
||||
// Special Case: Yaesu Radio's use CW-U and CW-L which aren't official ADIF Modes. We override this here to CW
|
||||
if (isset($obj['mode']) && (strtoupper($obj['mode']) == 'CW-U' || strtoupper($obj['mode']) == 'CW-L')) {
|
||||
$obj['mode'] = 'CW';
|
||||
}
|
||||
|
||||
// Store Result to Database
|
||||
$this->cat->update($obj, $user_id);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class Awards extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -451,7 +451,7 @@ class Awards extends CI_Controller {
|
||||
|
||||
// Render Page
|
||||
$data['page_title'] = __("Log View")." - " . $type;
|
||||
$data['filter'] = $type." ".$searchphrase." and band ".$band;
|
||||
$data['filter'] = $type." ".$searchphrase.__(" and band ").$band;
|
||||
if ($band == 'SAT') {
|
||||
if ($sat != 'All' && $sat != null) {
|
||||
$data['filter'] .= __(" and sat ").$sat;
|
||||
@@ -783,6 +783,15 @@ class Awards extends CI_Controller {
|
||||
$this->load->model('iota');
|
||||
$this->load->model('modes');
|
||||
$this->load->model('bands');
|
||||
$this->load->model('logbooks_model');
|
||||
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$data['worked_bands'] = $this->bands->get_worked_bands('iota'); // Used in the view for band select
|
||||
|
||||
@@ -839,9 +848,9 @@ class Awards extends CI_Controller {
|
||||
$postdata['mode'] = 'All';
|
||||
}
|
||||
|
||||
$iotalist = $this->iota->fetchIota($postdata);
|
||||
$data['iota_array'] = $this->iota->get_iota_array($iotalist, $bands, $postdata);
|
||||
$data['iota_summary'] = $this->iota->get_iota_summary($bands, $postdata);
|
||||
$iotalist = $this->iota->fetchIota($postdata, $location_list);
|
||||
$data['iota_array'] = $this->iota->get_iota_array($iotalist, $bands, $postdata, $location_list);
|
||||
$data['iota_summary'] = $this->iota->get_iota_summary($bands, $postdata, $location_list);
|
||||
|
||||
// Render Page
|
||||
$data['page_title'] = sprintf(__("Awards - %s"), __("IOTA (Island On The Air)"));
|
||||
@@ -948,17 +957,20 @@ class Awards extends CI_Controller {
|
||||
|
||||
$footerData = [];
|
||||
$footerData['scripts']= [
|
||||
'assets/js/leaflet/geocoding.js',
|
||||
'assets/js/leaflet/L.MaidenheadColouredGridmasterMap.js',
|
||||
'assets/js/sections/ffma.js'
|
||||
'assets/js/leaflet/geocoding.js',
|
||||
'assets/js/leaflet/L.MaidenheadColouredGridmasterMap.js',
|
||||
'assets/js/sections/ffma.js'
|
||||
];
|
||||
|
||||
$this->load->view('interface_assets/header',$data);
|
||||
$this->load->view('awards/ffma/index');
|
||||
$this->load->view('interface_assets/footer',$footerData);
|
||||
}
|
||||
}
|
||||
|
||||
public function getFfmaGridsjs() {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
$this->load->model('ffma_model');
|
||||
|
||||
$array_grid_4char = array();
|
||||
@@ -968,7 +980,7 @@ class Awards extends CI_Controller {
|
||||
$grid_4char = "";
|
||||
$grid_4char_lotw = "";
|
||||
|
||||
$query = $this->ffma_model->get_lotw();
|
||||
$query = $this->ffma_model->get_lotw($location_list);
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
$grid_4char_lotw = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
@@ -978,7 +990,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->ffma_model->get_paper();
|
||||
$query = $this->ffma_model->get_paper($location_list);
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
$grid_4char_paper = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
@@ -988,7 +1000,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->ffma_model->get_worked();
|
||||
$query = $this->ffma_model->get_worked($location_list);
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
$grid_four = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
@@ -998,7 +1010,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$vucc_grids = $this->ffma_model->get_vucc_lotw();
|
||||
$vucc_grids = $this->ffma_model->get_vucc_lotw($location_list);
|
||||
foreach($vucc_grids as $key) {
|
||||
$grid_four_lotw = strtoupper(substr($key,0,4));
|
||||
if(!in_array($grid_four_lotw, $array_grid_4char_lotw)){
|
||||
@@ -1006,7 +1018,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$vucc_grids = $this->ffma_model->get_vucc_paper();
|
||||
$vucc_grids = $this->ffma_model->get_vucc_paper($location_list);
|
||||
foreach($vucc_grids as $key) {
|
||||
$grid_four_paper = strtoupper(substr($key,0,4));
|
||||
if(!in_array($grid_four_paper, $array_grid_4char_paper)){
|
||||
@@ -1014,7 +1026,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$vucc_grids = $this->ffma_model->get_vucc_worked();
|
||||
$vucc_grids = $this->ffma_model->get_vucc_worked($location_list);
|
||||
foreach($vucc_grids as $key) {
|
||||
$grid_four = strtoupper(substr($key,0,4));
|
||||
if(!in_array($grid_four, $array_grid_4char)){
|
||||
@@ -1033,6 +1045,9 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
|
||||
public function getGridmasterGridsjs($dxcc) {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
$this->load->model('gridmaster_model');
|
||||
|
||||
$dxcc = $this->security->xss_clean($dxcc);
|
||||
@@ -1044,7 +1059,7 @@ class Awards extends CI_Controller {
|
||||
$grid_4char = "";
|
||||
$grid_4char_lotw = "";
|
||||
|
||||
$query = $this->gridmaster_model->get_lotw($dxcc);
|
||||
$query = $this->gridmaster_model->get_lotw($dxcc, $location_list);
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
$grid_4char_lotw = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
@@ -1054,7 +1069,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->gridmaster_model->get_paper($dxcc);
|
||||
$query = $this->gridmaster_model->get_paper($dxcc, $location_list);
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
$grid_4char_paper = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
@@ -1064,7 +1079,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->gridmaster_model->get_worked($dxcc);
|
||||
$query = $this->gridmaster_model->get_worked($dxcc, $location_list);
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
$grid_four = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
@@ -1074,7 +1089,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$vucc_grids = $this->gridmaster_model->get_vucc_lotw($dxcc);
|
||||
$vucc_grids = $this->gridmaster_model->get_vucc_lotw($dxcc, $location_list);
|
||||
foreach($vucc_grids as $key) {
|
||||
$grid_four_lotw = strtoupper(substr($key,0,4));
|
||||
if(!in_array($grid_four_lotw, $array_grid_4char_lotw)){
|
||||
@@ -1082,7 +1097,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$vucc_grids = $this->gridmaster_model->get_vucc_paper($dxcc);
|
||||
$vucc_grids = $this->gridmaster_model->get_vucc_paper($dxcc, $location_list);
|
||||
foreach($vucc_grids as $key) {
|
||||
$grid_four_paper = strtoupper(substr($key,0,4));
|
||||
if(!in_array($grid_four_paper, $array_grid_4char_paper)){
|
||||
@@ -1090,7 +1105,7 @@ class Awards extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$vucc_grids = $this->gridmaster_model->get_vucc_worked($dxcc);
|
||||
$vucc_grids = $this->gridmaster_model->get_vucc_worked($dxcc, $location_list);
|
||||
foreach($vucc_grids as $key) {
|
||||
$grid_four = strtoupper(substr($key,0,4));
|
||||
if(!in_array($grid_four, $array_grid_4char)){
|
||||
@@ -1534,6 +1549,15 @@ class Awards extends CI_Controller {
|
||||
public function iota_map() {
|
||||
$this->load->model('iota');
|
||||
$this->load->model('bands');
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
|
||||
$bands[] = $this->security->xss_clean($this->input->post('band'));
|
||||
|
||||
@@ -1553,9 +1577,9 @@ class Awards extends CI_Controller {
|
||||
$postdata['Oceania'] = $this->input->post('Oceania') == 0 ? NULL: 1;
|
||||
$postdata['Antarctica'] = $this->input->post('Antarctica') == 0 ? NULL: 1;
|
||||
|
||||
$iotalist = $this->iota->fetchIota($postdata);
|
||||
$iotalist = $this->iota->fetchIota($postdata, $location_list);
|
||||
|
||||
$iota_array = $this->iota->get_iota_array($iotalist, $bands, $postdata);
|
||||
$iota_array = $this->iota->get_iota_array($iotalist, $bands, $postdata, $location_list);
|
||||
|
||||
$i = 0;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class Backup extends CI_Controller {
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$data['page_title'] = __("Backup");
|
||||
|
||||
@@ -23,16 +23,18 @@ class Backup extends CI_Controller {
|
||||
public function adif($key = null){
|
||||
if ($key == null) {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
$clean_key = $this->security->xss_clean($key);
|
||||
|
||||
$this->load->helper('file');
|
||||
// Set memory limit to unlimited to allow heavy usage
|
||||
ini_set('memory_limit', '-1');
|
||||
|
||||
$this->load->model('adif_data');
|
||||
|
||||
$data['qsos'] = $this->adif_data->export_all($key);
|
||||
$data['qsos'] = $this->adif_data->export_all($clean_key);
|
||||
|
||||
$data['filename'] = 'backup/logbook'. date('_Y_m_d_H_i_s') .'.adi';
|
||||
|
||||
@@ -58,13 +60,15 @@ class Backup extends CI_Controller {
|
||||
public function notes($key = null) {
|
||||
if ($key == null) {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
$clean_key = $this->security->xss_clean($key);
|
||||
|
||||
$this->load->helper('file');
|
||||
$this->load->model('note');
|
||||
|
||||
$data['list_note'] = $this->note->list_all($key);
|
||||
$data['list_note'] = $this->note->list_all($clean_key);
|
||||
|
||||
$data['filename'] = 'backup/notes'. date('_Y_m_d_H_i_s') .'.xml';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class Band extends CI_Controller {
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
||||
@@ -6,7 +6,7 @@ class Bandmap extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$this->load->model('bands');
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class Cabrillo extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
@@ -50,7 +50,7 @@ class Cabrillo extends CI_Controller {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($result);
|
||||
} else {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class Cabrillo extends CI_Controller {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($result);
|
||||
} else {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class Cabrillo extends CI_Controller {
|
||||
|
||||
$this->load->view('cabrillo/export', $data);
|
||||
}else {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ class Calltester extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class Cfdexport extends CI_Controller {
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('bands');
|
||||
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$data['page_title'] = __("CFD Export");
|
||||
|
||||
@@ -26,7 +26,7 @@ class Cfdexport extends CI_Controller {
|
||||
|
||||
public function export() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('dxcc');
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class Components extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
@@ -12,7 +12,7 @@ class Contestcalendar extends CI_Controller {
|
||||
public function index() {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -72,7 +72,6 @@ class Contestcalendar extends CI_Controller {
|
||||
return $rssData;
|
||||
}
|
||||
|
||||
|
||||
private function parseTimeRange($string) {
|
||||
$timeData = array();
|
||||
|
||||
@@ -86,7 +85,19 @@ class Contestcalendar extends CI_Controller {
|
||||
|
||||
// create proper dateTime
|
||||
$timeData['start'] = DateTime::createFromFormat('Hi\Z, M d', $start);
|
||||
|
||||
if (!$timeData['start']) {
|
||||
// If the first format didn't match, try the format without the comma
|
||||
$timeData['start'] = DateTime::createFromFormat('Hi\Z M d', $start);
|
||||
}
|
||||
|
||||
$timeData['end'] = DateTime::createFromFormat('Hi\Z, M d', $end);
|
||||
|
||||
if (!$timeData['end']) {
|
||||
// If the first format didn't match, try the format without the comma
|
||||
$timeData['end'] = DateTime::createFromFormat('Hi\Z M d', $end);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// split in start and end time
|
||||
@@ -144,8 +155,8 @@ class Contestcalendar extends CI_Controller {
|
||||
continue;
|
||||
}
|
||||
|
||||
$start = date('Y-m-d', strtotime($contest['start']->format('Y-m-d')));
|
||||
$end = date('Y-m-d', strtotime($contest['end']->format('Y-m-d')));
|
||||
$start = $contest['start'] == '' ? '' : date('Y-m-d', strtotime($contest['start']->format('Y-m-d')));
|
||||
$end = $contest['end'] == '' ? '' : date('Y-m-d', strtotime($contest['end']->format('Y-m-d')));
|
||||
|
||||
if ($start <= $this->today && $end >= $this->today) {
|
||||
$contestsToday[] = $contest;
|
||||
@@ -175,8 +186,8 @@ class Contestcalendar extends CI_Controller {
|
||||
continue;
|
||||
}
|
||||
|
||||
$start = date('Y-m-d', strtotime($contest['start']->format('Y-m-d')));
|
||||
$end = date('Y-m-d', strtotime($contest['end']->format('Y-m-d')));
|
||||
$start = $contest['start'] == '' ? '' : date('Y-m-d', strtotime($contest['start']->format('Y-m-d')));
|
||||
$end = $contest['end'] == '' ? '' : date('Y-m-d', strtotime($contest['end']->format('Y-m-d')));
|
||||
|
||||
if ($start >= $nextFriday && $start <= $nextSunday && $start >= $this->today) {
|
||||
$contestsNextWeekend[] = $contest;
|
||||
|
||||
@@ -11,7 +11,7 @@ class Contesting extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
@@ -21,8 +21,19 @@ class Contesting extends CI_Controller {
|
||||
$this->load->model('contesting_model');
|
||||
$this->load->model('bands');
|
||||
|
||||
// Getting the live/post mode from GET command
|
||||
// 0 = live
|
||||
// 1 = post (manual)
|
||||
$get_manual_mode = $this->security->xss_clean($this->input->get('manual'));
|
||||
if ($get_manual_mode == '0' || $get_manual_mode == '1') {
|
||||
$data['manual_mode'] = $get_manual_mode;
|
||||
} else {
|
||||
show_404();
|
||||
}
|
||||
|
||||
$data['my_gridsquare'] = $this->stations->find_gridsquare();
|
||||
$data['radios'] = $this->cat->radios();
|
||||
$data['radio_last_updated'] = $this->cat->last_updated()->row();
|
||||
$data['modes'] = $this->modes->active();
|
||||
$data['contestnames'] = $this->contesting_model->getActivecontests();
|
||||
$data['bands'] = $this->bands->get_user_bands_for_qso_entry();
|
||||
|
||||
@@ -23,7 +23,7 @@ class cron extends CI_Controller {
|
||||
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(99)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ class cron extends CI_Controller {
|
||||
|
||||
$data['page_title'] = __("Cron Manager");
|
||||
$data['crons'] = $this->cron_model->get_crons();
|
||||
$data['cron_allow_insecure'] = $this->config->item('cron_allow_insecure') ?? false;
|
||||
|
||||
$mastercron = array();
|
||||
$mastercron = $this->get_mastercron_status();
|
||||
@@ -94,6 +95,9 @@ class cron extends CI_Controller {
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'Wavelog Updater');
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
if ($this->config->item('cron_allow_insecure') ?? false == true) {
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
}
|
||||
$crun = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
@@ -101,7 +105,7 @@ class cron extends CI_Controller {
|
||||
echo "CRON: " . $cron->id . " -> CURL Result: " . $crun . "\n";
|
||||
$status = 'healthy';
|
||||
} else {
|
||||
echo "ERROR: Something went wrong with " . $cron->id . "\n";
|
||||
echo "ERROR: Something went wrong with " . $cron->id . "; Message: " . $crun . "\n";
|
||||
$status = 'failed';
|
||||
}
|
||||
} else {
|
||||
@@ -142,7 +146,7 @@ class cron extends CI_Controller {
|
||||
public function edit() {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(99)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -254,19 +258,19 @@ class cron extends CI_Controller {
|
||||
$diff = $now->getTimestamp() - $timestamp_last_run->getTimestamp();
|
||||
|
||||
if ($diff >= 0 && $diff <= $warning_timelimit_seconds) {
|
||||
$result['status'] = 'OK';
|
||||
$result['status'] = __("OK");
|
||||
$result['status_class'] = 'success';
|
||||
} else {
|
||||
if ($diff <= $error_timelimit_seconds) {
|
||||
$result['status'] = 'Last run occurred more than ' . $warning_timelimit_seconds . ' seconds ago.<br>Please check your master cron! It should run every minute (* * * * *).';
|
||||
$result['status'] = sprintf(__("Last run occurred more than %s seconds ago.%sPlease check your master cron! It should run every minute (* * * * *)."), $warning_timelimit_seconds, '<br>');
|
||||
$result['status_class'] = 'warning';
|
||||
} else {
|
||||
$result['status'] = 'Last run occurred more than ' . ($error_timelimit_seconds / 60) . ' minutes ago.<br>Seems like your Mastercron isn\'t running!<br>It should run every minute (* * * * *).';
|
||||
$result['status'] = sprintf(__("Last run occurred more than %s minutes ago.%sSeems like your Mastercron isn't running!%sIt should run every minute (* * * * *)."), ($error_timelimit_seconds / 60), '<br>', '<br>');
|
||||
$result['status_class'] = 'danger';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result['status'] = 'Not running';
|
||||
$result['status'] = _pgettext("Master Cron", "Not running");
|
||||
$result['status_class'] = 'danger';
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ class Csv extends CI_Controller {
|
||||
public function index() {
|
||||
$this->load->model('user_model');
|
||||
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$this->load->model('modes');
|
||||
$this->load->model('logbook_model');
|
||||
@@ -28,7 +28,7 @@ class Csv extends CI_Controller {
|
||||
public function export() {
|
||||
$this->load->model('user_model');
|
||||
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$this->load->model('csv_model');
|
||||
// Parameters
|
||||
|
||||
@@ -43,6 +43,9 @@ class Dashboard extends CI_Controller
|
||||
$data['qra'] = "none";
|
||||
}
|
||||
|
||||
// We need the form_helper for the layout/messages
|
||||
$this->load->helper('form');
|
||||
|
||||
$this->load->model('stations');
|
||||
$this->load->model('setup_model');
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class Dayswithqso extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
||||
@@ -7,7 +7,7 @@ class Debug extends CI_Controller
|
||||
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -42,9 +42,11 @@ class Debug extends CI_Controller
|
||||
// get mig version from config file
|
||||
$this->load->config('migration');
|
||||
$data['migration_config'] = $this->config->item('migration_version');
|
||||
$data['migration_lockfile'] = $this->config->item('migration_lockfile');
|
||||
$data['miglock_lifetime'] = $this->config->item('migration_lf_maxage');
|
||||
|
||||
// compare mig versions
|
||||
if ($data['migration_version'] !== $data['migration_config'] && file_exists('application/cache/.migration_running')) {
|
||||
if ($data['migration_version'] != $data['migration_config'] && file_exists($data['migration_lockfile'])) {
|
||||
$data['migration_is_uptodate'] = false;
|
||||
} else {
|
||||
$data['migration_is_uptodate'] = true;
|
||||
|
||||
@@ -8,7 +8,7 @@ class Distances extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
||||
@@ -4,7 +4,7 @@ class Dxatlas extends CI_Controller {
|
||||
|
||||
public function index() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$this->load->model('modes');
|
||||
$this->load->model('logbook_model');
|
||||
@@ -26,7 +26,7 @@ class Dxatlas extends CI_Controller {
|
||||
|
||||
public function export() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$this->load->model('dxatlas_model');
|
||||
|
||||
@@ -48,7 +48,7 @@ class Dxatlas extends CI_Controller {
|
||||
|
||||
function generateFiles($wkdArray, $cfmArray, $band) {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$gridCfmArray = [];
|
||||
$gridWkdArray = [];
|
||||
@@ -105,7 +105,7 @@ class Dxatlas extends CI_Controller {
|
||||
|
||||
function makeZip($gridWkdString, $gridCfmString, $band) {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$zipFileName = 'dxatlas_gridsquares_'. $band . '.zip';
|
||||
// Prepare File
|
||||
$file = tempnam(".", "zip");
|
||||
|
||||
@@ -5,7 +5,7 @@ class Dxcalendar extends CI_Controller {
|
||||
public function index() {
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('logbook_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$data['page_title'] = __("DX Calendar");
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class Dxcluster extends CI_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$this->load->model('dxcluster_model');
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class eqsl extends CI_Controller {
|
||||
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class eqsl extends CI_Controller {
|
||||
public function import() {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ class eqsl extends CI_Controller {
|
||||
public function export() {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ class eqsl extends CI_Controller {
|
||||
function generateResultTable($custom_date_format, $rows) {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ class eqsl extends CI_Controller {
|
||||
function writeEqslNotSent($qslsnotsent, $custom_date_format) {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
$table = '<table = style="width:100%" class="table-sm table qsotable table-bordered table-hover table-striped table-condensed text-center">';
|
||||
@@ -283,7 +283,7 @@ class eqsl extends CI_Controller {
|
||||
function image($id) {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
$this->load->library('electronicqsl');
|
||||
@@ -345,7 +345,7 @@ class eqsl extends CI_Controller {
|
||||
function bulk_download_image($id) {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
$this->load->library('electronicqsl');
|
||||
@@ -388,6 +388,7 @@ class eqsl extends CI_Controller {
|
||||
return $error;
|
||||
}
|
||||
|
||||
session_write_close();
|
||||
foreach ($images as $image) {
|
||||
$content = file_get_contents("https://www.eqsl.cc" . $image->getAttribute('src'));
|
||||
if ($content === false) {
|
||||
@@ -408,7 +409,7 @@ class eqsl extends CI_Controller {
|
||||
// Check logged in
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -424,7 +425,7 @@ class eqsl extends CI_Controller {
|
||||
// Check logged in
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
$errors = 0;
|
||||
@@ -484,7 +485,7 @@ class eqsl extends CI_Controller {
|
||||
// Check logged in
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class Hamsat extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
@@ -15,7 +15,7 @@ class Kmlexport extends CI_Controller {
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('bands');
|
||||
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select
|
||||
$data['modes'] = $this->modes->active(); // Used in the view for mode select
|
||||
@@ -30,7 +30,7 @@ class Kmlexport extends CI_Controller {
|
||||
|
||||
public function export() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
// Load Libraries
|
||||
if(!$this->load->is_loaded('Qra')) {
|
||||
$this->load->library('Qra');
|
||||
|
||||
@@ -23,7 +23,7 @@ class Labels extends CI_Controller {
|
||||
$this->load->helper(array('form', 'url', 'psr4_autoloader'));
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class Logbook extends CI_Controller {
|
||||
|
||||
$return['callsign_name'] = $this->nval($callbook['name'] ?? '', $this->logbook_model->call_name($callsign));
|
||||
$return['callsign_qra'] = $this->nval($callbook['gridsquare'] ?? '', $this->logbook_model->call_qra($callsign));
|
||||
$return['callsign_distance'] = $this->distance($return['callsign_qra']);
|
||||
$return['callsign_distance'] = $this->distance($return['callsign_qra'], $station_id);
|
||||
$return['callsign_qth'] = $this->nval($callbook['city'] ?? '', $this->logbook_model->call_qth($callsign));
|
||||
$return['callsign_iota'] = $this->nval($callbook['iota'] ?? '', $this->logbook_model->call_iota($callsign));
|
||||
$return['qsl_manager'] = $this->nval($callbook['qslmgr'] ?? '', $this->logbook_model->call_qslvia($callsign));
|
||||
@@ -1047,7 +1047,11 @@ class Logbook extends CI_Controller {
|
||||
}
|
||||
|
||||
function search_incorrect_cq_zones($station_id) {
|
||||
$station_id = $this->security->xss_clean($station_id);
|
||||
$clean_station_id = $this->security->xss_clean($station_id);
|
||||
|
||||
if (!is_numeric($clean_station_id) && $clean_station_id !== 'All') {
|
||||
show_404();
|
||||
}
|
||||
|
||||
$this->load->model('user_model');
|
||||
|
||||
@@ -1067,11 +1071,14 @@ class Logbook extends CI_Controller {
|
||||
and not exists (select 1 from dxcc_master where countrycode = thcv.col_dxcc and cqzone = col_cqz) and col_dxcc > 0
|
||||
';
|
||||
|
||||
if ($station_id != 'All') {
|
||||
$sql .= ' and station_profile.station_id = ' . $station_id;
|
||||
$params = [];
|
||||
|
||||
if ($clean_station_id != 'All') {
|
||||
$sql .= ' and station_profile.station_id = ?';
|
||||
$params[] = $clean_station_id;
|
||||
}
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
$query = $this->db->query($sql, $params);
|
||||
|
||||
$data['qsos'] = $query;
|
||||
|
||||
@@ -1312,7 +1319,7 @@ class Logbook extends CI_Controller {
|
||||
case 'Grid': $ret.= '<td>' . $this->part_QrbCalcLink($row->COL_MY_GRIDSQUARE, $row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE) . '</td>'; break;
|
||||
case 'Distance': $ret.= '<td>' . (($row->COL_DISTANCE ?? '' != '') ? $row->COL_DISTANCE . ' km' : '') . '</td>'; break;
|
||||
case 'Band': $ret.= '<td>'; if($row->COL_SAT_NAME != null) { $ret.= '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'.$row->COL_SAT_NAME.'</a></td>'; } else { $ret.= strtolower($row->COL_BAND); } $ret.= '</td>'; break;
|
||||
case 'Frequency': $ret.= '<td>'; if($row->COL_SAT_NAME != null) { $ret.= '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'.$row->COL_SAT_NAME.'</a></td>'; } else { if($row->COL_FREQ != null) { $ret.= $this->frequency->hz_to_mhz($row->COL_FREQ); } else { $ret.= strtolower($row->COL_BAND); } } $ret.= '</td>'; break;
|
||||
case 'Frequency': $ret.= '<td>'; if($row->COL_SAT_NAME != null) { $ret.= '<a href="https://db.satnogs.org/search/?q='.$row->COL_SAT_NAME.'" target="_blank">'.$row->COL_SAT_NAME.'</a></td>'; } else { if($row->COL_FREQ != null) { $ret.= $this->frequency->qrg_conversion($row->COL_FREQ); } else { $ret.= strtolower($row->COL_BAND); } } $ret.= '</td>'; break;
|
||||
case 'State': $ret.= '<td>' . ($row->COL_STATE) . '</td>'; break;
|
||||
case 'Operator': $ret.= '<td>' . ($row->COL_OPERATOR) . '</td>'; break;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class Logbookadvanced extends CI_Controller {
|
||||
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class Lookup extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -65,9 +65,7 @@ class Lookup extends CI_Controller {
|
||||
|
||||
public function scp() {
|
||||
session_write_close();
|
||||
if($_POST['callsign']) {
|
||||
$uppercase_callsign = strtoupper($_POST['callsign']);
|
||||
}
|
||||
$uppercase_callsign = strtoupper($this->input->post('callsign', TRUE) ?? '');
|
||||
|
||||
// SCP results from logbook
|
||||
$this->load->model('logbook_model');
|
||||
@@ -180,8 +178,8 @@ class Lookup extends CI_Controller {
|
||||
public function get_county() {
|
||||
$json = [];
|
||||
|
||||
if(!empty($this->input->get("query"))) {
|
||||
$county = $this->input->get("state");
|
||||
if(!empty($this->security->xss_clean($this->input->get("query")))) {
|
||||
$county = $this->security->xss_clean($this->input->get("state"));
|
||||
$cleanedcounty = explode('(', $county);
|
||||
$cleanedcounty = trim($cleanedcounty[0]);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class Lotw extends CI_Controller {
|
||||
public function index() {
|
||||
$this->load->library('Permissions');
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
// Load required models for page generation
|
||||
$this->load->model('Lotw_model');
|
||||
@@ -74,7 +74,7 @@ class Lotw extends CI_Controller {
|
||||
public function cert_upload() {
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('dxcc');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
// Load DXCC Countrys List
|
||||
$data['dxcc_list'] = $this->dxcc->list();
|
||||
@@ -101,7 +101,7 @@ class Lotw extends CI_Controller {
|
||||
{
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('dxcc');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
// create folder to store certs while processing
|
||||
if (!file_exists('./uploads/lotw/certs')) {
|
||||
@@ -149,14 +149,14 @@ class Lotw extends CI_Controller {
|
||||
$this->Lotw_model->store_certificate($this->session->userdata('user_id'), $info['issued_callsign'], $info['dxcc-id'], $info['validFrom'], $info['validTo_Date'], $info['qso-first-date'], $info['qso-end-date'], $info['pem_key'], $info['general_cert']);
|
||||
|
||||
// Cert success flash message
|
||||
$this->session->set_flashdata('Success', $info['issued_callsign'].' Certificate Imported.');
|
||||
$this->session->set_flashdata('success', $info['issued_callsign'] . ' ' . __("Certificate Imported."));
|
||||
} else {
|
||||
// Certificate is in the system time to update
|
||||
|
||||
$this->Lotw_model->update_certificate($this->session->userdata('user_id'), $info['issued_callsign'], $info['dxcc-id'], $info['validFrom'], $info['validTo_Date'], $info['qso-first-date'], $info['qso-end-date'], $info['pem_key'], $info['general_cert']);
|
||||
|
||||
// Cert success flash message
|
||||
$this->session->set_flashdata('Success', $info['issued_callsign'].' Certificate Updated.');
|
||||
$this->session->set_flashdata('success', $info['issued_callsign'] . ' ' . __("Certificate Updated."));
|
||||
|
||||
}
|
||||
|
||||
@@ -375,15 +375,15 @@ class Lotw extends CI_Controller {
|
||||
*/
|
||||
public function delete_cert($cert_id) {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$this->load->model('Lotw_model');
|
||||
|
||||
$this->Lotw_model->delete_certificate($this->session->userdata('user_id'), $cert_id);
|
||||
|
||||
$this->session->set_flashdata('Success', 'Certificate Deleted.');
|
||||
$this->session->set_flashdata('success', __("Certificate Deleted."));
|
||||
|
||||
redirect('/lotw/');
|
||||
redirect('lotw');
|
||||
}
|
||||
|
||||
|
||||
@@ -398,14 +398,21 @@ class Lotw extends CI_Controller {
|
||||
*/
|
||||
public function decrypt_key($file, $password = "") {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$results = array();
|
||||
$password = $password; // Only needed if 12 has a password set
|
||||
$filename = file_get_contents('file://'.$file);
|
||||
$worked = openssl_pkcs12_read($filename, $results, $password);
|
||||
|
||||
$data['general_cert'] = $results['cert'];
|
||||
if ($results['cert']) {
|
||||
$data['general_cert'] = $results['cert'];
|
||||
} else {
|
||||
log_message('error', 'Found no certificate in file '.$file);
|
||||
unlink($file);
|
||||
$this->session->set_flashdata('warning', sprintf(__("Found no certificate in file %s. If the filename contains 'key-only' this is typically a certificate request which has not been processed by LoTW yet."), basename($file)));
|
||||
redirect('lotw');
|
||||
}
|
||||
|
||||
|
||||
if($worked) {
|
||||
@@ -422,16 +429,16 @@ class Lotw extends CI_Controller {
|
||||
log_message('error', openssl_error_string());
|
||||
|
||||
// Set warning message redirect to LoTW main page
|
||||
$this->session->set_flashdata('Warning', openssl_error_string());
|
||||
redirect('/lotw/');
|
||||
$this->session->set_flashdata('warning', openssl_error_string());
|
||||
redirect('lotw');
|
||||
}
|
||||
} else {
|
||||
// Reading p12 failed log error message
|
||||
log_message('error', openssl_error_string());
|
||||
|
||||
// Set warning message redirect to LoTW main page
|
||||
$this->session->set_flashdata('Warning', openssl_error_string());
|
||||
redirect('/lotw/');
|
||||
$this->session->set_flashdata('warning', openssl_error_string());
|
||||
redirect('lotw');
|
||||
}
|
||||
|
||||
// Read Cert Data
|
||||
@@ -709,7 +716,7 @@ class Lotw extends CI_Controller {
|
||||
public function import() { // Is only called via frontend. Cron uses "upload". within download the download is called
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
exit();
|
||||
}
|
||||
@@ -742,7 +749,7 @@ class Lotw extends CI_Controller {
|
||||
// TODO: We don't actually see the error message
|
||||
if ($data['user_lotw_name'] == '' || $data['user_lotw_password'] == '')
|
||||
{
|
||||
$this->session->set_flashdata('warning', 'You have not defined your ARRL LoTW credentials!'); redirect('lotw/import');
|
||||
$this->session->set_flashdata('warning', __("You have not defined your ARRL LoTW credentials!")); redirect('lotw/import');
|
||||
}
|
||||
|
||||
$customDate = $this->input->post('from');
|
||||
@@ -817,7 +824,7 @@ class Lotw extends CI_Controller {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
exit();
|
||||
}
|
||||
@@ -825,7 +832,7 @@ class Lotw extends CI_Controller {
|
||||
|
||||
public function export() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$data['page_title'] = __("LoTW .TQ8 Upload");
|
||||
|
||||
@@ -860,7 +867,7 @@ class Lotw extends CI_Controller {
|
||||
|
||||
if ($fields['login'] == '' || $fields['password'] == '')
|
||||
{
|
||||
$this->session->set_flashdata('warning', 'You have not defined your ARRL LoTW credentials!'); redirect('lotw/status');
|
||||
$this->session->set_flashdata('warning', __("You have not defined your ARRL LoTW credentials!")); redirect('lotw/status');
|
||||
}
|
||||
|
||||
// Curl stuff goes here
|
||||
@@ -905,7 +912,7 @@ class Lotw extends CI_Controller {
|
||||
$result = curl_exec($ch);
|
||||
if (stristr($result, "Username/password incorrect"))
|
||||
{
|
||||
$this->session->set_flashdata('warning', 'Your ARRL username and/or password is incorrect.'); redirect('lotw/status');
|
||||
$this->session->set_flashdata('warning', __("Your ARRL username and/or password is incorrect.")); redirect('lotw/status');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ class Migrate extends CI_Controller {
|
||||
|
||||
public function index() {
|
||||
$this->load->library('Migration');
|
||||
$this->load->config('migration');
|
||||
|
||||
$result = array();
|
||||
$latest = $this->migration->latest();
|
||||
@@ -12,7 +13,7 @@ class Migrate extends CI_Controller {
|
||||
log_message('error', 'Migration failed');
|
||||
$result['status'] = 'error';
|
||||
} else {
|
||||
while (file_exists(APPPATH . 'cache/.migration_running')) {
|
||||
while (file_exists($this->config->item('migration_lockfile'))) {
|
||||
sleep(1);
|
||||
}
|
||||
$result['status'] = 'success';
|
||||
|
||||
@@ -12,7 +12,7 @@ class Mode extends CI_Controller {
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
||||
@@ -7,13 +7,12 @@ class Notes extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
|
||||
/* Displays all notes in a list */
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
$this->load->model('note');
|
||||
$data['notes'] = $this->note->list_all();
|
||||
$data['page_title'] = __("Notes");
|
||||
@@ -50,9 +49,16 @@ class Notes extends CI_Controller {
|
||||
|
||||
/* View Notes */
|
||||
function view($id) {
|
||||
|
||||
$clean_id = $this->security->xss_clean($id);
|
||||
|
||||
if (! is_numeric($clean_id)) {
|
||||
show_404();
|
||||
}
|
||||
|
||||
$this->load->model('note');
|
||||
|
||||
$data['note'] = $this->note->view($id);
|
||||
$data['note'] = $this->note->view($clean_id);
|
||||
|
||||
// Display
|
||||
$data['page_title'] = __("Note");
|
||||
@@ -63,10 +69,17 @@ class Notes extends CI_Controller {
|
||||
|
||||
/* Edit Notes */
|
||||
function edit($id) {
|
||||
|
||||
$clean_id = $this->security->xss_clean($id);
|
||||
|
||||
if (! is_numeric($clean_id)) {
|
||||
show_404();
|
||||
}
|
||||
|
||||
$this->load->model('note');
|
||||
$data['id'] = $id;
|
||||
$data['id'] = $clean_id;
|
||||
|
||||
$data['note'] = $this->note->view($id);
|
||||
$data['note'] = $this->note->view($clean_id);
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
@@ -91,8 +104,15 @@ class Notes extends CI_Controller {
|
||||
|
||||
/* Delete Note */
|
||||
function delete($id) {
|
||||
|
||||
$clean_id = $this->security->xss_clean($id);
|
||||
|
||||
if (! is_numeric($clean_id)) {
|
||||
show_404();
|
||||
}
|
||||
|
||||
$this->load->model('note');
|
||||
$this->note->delete($id);
|
||||
$this->note->delete($clean_id);
|
||||
|
||||
redirect('notes');
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class Options extends CI_Controller {
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ class Oqrs extends CI_Controller {
|
||||
parent::__construct();
|
||||
// Commented out to get public access
|
||||
// $this->load->model('user_model');
|
||||
// if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if (($this->config->item('disable_oqrs') ?? false)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
// if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
if (($this->config->item('disable_oqrs') ?? false)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
@@ -10,7 +10,7 @@ class Qrbcalc extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
@@ -23,8 +23,13 @@ class Qrbcalc extends CI_Controller {
|
||||
}
|
||||
|
||||
public function calculate() {
|
||||
$locator1 = $this->input->post("locator1");
|
||||
$locator2 = $this->input->post("locator2");
|
||||
|
||||
if(!$this->load->is_loaded('Qra')) {
|
||||
$this->load->library('Qra');
|
||||
}
|
||||
|
||||
$locator1 = strtoupper($this->input->post("locator1", TRUE));
|
||||
$locator2 = strtoupper($this->input->post("locator2", TRUE));
|
||||
|
||||
if ($this->session->userdata('user_measurement_base') == NULL) {
|
||||
$measurement_base = $this->config->item('measurement_base');
|
||||
@@ -33,34 +38,39 @@ class Qrbcalc extends CI_Controller {
|
||||
$measurement_base = $this->session->userdata('user_measurement_base');
|
||||
}
|
||||
|
||||
switch ($measurement_base) {
|
||||
case 'M':
|
||||
$var_dist = " miles";
|
||||
break;
|
||||
case 'N':
|
||||
$var_dist = " nautic miles";
|
||||
break;
|
||||
case 'K':
|
||||
$var_dist = " kilometers";
|
||||
break;
|
||||
}
|
||||
|
||||
if(!$this->load->is_loaded('Qra')) {
|
||||
$this->load->library('Qra');
|
||||
}
|
||||
|
||||
$data['result'] = $this->qra->bearing($locator1, $locator2, $measurement_base);
|
||||
$data['distance'] = $this->qra->distance($locator1, $locator2, $measurement_base) . $var_dist;
|
||||
$data['bearing'] = $this->qra->get_bearing($locator1, $locator2) . "º";
|
||||
$latlng1 = $this->qra->qra2latlong($locator1);
|
||||
$latlng2 = $this->qra->qra2latlong($locator2);
|
||||
$latlng1[0] = number_format((float)$latlng1[0], 3, '.', '');;
|
||||
$latlng1[1] = number_format((float)$latlng1[1], 3, '.', '');;
|
||||
$latlng2[0] = number_format((float)$latlng2[0], 3, '.', '');;
|
||||
$latlng2[1] = number_format((float)$latlng2[1], 3, '.', '');;
|
||||
$distance = $this->qra->distance($locator1, $locator2, $measurement_base);
|
||||
|
||||
$text_latlng1 = $locator1 . ' ' . sprintf(__("Latitude: %s, Longitude: %s"), $latlng1[0], $latlng1[1]);
|
||||
$text_latlng2 = $locator2 . ' ' . sprintf(__("Latitude: %s, Longitude: %s"), $latlng2[0], $latlng2[1]);
|
||||
|
||||
switch ($measurement_base) {
|
||||
case 'M':
|
||||
$var_dist = sprintf(_ngettext("The distance between %s and %s is %s mile.", "The distance between %s and %s is %s miles.", intval($distance)), $locator1, $locator2, $distance);
|
||||
break;
|
||||
case 'N':
|
||||
$var_dist = sprintf(_ngettext("The distance between %s and %s is %s nautical mile.", "The distance between %s and %s is %s nautical miles.", intval($distance)), $locator1, $locator2, $distance);
|
||||
break;
|
||||
case 'K':
|
||||
$var_dist = sprintf(_ngettext("The distance between %s and %s is %s kilometer.", "The distance between %s and %s is %s kilometers.", intval($distance)), $locator1, $locator2, $distance);
|
||||
break;
|
||||
}
|
||||
|
||||
$data['result'] = $this->qra->bearing($locator1, $locator2, $measurement_base);
|
||||
$data['distance'] = $var_dist;
|
||||
$data['bearing'] = sprintf(__("The bearing is %s."), $this->qra->get_bearing($locator1, $locator2) . "º");
|
||||
$data['latlng1'] = $latlng1;
|
||||
$data['text_latlng1'] = $text_latlng1;
|
||||
$data['text_latlng2'] = $text_latlng2;
|
||||
$data['latlng2'] = $latlng2;
|
||||
|
||||
$data['latlong_info_text'] = __("Negative latitudes are south of the equator, negative longitudes are west of Greenwich.");
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ class Qrz extends CI_Controller {
|
||||
|
||||
public function import_qrz() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$data['page_title'] = __("QRZ QSL Import");
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ class Qsl extends CI_Controller {
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(($this->config->item('disable_qsl') ?? false)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); exit; }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
if(($this->config->item('disable_qsl') ?? false)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); exit; }
|
||||
}
|
||||
|
||||
// Default view when loading controller.
|
||||
@@ -41,7 +41,7 @@ class Qsl extends CI_Controller {
|
||||
// Deletes QSL Card
|
||||
public function delete() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$id = $this->input->post('id');
|
||||
$this->load->model('Qsl_model');
|
||||
$this->Qsl_model->deleteQsl($id);
|
||||
@@ -49,7 +49,7 @@ class Qsl extends CI_Controller {
|
||||
|
||||
public function uploadqsl() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$qsoid = $this->input->post('qsoid');
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ class QSLPrint extends CI_Controller {
|
||||
|
||||
$this->load->model('qslprint_model');
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
// Update Logbook to Mark Paper Card Sent
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class QSO extends CI_Controller {
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
@@ -16,13 +16,24 @@ class QSO extends CI_Controller {
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('modes');
|
||||
$this->load->model('bands');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
// Getting the live/post mode from GET command
|
||||
// 0 = live
|
||||
// 1 = post (manual)
|
||||
$get_manual_mode = $this->input->get('manual', TRUE);
|
||||
if ($get_manual_mode == '0' || $get_manual_mode == '1') {
|
||||
$data['manual_mode'] = $get_manual_mode;
|
||||
} else {
|
||||
show_404();
|
||||
}
|
||||
|
||||
$data['active_station_profile'] = $this->stations->find_active();
|
||||
|
||||
$data['notice'] = false;
|
||||
$data['stations'] = $this->stations->all_of_user();
|
||||
$data['radios'] = $this->cat->radios();
|
||||
$data['radio_last_updated'] = $this->cat->last_updated()->row();
|
||||
$data['query'] = $this->logbook_model->last_custom('5');
|
||||
$data['dxcc'] = $this->logbook_model->fetchDxcc();
|
||||
$data['iota'] = $this->logbook_model->fetchIota();
|
||||
@@ -105,29 +116,29 @@ class QSO extends CI_Controller {
|
||||
// $qso_data = [
|
||||
// 18-Jan-2016 - make php v5.3 friendly!
|
||||
$qso_data = array(
|
||||
'start_date' => $this->input->post('start_date'),
|
||||
'start_time' => $this->input->post('start_time'),
|
||||
'start_date' => $this->input->post('start_date', TRUE),
|
||||
'start_time' => $this->input->post('start_time', TRUE),
|
||||
'end_time' => $this->input->post('end_time'),
|
||||
'time_stamp' => time(),
|
||||
'band' => $this->input->post('band'),
|
||||
'band_rx' => $this->input->post('band_rx'),
|
||||
'freq' => $this->input->post('freq_display'),
|
||||
'freq_rx' => $this->input->post('freq_display_rx'),
|
||||
'mode' => $this->input->post('mode'),
|
||||
'sat_name' => $this->input->post('sat_name'),
|
||||
'sat_mode' => $this->input->post('sat_mode'),
|
||||
'prop_mode' => $this->input->post('prop_mode'),
|
||||
'radio' => $this->input->post('radio'),
|
||||
'station_profile_id' => $this->input->post('station_profile'),
|
||||
'operator_callsign' => $this->input->post('operator_callsign'),
|
||||
'transmit_power' => $this->input->post('transmit_power')
|
||||
'band' => $this->input->post('band', TRUE),
|
||||
'band_rx' => $this->input->post('band_rx', TRUE),
|
||||
'freq' => $this->input->post('freq_display', TRUE),
|
||||
'freq_rx' => $this->input->post('freq_display_rx', TRUE),
|
||||
'mode' => $this->input->post('mode', TRUE),
|
||||
'sat_name' => $this->input->post('sat_name', TRUE),
|
||||
'sat_mode' => $this->input->post('sat_mode', TRUE),
|
||||
'prop_mode' => $this->input->post('prop_mode', TRUE),
|
||||
'radio' => $this->input->post('radio', TRUE),
|
||||
'station_profile_id' => $this->input->post('station_profile', TRUE),
|
||||
'operator_callsign' => $this->input->post('operator_callsign', TRUE),
|
||||
'transmit_power' => $this->input->post('transmit_power', TRUE)
|
||||
);
|
||||
// ];
|
||||
|
||||
$this->session->set_userdata($qso_data);
|
||||
|
||||
// If SAT name is set make it session set to sat
|
||||
if($this->input->post('sat_name')) {
|
||||
if($this->input->post('sat_name', TRUE)) {
|
||||
$this->session->set_userdata('prop_mode', 'SAT');
|
||||
}
|
||||
|
||||
@@ -136,16 +147,16 @@ class QSO extends CI_Controller {
|
||||
//change to create_qso function as add and create_qso duplicate functionality
|
||||
$this->logbook_model->create_qso();
|
||||
|
||||
$retuner=[];
|
||||
$actstation=$this->stations->find_active() ?? '';
|
||||
$returner['activeStationId'] = $actstation;
|
||||
$profile_info = $this->stations->profile($actstation)->row();
|
||||
$returner['activeStationTXPower'] = xss_clean($profile_info->station_power);
|
||||
$returner['activeStationOP'] = xss_clean($this->session->userdata('operator_callsign'));
|
||||
$returner=[];
|
||||
$actstation=$this->stations->find_active() ?? '';
|
||||
$returner['activeStationId'] = $actstation;
|
||||
$profile_info = $this->stations->profile($actstation)->row();
|
||||
$returner['activeStationTXPower'] = xss_clean($profile_info->station_power);
|
||||
$returner['activeStationOP'] = xss_clean($this->session->userdata('operator_callsign'));
|
||||
$returner['message']='success';
|
||||
|
||||
// Get last 5 qsos
|
||||
echo json_encode($returner);
|
||||
echo json_encode($returner);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +173,7 @@ class QSO extends CI_Controller {
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('modes');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$query = $this->logbook_model->qso_info($this->uri->segment(3));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
@@ -194,35 +205,31 @@ class QSO extends CI_Controller {
|
||||
$this->load->model('winkey');
|
||||
|
||||
// call settings from model winkey
|
||||
$data['result'] = $this->winkey->settings($this->session->userdata('user_id'), $this->session->userdata('station_profile_id'));
|
||||
$data['result'] = $this->winkey->settings($this->session->userdata('user_id'), $this->stations->find_active());
|
||||
|
||||
if ($data['result'] == false) {
|
||||
$this->load->view('qso/components/winkeysettings', $data);
|
||||
} else {
|
||||
$this->load->view('qso/components/winkeysettings_results', $data);
|
||||
}
|
||||
$this->load->view('qso/components/winkeysettings', $data);
|
||||
}
|
||||
|
||||
function cwmacrosave(){
|
||||
// Get the data from the form
|
||||
$function1_name = xss_clean($this->input->post('function1_name'));
|
||||
$function1_macro = xss_clean($this->input->post('function1_macro'));
|
||||
$function1_name = $this->input->post('function1_name', TRUE);
|
||||
$function1_macro = $this->input->post('function1_macro', TRUE);
|
||||
|
||||
$function2_name = xss_clean($this->input->post('function2_name'));
|
||||
$function2_macro = xss_clean($this->input->post('function2_macro'));
|
||||
$function2_name = $this->input->post('function2_name', TRUE);
|
||||
$function2_macro = $this->input->post('function2_macro', TRUE);
|
||||
|
||||
$function3_name = xss_clean($this->input->post('function3_name'));
|
||||
$function3_macro = xss_clean($this->input->post('function3_macro'));
|
||||
$function3_name = $this->input->post('function3_name', TRUE);
|
||||
$function3_macro = $this->input->post('function3_macro', TRUE);
|
||||
|
||||
$function4_name = xss_clean($this->input->post('function4_name'));
|
||||
$function4_macro = xss_clean($this->input->post('function4_macro'));
|
||||
$function4_name = $this->input->post('function4_name', TRUE);
|
||||
$function4_macro = $this->input->post('function4_macro', TRUE);
|
||||
|
||||
$function5_name = xss_clean($this->input->post('function5_name'));
|
||||
$function5_macro = xss_clean($this->input->post('function5_macro'));
|
||||
$function5_name = $this->input->post('function5_name', TRUE);
|
||||
$function5_macro = $this->input->post('function5_macro', TRUE);
|
||||
|
||||
$data = [
|
||||
'user_id' => $this->session->userdata('user_id'),
|
||||
'station_location_id' => $this->session->userdata('station_profile_id'),
|
||||
'station_location_id' => $this->stations->find_active(),
|
||||
'function1_name' => $function1_name,
|
||||
'function1_macro' => $function1_macro,
|
||||
'function2_name' => $function2_name,
|
||||
@@ -251,7 +258,7 @@ class QSO extends CI_Controller {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
// Call settings_json from model winkey
|
||||
echo $this->winkey->settings_json($this->session->userdata('user_id'), $this->session->userdata('station_profile_id'));
|
||||
echo $this->winkey->settings_json($this->session->userdata('user_id'), $this->stations->find_active());
|
||||
}
|
||||
|
||||
function edit_ajax() {
|
||||
@@ -265,10 +272,10 @@ class QSO extends CI_Controller {
|
||||
$this->load->library('form_validation');
|
||||
|
||||
if(!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard');
|
||||
}
|
||||
|
||||
$id = str_replace('"', "", $this->input->post("id"));
|
||||
$id = str_replace('"', "", $this->input->post("id", TRUE));
|
||||
$query = $this->logbook_model->qso_info($id);
|
||||
|
||||
$data['qso'] = $query->row();
|
||||
@@ -285,7 +292,7 @@ class QSO extends CI_Controller {
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard');
|
||||
}
|
||||
|
||||
$this->logbook_model->edit();
|
||||
@@ -294,7 +301,7 @@ class QSO extends CI_Controller {
|
||||
function qsl_rcvd($id, $method) {
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
// Update Logbook to Mark Paper Card Received
|
||||
|
||||
@@ -306,8 +313,8 @@ class QSO extends CI_Controller {
|
||||
}
|
||||
|
||||
function qsl_rcvd_ajax() {
|
||||
$id = str_replace('"', "", $this->input->post("id"));
|
||||
$method = str_replace('"', "", $this->input->post("method"));
|
||||
$id = str_replace('"', "", $this->input->post("id", TRUE));
|
||||
$method = str_replace('"', "", $this->input->post("method", TRUE));
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
@@ -327,29 +334,29 @@ class QSO extends CI_Controller {
|
||||
}
|
||||
|
||||
function qsl_sent_ajax() {
|
||||
$id = str_replace('"', "", $this->input->post("id"));
|
||||
$method = str_replace('"', "", $this->input->post("method"));
|
||||
|
||||
$id = str_replace('"', "", $this->input->post("id", TRUE));
|
||||
$method = str_replace('"', "", $this->input->post("method", TRUE));
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
|
||||
if(!$this->user_model->authorize(2)) {
|
||||
echo json_encode(array('message' => 'Error'));
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
// Update Logbook to Mark Paper Card Sent
|
||||
$this->logbook_model->paperqsl_update_sent($id, $method);
|
||||
|
||||
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
}
|
||||
}
|
||||
|
||||
function qsl_requested_ajax() {
|
||||
$id = str_replace('"', "", $this->input->post("id"));
|
||||
$method = str_replace('"', "", $this->input->post("method"));
|
||||
$id = str_replace('"', "", $this->input->post("id", TRUE));
|
||||
$method = str_replace('"', "", $this->input->post("method", TRUE));
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
@@ -369,8 +376,8 @@ class QSO extends CI_Controller {
|
||||
}
|
||||
|
||||
function qsl_ignore_ajax() {
|
||||
$id = str_replace('"', "", $this->input->post("id"));
|
||||
$method = str_replace('"', "", $this->input->post("method"));
|
||||
$id = str_replace('"', "", $this->input->post("id", TRUE));
|
||||
$method = str_replace('"', "", $this->input->post("method", TRUE));
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
@@ -409,7 +416,7 @@ class QSO extends CI_Controller {
|
||||
|
||||
/* Delete QSO */
|
||||
function delete_ajax() {
|
||||
$id = str_replace('"', "", $this->input->post("id"));
|
||||
$id = str_replace('"', "", $this->input->post("id", TRUE));
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
if ($this->logbook_model->check_qso_is_accessible($id)) {
|
||||
@@ -439,10 +446,8 @@ class QSO extends CI_Controller {
|
||||
$this->load->library('sota');
|
||||
$json = [];
|
||||
|
||||
if (!empty($this->input->get("query"))) {
|
||||
$query = $_GET['query'] ?? FALSE;
|
||||
$json = $this->sota->get($query);
|
||||
}
|
||||
$query = $this->input->get('query', TRUE) ?? FALSE;
|
||||
$json = $this->sota->get($query);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($json);
|
||||
@@ -451,32 +456,30 @@ class QSO extends CI_Controller {
|
||||
public function get_wwff() {
|
||||
$json = [];
|
||||
|
||||
if(!empty($this->input->get("query"))) {
|
||||
$query = isset($_GET['query']) ? $_GET['query'] : FALSE;
|
||||
$wwff = strtoupper($query);
|
||||
$query = $this->input->get('query', TRUE) ?? FALSE;
|
||||
$wwff = strtoupper($query);
|
||||
|
||||
$file = 'updates/wwff.txt';
|
||||
$file = 'updates/wwff.txt';
|
||||
|
||||
if (is_readable($file)) {
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
$input = preg_quote($wwff, '~');
|
||||
$reg = '~^'. $input .'(.*)$~';
|
||||
$result = preg_grep($reg, $lines);
|
||||
$json = [];
|
||||
$i = 0;
|
||||
foreach ($result as &$value) {
|
||||
// Limit to 100 as to not slowdown browser too much
|
||||
if (count($json) <= 100) {
|
||||
$json[] = ["name"=>$value];
|
||||
}
|
||||
if (is_readable($file)) {
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
$input = preg_quote($wwff, '~');
|
||||
$reg = '~^'. $input .'(.*)$~';
|
||||
$result = preg_grep($reg, $lines);
|
||||
$json = [];
|
||||
$i = 0;
|
||||
foreach ($result as &$value) {
|
||||
// Limit to 100 as to not slowdown browser too much
|
||||
if (count($json) <= 100) {
|
||||
$json[] = ["name"=>$value];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$src = 'assets/resources/wwff.txt';
|
||||
if (copy($src, $file)) {
|
||||
$this->get_wwff();
|
||||
} else {
|
||||
$src = 'assets/resources/wwff.txt';
|
||||
if (copy($src, $file)) {
|
||||
$this->get_wwff();
|
||||
} else {
|
||||
log_message('error', 'Failed to copy source file ('.$src.') to new location. Check if this path has the right permission: '.$file);
|
||||
}
|
||||
log_message('error', 'Failed to copy source file ('.$src.') to new location. Check if this path has the right permission: '.$file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,32 +490,30 @@ class QSO extends CI_Controller {
|
||||
public function get_pota() {
|
||||
$json = [];
|
||||
|
||||
if(!empty($this->input->get("query"))) {
|
||||
$query = isset($_GET['query']) ? $_GET['query'] : FALSE;
|
||||
$pota = strtoupper($query);
|
||||
$query = $this->input->get('query', TRUE) ?? FALSE;
|
||||
$pota = strtoupper($query);
|
||||
|
||||
$file = 'updates/pota.txt';
|
||||
$file = 'updates/pota.txt';
|
||||
|
||||
if (is_readable($file)) {
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
$input = preg_quote($pota, '~');
|
||||
$reg = '~^'. $input .'(.*)$~';
|
||||
$result = preg_grep($reg, $lines);
|
||||
$json = [];
|
||||
$i = 0;
|
||||
foreach ($result as &$value) {
|
||||
// Limit to 100 as to not slowdown browser too much
|
||||
if (count($json) <= 100) {
|
||||
$json[] = ["name"=>$value];
|
||||
}
|
||||
if (is_readable($file)) {
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
$input = preg_quote($pota, '~');
|
||||
$reg = '~^'. $input .'(.*)$~';
|
||||
$result = preg_grep($reg, $lines);
|
||||
$json = [];
|
||||
$i = 0;
|
||||
foreach ($result as &$value) {
|
||||
// Limit to 100 as to not slowdown browser too much
|
||||
if (count($json) <= 100) {
|
||||
$json[] = ["name"=>$value];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$src = 'assets/resources/pota.txt';
|
||||
if (copy($src, $file)) {
|
||||
$this->get_pota();
|
||||
} else {
|
||||
$src = 'assets/resources/pota.txt';
|
||||
if (copy($src, $file)) {
|
||||
$this->get_pota();
|
||||
} else {
|
||||
log_message('error', 'Failed to copy source file ('.$src.') to new location. Check if this path has the right permission: '.$file);
|
||||
}
|
||||
log_message('error', 'Failed to copy source file ('.$src.') to new location. Check if this path has the right permission: '.$file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,32 +527,30 @@ class QSO extends CI_Controller {
|
||||
public function get_dok() {
|
||||
$json = [];
|
||||
|
||||
if(!empty($this->input->get("query"))) {
|
||||
$query = isset($_GET['query']) ? $_GET['query'] : FALSE;
|
||||
$dok = strtoupper($query);
|
||||
$query = $this->input->get('query', TRUE) ?? FALSE;
|
||||
$dok = strtoupper($query);
|
||||
|
||||
$file = 'updates/dok.txt';
|
||||
$file = 'updates/dok.txt';
|
||||
|
||||
if (is_readable($file)) {
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
$input = preg_quote($dok, '~');
|
||||
$reg = '~^'. $input .'(.*)$~';
|
||||
$result = preg_grep($reg, $lines);
|
||||
$json = [];
|
||||
$i = 0;
|
||||
foreach ($result as &$value) {
|
||||
// Limit to 100 as to not slowdown browser too much
|
||||
if (count($json) <= 100) {
|
||||
$json[] = ["name"=>$value];
|
||||
}
|
||||
if (is_readable($file)) {
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
$input = preg_quote($dok, '~');
|
||||
$reg = '~^'. $input .'(.*)$~';
|
||||
$result = preg_grep($reg, $lines);
|
||||
$json = [];
|
||||
$i = 0;
|
||||
foreach ($result as &$value) {
|
||||
// Limit to 100 as to not slowdown browser too much
|
||||
if (count($json) <= 100) {
|
||||
$json[] = ["name"=>$value];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$src = 'assets/resources/dok.txt';
|
||||
if (copy($src, $file)) {
|
||||
$this->get_dok();
|
||||
} else {
|
||||
$src = 'assets/resources/dok.txt';
|
||||
if (copy($src, $file)) {
|
||||
$this->get_dok();
|
||||
} else {
|
||||
log_message('error', 'Failed to copy source file ('.$src.') to new location. Check if this path has the right permission: '.$file);
|
||||
}
|
||||
log_message('error', 'Failed to copy source file ('.$src.') to new location. Check if this path has the right permission: '.$file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,7 +561,7 @@ class QSO extends CI_Controller {
|
||||
public function get_sota_info() {
|
||||
$this->load->library('sota');
|
||||
|
||||
$sota = xss_clean($this->input->post('sota'));
|
||||
$sota = $this->input->post('sota', TRUE);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $this->sota->info($sota);
|
||||
@@ -571,7 +570,7 @@ class QSO extends CI_Controller {
|
||||
public function get_wwff_info() {
|
||||
$this->load->library('wwff');
|
||||
|
||||
$wwff = xss_clean($this->input->post('wwff'));
|
||||
$wwff = $this->input->post('wwff', TRUE);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $this->wwff->info($wwff);
|
||||
@@ -580,7 +579,7 @@ class QSO extends CI_Controller {
|
||||
public function get_pota_info() {
|
||||
$this->load->library('pota');
|
||||
|
||||
$pota = xss_clean($this->input->post('pota'));
|
||||
$pota = $this->input->post('pota', TRUE);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $this->pota->info($pota);
|
||||
@@ -588,7 +587,7 @@ class QSO extends CI_Controller {
|
||||
|
||||
public function get_station_power() {
|
||||
$this->load->model('stations');
|
||||
$stationProfile = xss_clean($this->input->post('stationProfile'));
|
||||
$stationProfile = $this->input->post('stationProfile', TRUE);
|
||||
$data = array('station_power' => $this->stations->get_station_power($stationProfile));
|
||||
|
||||
header('Content-Type: application/json');
|
||||
@@ -597,7 +596,7 @@ class QSO extends CI_Controller {
|
||||
|
||||
// Return Previous QSOs Made in the active logbook
|
||||
public function component_past_contacts() {
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$this->load->model('logbook_model');
|
||||
session_write_close();
|
||||
|
||||
@@ -609,7 +608,7 @@ class QSO extends CI_Controller {
|
||||
|
||||
public function get_eqsl_default_qslmsg() { // Get ONLY Default eQSL-Message with this function. This is ONLY for QSO relevant!
|
||||
$return_json = array();
|
||||
$option_key = $this->input->post('option_key');
|
||||
$option_key = $this->input->post('option_key', TRUE);
|
||||
if ($option_key > 0) {
|
||||
$options_object = $this->user_options_model->get_options('eqsl_default_qslmsg', array('option_name' => 'key_station_id', 'option_key' => $option_key))->result();
|
||||
$return_json['eqsl_default_qslmsg'] = (isset($options_object[0]->option_value)) ? $options_object[0]->option_value : '';
|
||||
@@ -623,7 +622,7 @@ class QSO extends CI_Controller {
|
||||
}
|
||||
|
||||
function check_locator($grid) {
|
||||
$grid = $this->input->post('locator');
|
||||
$grid = $this->input->post('locator', TRUE);
|
||||
// Allow empty locator
|
||||
if (preg_match('/^$/', $grid)) return true;
|
||||
// Allow 6-digit locator
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
<?php
|
||||
|
||||
class Radio extends CI_Controller {
|
||||
class Radio extends CI_Controller {
|
||||
|
||||
public function index()
|
||||
{
|
||||
public function index() {
|
||||
// Check Auth
|
||||
$this->load->model('user_model');
|
||||
|
||||
// Check if users logged in
|
||||
|
||||
if($this->user_model->validate_session() == 0) {
|
||||
if ($this->user_model->validate_session() == 0) {
|
||||
// user is not logged in
|
||||
redirect('user/login');
|
||||
}
|
||||
@@ -17,9 +16,14 @@
|
||||
// load the view
|
||||
$data['page_title'] = __("Hardware Interfaces");
|
||||
|
||||
$footerData = [];
|
||||
$footerData['scripts'] = [
|
||||
'assets/js/sections/radio.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/radio.js")),
|
||||
];
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('radio/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
function status() {
|
||||
@@ -29,7 +33,7 @@
|
||||
|
||||
// Check if users logged in
|
||||
|
||||
if($this->user_model->validate_session() == 0) {
|
||||
if ($this->user_model->validate_session() == 0) {
|
||||
// user is not logged in
|
||||
redirect('user/login');
|
||||
}
|
||||
@@ -37,57 +41,87 @@
|
||||
|
||||
$this->load->model('cat');
|
||||
$query = $this->cat->status();
|
||||
if ($query->num_rows() > 0)
|
||||
{
|
||||
|
||||
if ($query->num_rows() > 0) {
|
||||
echo "<thead><tr>";
|
||||
echo "<th>Radio</th>";
|
||||
echo "<th>Frequency</th>";
|
||||
echo "<th>Mode</th>";
|
||||
echo "<th>Timestamp</th>" ;
|
||||
echo "<th>Options</th>";
|
||||
echo "<th>" . __("Radio") . "</th>";
|
||||
echo "<th>" . __("Frequency") . "</th>";
|
||||
echo "<th>" . __("Mode") . "</th>";
|
||||
echo "<th>" . __("Timestamp") . "</th>";
|
||||
echo "<th></th>";
|
||||
echo "<th>" . __("Options") . "</th>";
|
||||
echo "<th></th>";
|
||||
echo "</tr></thead><tbody>";
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
foreach ($query->result() as $row) {
|
||||
echo "<tr>";
|
||||
echo "<td>".$row->radio."</td>";
|
||||
echo "<td>" . $row->radio . "</td>";
|
||||
|
||||
if (empty($row->frequency) || $row->frequency == "0") {
|
||||
echo "<td>- / -</td>";
|
||||
} elseif (empty($row->frequency_rx) || $row->frequency_rx == "0") {
|
||||
echo "<td>".$this->frequency->hz_to_mhz($row->frequency)."</td>";
|
||||
echo "<td>" . $this->frequency->qrg_conversion($row->frequency) . "</td>";
|
||||
} else {
|
||||
echo "<td>".$this->frequency->hz_to_mhz($row->frequency_rx)." / ".$this->frequency->hz_to_mhz($row->frequency)."</td>";
|
||||
echo "<td>" . $this->frequency->qrg_conversion($row->frequency_rx) . " / " . $this->frequency->qrg_conversion($row->frequency) . "</td>";
|
||||
}
|
||||
|
||||
if (empty($row->mode) || $row->mode == "non") {
|
||||
echo "<td>N/A</td>";
|
||||
} elseif (empty($row->mode_rx) || $row->mode_rx == "non") {
|
||||
echo "<td>".$row->mode."</td>";
|
||||
echo "<td>" . $row->mode . "</td>";
|
||||
} else {
|
||||
echo "<td>".$row->mode_rx." / ".$row->mode."</td>";
|
||||
echo "<td>" . $row->mode_rx . " / " . $row->mode . "</td>";
|
||||
}
|
||||
|
||||
// Get Date format
|
||||
if ($this->session->userdata('user_date_format')) {
|
||||
// If Logged in and session exists
|
||||
$custom_date_format = $this->session->userdata('user_date_format');
|
||||
} else {
|
||||
// Get Default date format from /config/wavelog.php
|
||||
$custom_date_format = $this->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
$phpdate = strtotime($row->timestamp);
|
||||
echo "<td>".date('H:i:s d-m-y', $phpdate)."</td>" ;
|
||||
echo "<td><a href=\"".site_url('radio/delete')."/".$row->id."\" class=\"btn btn-sm btn-danger\"> <i class=\"fas fa-trash-alt\"></i> Delete</a></td>" ;
|
||||
echo "<td>" . date($custom_date_format . ' H:i:s', $phpdate) . "</td>";
|
||||
|
||||
$last_updated = $this->cat->last_updated()->row()->id;
|
||||
|
||||
if ($last_updated == $row->id) {
|
||||
echo '<td><i>' . __("last updated") . '</i></td>';
|
||||
} else {
|
||||
echo '<td></td>';
|
||||
}
|
||||
|
||||
$defaul_user_radio = $this->user_options_model->get_options('cat', array('option_name' => 'default_radio'))->row()->option_value ?? NULL;
|
||||
if (!$defaul_user_radio) {
|
||||
echo '<td><button id="default_radio_btn_' . $row->id . '" class="btn btn-sm btn-outline-primary ld-ext-right" onclick="set_default_radio(' . $row->id . ')">' . __("Set as default radio") . '<div class="ld ld-ring ld-spin"></div></button</td>';
|
||||
} else {
|
||||
if ($defaul_user_radio !== $row->id) {
|
||||
echo '<td><button id="default_radio_btn_' . $row->id . '" class="btn btn-sm btn-outline-primary ld-ext-right" onclick="set_default_radio(' . $row->id . ')">' . __("Set as default radio") . '<div class="ld ld-ring ld-spin"></div></button</td>';
|
||||
} else {
|
||||
echo '<td><button id="default_radio_btn_' . $row->id . '" class="btn btn-sm btn-primary ld-ext-right" onclick="release_default_radio(' . $row->id . ')">' . __("Default (click to release)") . '<div class="ld ld-ring ld-spin"></div></button</td>';
|
||||
}
|
||||
}
|
||||
echo "<td><a href=\"" . site_url('radio/delete') . "/" . $row->id . "\" class=\"btn btn-sm btn-danger\"> <i class=\"fas fa-trash-alt\"></i> " . __("Delete") . "</a></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</tbody>";
|
||||
} else {
|
||||
echo "<thead><tr>";
|
||||
echo "<td colspan=\"4\">No CAT Interfaced radios found.</td>";
|
||||
echo "<td colspan=\"6\"><div class=\"alert alert-info text-center\">" . __("No CAT interfaced radios found.") . "</div></td>";
|
||||
echo "</tr></thead>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function json($id) {
|
||||
|
||||
$clean_id = $this->security->xss_clean($id);
|
||||
|
||||
$this->load->model('user_model');
|
||||
|
||||
// Check if users logged in
|
||||
|
||||
if($this->user_model->validate_session() == 0) {
|
||||
if ($this->user_model->validate_session() == 0) {
|
||||
// user is not logged in
|
||||
// Return Json data
|
||||
header('Content-Type: application/json');
|
||||
@@ -95,18 +129,16 @@
|
||||
"error" => "not_logged_in"
|
||||
), JSON_PRETTY_PRINT);
|
||||
} else {
|
||||
session_write_close();
|
||||
session_write_close();
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$this->load->model('cat');
|
||||
|
||||
$query = $this->cat->radio_status($id);
|
||||
$query = $this->cat->radio_status($clean_id);
|
||||
|
||||
if ($query->num_rows() > 0)
|
||||
{
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
if ($query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
|
||||
$frequency = $row->frequency;
|
||||
|
||||
@@ -123,7 +155,7 @@
|
||||
$mode = "FM";
|
||||
}
|
||||
} else {
|
||||
$mode=null;
|
||||
$mode = null;
|
||||
}
|
||||
|
||||
if ($row->prop_mode == "SAT") {
|
||||
@@ -143,7 +175,7 @@
|
||||
if (empty($sat_mode_uplink)) {
|
||||
$sat_mode = "";
|
||||
} elseif ($sat_mode_uplink !== $sat_mode_downlink) {
|
||||
$sat_mode = $sat_mode_uplink."/".$sat_mode_downlink;
|
||||
$sat_mode = $sat_mode_uplink . "/" . $sat_mode_downlink;
|
||||
} else {
|
||||
$sat_mode = $sat_mode_uplink;
|
||||
}
|
||||
@@ -164,22 +196,35 @@
|
||||
$updated_at = $minutes;
|
||||
|
||||
// Return Json data
|
||||
$a_ret['frequency']=$frequency;
|
||||
if (isset($frequency_rx) && ($frequency_rx != null)) { $a_ret['frequency_rx']=$frequency_rx; }
|
||||
if (isset($mode) && ($mode != null)) { $a_ret['mode']=$mode; }
|
||||
if (isset($sat_mode) && ($sat_mode != null)) { $a_ret['satmode']=$sat_mode; }
|
||||
if (isset($sat_name) && ($sat_name != null)) { $a_ret['satname']=$sat_name; }
|
||||
if (isset($power) && ($power != null)) { $a_ret['power']=$power; }
|
||||
if (isset($prop_mode) && ($prop_mode != null)) { $a_ret['prop_mode']=$prop_mode; }
|
||||
$a_ret['update_minutes_ago']=$updated_at;
|
||||
$a_ret['frequency'] = $frequency;
|
||||
$a_ret['frequency_formatted'] = $this->frequency->qrg_conversion($frequency);
|
||||
if (isset($frequency_rx) && ($frequency_rx != null)) {
|
||||
$a_ret['frequency_rx'] = $frequency_rx;
|
||||
$a_ret['frequency_rx_formatted'] = $this->frequency->qrg_conversion($frequency_rx);
|
||||
}
|
||||
if (isset($mode) && ($mode != null)) {
|
||||
$a_ret['mode'] = $mode;
|
||||
}
|
||||
if (isset($sat_mode) && ($sat_mode != null)) {
|
||||
$a_ret['satmode'] = $sat_mode;
|
||||
}
|
||||
if (isset($sat_name) && ($sat_name != null)) {
|
||||
$a_ret['satname'] = $sat_name;
|
||||
}
|
||||
if (isset($power) && ($power != null)) {
|
||||
$a_ret['power'] = $power;
|
||||
}
|
||||
if (isset($prop_mode) && ($prop_mode != null)) {
|
||||
$a_ret['prop_mode'] = $prop_mode;
|
||||
}
|
||||
$a_ret['update_minutes_ago'] = $updated_at;
|
||||
echo json_encode($a_ret, JSON_PRETTY_PRINT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get_mode_designator($frequency)
|
||||
{
|
||||
function get_mode_designator($frequency) {
|
||||
if ($frequency > 21000000 && $frequency < 22000000)
|
||||
return "H";
|
||||
if ($frequency > 28000000 && $frequency < 30000000)
|
||||
@@ -207,21 +252,60 @@
|
||||
}
|
||||
|
||||
function delete($id) {
|
||||
|
||||
$clean_id = $this->security->xss_clean($id);
|
||||
|
||||
// Check Auth
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(3)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if (!$this->user_model->authorize(3)) {
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
$this->load->model('cat');
|
||||
|
||||
$this->cat->delete($id);
|
||||
$this->cat->delete($clean_id);
|
||||
|
||||
if ($clean_id == $this->user_options_model->get_options('cat', array('option_name' => 'default_radio'))->row()->option_value ?? '') {
|
||||
$this->release_default_radio();
|
||||
}
|
||||
|
||||
$this->session->set_flashdata('message', 'Radio Profile Deleted');
|
||||
|
||||
session_write_close();
|
||||
redirect('radio');
|
||||
}
|
||||
|
||||
function set_default_radio() {
|
||||
|
||||
// get the radio_id from POST
|
||||
$clean_radio_id = $this->security->xss_clean($this->input->post('radio_id'));
|
||||
|
||||
// Check Auth
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(3)) {
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
// we unset the current default radio
|
||||
$this->release_default_radio();
|
||||
|
||||
// Set the user_option and session data
|
||||
$this->user_options_model->set_option('cat', 'default_radio', array('radio_id' => $clean_radio_id));
|
||||
$this->session->set_userdata('radio', $clean_radio_id);
|
||||
}
|
||||
|
||||
function release_default_radio() {
|
||||
// Check Auth
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(3)) {
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
// Unset the user_option and session data
|
||||
$this->user_options_model->del_option('cat', 'default_radio');
|
||||
$this->session->unset_userdata('radio');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -12,7 +12,7 @@ class Satellite extends CI_Controller {
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -138,4 +138,145 @@ class Satellite extends CI_Controller {
|
||||
echo json_encode($sat_list, JSON_FORCE_OBJECT);
|
||||
}
|
||||
|
||||
public function flightpath() {
|
||||
$this->load->model('satellite_model');
|
||||
$this->load->model('stations');
|
||||
|
||||
$pageData['satellites'] = $this->satellite_model->get_all_satellites_with_tle();
|
||||
|
||||
$footerData = [];
|
||||
$footerData['scripts'] = [
|
||||
'assets/js/sections/satellite.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/satellite.js")),
|
||||
'assets/js/sections/three-orbit-controls.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/three-orbit-controls.js")),
|
||||
'assets/js/sections/satellite_functions.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/satellite_functions.js")),
|
||||
'assets/js/sections/flightpath.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/flightpath.js")),
|
||||
];
|
||||
|
||||
$homegrid = explode(',', $this->stations->find_gridsquare());
|
||||
|
||||
$this->load->library('Qra');
|
||||
$pageData['latlng'] = $this->qra->qra2latlong($homegrid[0]);
|
||||
|
||||
// Render Page
|
||||
$pageData['page_title'] = "Satellite Flightpath";
|
||||
$this->load->view('interface_assets/header', $pageData);
|
||||
$this->load->view('satellite/flightpath');
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
public function get_tle() {
|
||||
$sat = $this->security->xss_clean($this->input->post('sat'));
|
||||
$this->load->model('satellite_model');
|
||||
$satellite_data = $this->satellite_model->get_tle($sat);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($satellite_data, JSON_FORCE_OBJECT);
|
||||
}
|
||||
|
||||
public function pass() {
|
||||
$this->load->model('satellite_model');
|
||||
$this->load->model('stations');
|
||||
$active_station_id = $this->stations->find_active();
|
||||
$pageData['activegrid'] = $this->stations->gridsquare_from_station($active_station_id);
|
||||
|
||||
$pageData['satellites'] = $this->satellite_model->get_all_satellites_with_tle();
|
||||
|
||||
$footerData = [];
|
||||
$footerData['scripts'] = [
|
||||
'assets/js/sections/satpasses.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/satpasses.js")),
|
||||
];
|
||||
|
||||
// Render Page
|
||||
$pageData['page_title'] = "Satellite pass";
|
||||
$this->load->view('interface_assets/header', $pageData);
|
||||
$this->load->view('satellite/pass');
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
public function searchpasses() {
|
||||
try {
|
||||
$result = $this->get_tle_for_predict();
|
||||
$this->calcpass($result);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
header("Content-type: application/json");
|
||||
echo json_encode(['ok' => 'Error', 'message' => $e->getMessage() . $e->getCode()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function get_tle_for_predict() {
|
||||
$sat = $this->security->xss_clean($this->input->post('sat'));
|
||||
$this->load->model('satellite_model');
|
||||
return $this->satellite_model->get_tle($sat);
|
||||
}
|
||||
|
||||
function calcpass($sat_tle) {
|
||||
require_once "./src/predict/Predict.php";
|
||||
require_once "./src/predict/Predict/Sat.php";
|
||||
require_once "./src/predict/Predict/QTH.php";
|
||||
require_once "./src/predict/Predict/Time.php";
|
||||
require_once "./src/predict/Predict/TLE.php";
|
||||
|
||||
// The observer or groundstation is called QTH in ham radio terms
|
||||
$predict = new Predict();
|
||||
$qth = new Predict_QTH();
|
||||
$qth->alt = $this->security->xss_clean($this->input->post('altitude')); // Altitude in meters
|
||||
|
||||
$strQRA = $this->security->xss_clean($this->input->post('yourgrid'));
|
||||
|
||||
if ((strlen($strQRA) % 2 == 0) && (strlen($strQRA) <= 10)) { // Check if QRA is EVEN (the % 2 does that) and smaller/equal 8
|
||||
$strQRA = strtoupper($strQRA);
|
||||
if (strlen($strQRA) == 4) $strQRA .= "LL"; // Only 4 Chars? Fill with center "LL" as only A-R allowed
|
||||
if (strlen($strQRA) == 6) $strQRA .= "55"; // Only 6 Chars? Fill with center "55"
|
||||
if (strlen($strQRA) == 8) $strQRA .= "LL"; // Only 8 Chars? Fill with center "LL" as only A-R allowed
|
||||
|
||||
if (!preg_match('/^[A-R]{2}[0-9]{2}[A-X]{2}[0-9]{2}[A-X]{2}$/', $strQRA)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$this->load->is_loaded('Qra')) {
|
||||
$this->load->library('Qra');
|
||||
}
|
||||
$homecoordinates = $this->qra->qra2latlong($this->security->xss_clean($this->input->post('yourgrid')));
|
||||
|
||||
$qth->lat = $homecoordinates[0];
|
||||
$qth->lon = $homecoordinates[1];
|
||||
|
||||
$temp = preg_split('/\n/', $sat_tle->tle);
|
||||
|
||||
$tle = new Predict_TLE($sat_tle->satellite, $temp[0], $temp[1]); // Instantiate it
|
||||
$sat = new Predict_Sat($tle); // Load up the satellite data
|
||||
|
||||
$now = Predict_Time::get_current_daynum(); // get the current time as Julian Date (daynum)
|
||||
|
||||
// You can modify some preferences in Predict(), the defaults are below
|
||||
//
|
||||
$predict->minEle = intval($this->security->xss_clean($this->input->post('minelevation'))); // Minimum elevation for a pass
|
||||
$predict->timeRes = 1; // Pass details: time resolution in seconds
|
||||
$predict->numEntries = 20; // Pass details: number of entries per pass
|
||||
// $predict->threshold = -6; // Twilight threshold (sun must be at this lat or lower)
|
||||
|
||||
// Get the passes and filter visible only, takes about 4 seconds for 10 days
|
||||
$results = $predict->get_passes($sat, $qth, $now, 1);
|
||||
$filtered = $predict->filterVisiblePasses($results);
|
||||
|
||||
$zone = $this->security->xss_clean($this->input->post('timezone'));
|
||||
|
||||
// Get Date format
|
||||
if ($this->session->userdata('user_date_format')) {
|
||||
// If Logged in and session exists
|
||||
$custom_date_format = $this->session->userdata('user_date_format');
|
||||
} else {
|
||||
// Get Default date format from /config/wavelog.php
|
||||
$custom_date_format = $this->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
$format = $custom_date_format . ' H:i:s';
|
||||
|
||||
$data['filtered'] = $filtered;
|
||||
$data['zone'] = $zone;
|
||||
$data['format'] = $format;
|
||||
$this->load->view('satellite/passtable', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class Sattimers extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
@@ -10,7 +10,7 @@ class Search extends CI_Controller {
|
||||
$this->load->helper(array('form', 'url'));
|
||||
if($this->optionslib->get_option('global_search') != "true") {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,10 +75,8 @@ class Search extends CI_Controller {
|
||||
}
|
||||
|
||||
function json_result() {
|
||||
if(isset($_POST['search'])) {
|
||||
$result = $this->fetchQueryResult($_POST['search'], false);
|
||||
echo json_encode($result->result_array());
|
||||
}
|
||||
$result = $this->fetchQueryResult(($this->input->post('search', TRUE) ?? ''), FALSE);
|
||||
echo json_encode($result->result_array());
|
||||
}
|
||||
|
||||
function get_stored_queries() {
|
||||
@@ -88,17 +86,13 @@ class Search extends CI_Controller {
|
||||
}
|
||||
|
||||
function search_result() {
|
||||
if(isset($_POST['search'])) {
|
||||
$data['results'] = $this->fetchQueryResult($_POST['search'], false);
|
||||
$this->load->view('search/search_result_ajax', $data);
|
||||
}
|
||||
$data['results'] = $this->fetchQueryResult(($this->input->post('search', TRUE) ?? ''), FALSE);
|
||||
$this->load->view('search/search_result_ajax', $data);
|
||||
}
|
||||
|
||||
function export_to_adif() {
|
||||
if(isset($_POST['search'])) {
|
||||
$data['qsos'] = $this->fetchQueryResult($_POST['search'], false);
|
||||
$this->load->view('adif/data/exportall', $data);
|
||||
}
|
||||
$data['qsos'] = $this->fetchQueryResult(($this->input->post('search', TRUE) ?? ''), FALSE);
|
||||
$this->load->view('adif/data/exportall', $data);
|
||||
}
|
||||
|
||||
function export_stored_query_to_adif() {
|
||||
@@ -122,20 +116,21 @@ class Search extends CI_Controller {
|
||||
}
|
||||
|
||||
function save_query() {
|
||||
if(isset($_POST['search'])) {
|
||||
$query = $this->fetchQueryResult($_POST['search'], true);
|
||||
$search_param = $this->input->post('search', TRUE);
|
||||
$description = $this->input->post('description', TRUE);
|
||||
|
||||
$data = array(
|
||||
'userid' => xss_clean($this->session->userdata('user_id')),
|
||||
'query' => $query,
|
||||
'description' => xss_clean($_POST['description'])
|
||||
);
|
||||
$query = $this->fetchQueryResult($search_param, TRUE);
|
||||
|
||||
$this->db->insert('queries', $data);
|
||||
$last_id = $this->db->insert_id();
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('id' => $last_id, 'description' => xss_clean($_POST['description'])));
|
||||
}
|
||||
$data = array(
|
||||
'userid' => xss_clean($this->session->userdata('user_id')),
|
||||
'query' => $query,
|
||||
'description' => $description
|
||||
);
|
||||
|
||||
$this->db->insert('queries', $data);
|
||||
$last_id = $this->db->insert_id();
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('id' => $last_id, 'description' => $description));
|
||||
}
|
||||
|
||||
function delete_query() {
|
||||
|
||||
@@ -4,7 +4,7 @@ class SimpleFLE extends CI_Controller {
|
||||
|
||||
public function index() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
|
||||
$this->load->model('stations');
|
||||
|
||||
@@ -14,30 +14,11 @@ class Station extends CI_Controller
|
||||
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('stations');
|
||||
$this->load->model('Logbook_model');
|
||||
$this->load->model('user_model');
|
||||
|
||||
$data['is_admin'] = ($this->user_model->authorize(99));
|
||||
|
||||
$data['stations'] = $this->stations->all_with_count();
|
||||
$data['current_active'] = $this->stations->find_active();
|
||||
$data['is_there_qsos_with_no_station_id'] = $this->Logbook_model->check_for_station_id();
|
||||
|
||||
// Render Page
|
||||
$data['page_title'] = __("Station Location");
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('station_profile/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->load->model('stations');
|
||||
|
||||
@@ -12,7 +12,7 @@ class Stationsetup extends CI_Controller {
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
@@ -14,7 +14,7 @@ class Themes extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
||||
@@ -8,7 +8,7 @@ class Timeline extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
||||
@@ -8,7 +8,7 @@ class Timeplotter extends CI_Controller {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
||||
@@ -21,7 +21,7 @@ class Update extends CI_Controller {
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$data['page_title'] = __("Updates");
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
@@ -270,7 +270,7 @@ class Update extends CI_Controller {
|
||||
public function check_missing_dxcc($all = false){
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(99)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ class Update extends CI_Controller {
|
||||
public function check_missing_continent() {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(99)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -289,21 +289,21 @@ class Update extends CI_Controller {
|
||||
$this->logbook_model->check_missing_continent();
|
||||
}
|
||||
|
||||
public function update_distances() {
|
||||
public function update_distances($all = false) {
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(99)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
$this->logbook_model->update_distances();
|
||||
$this->logbook_model->update_distances($all);
|
||||
}
|
||||
|
||||
public function check_missing_grid($all = false){
|
||||
$this->load->model('user_model');
|
||||
if (!$this->user_model->authorize(99)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
@@ -372,5 +372,60 @@ class Update extends CI_Controller {
|
||||
|
||||
}
|
||||
|
||||
public function update_tle() {
|
||||
$mtime = microtime();
|
||||
$mtime = explode(" ",$mtime);
|
||||
$mtime = $mtime[1] + $mtime[0];
|
||||
$starttime = $mtime;
|
||||
|
||||
$url = 'https://www.amsat.org/tle/dailytle.txt';
|
||||
$curl = curl_init($url);
|
||||
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
$count = 0;
|
||||
|
||||
if ($response === false) {
|
||||
echo 'Error: ' . curl_error($curl);
|
||||
} else {
|
||||
$this->db->empty_table("tle");
|
||||
// Split the response into an array of lines
|
||||
$lines = explode("\n", $response);
|
||||
|
||||
$satname = '';
|
||||
$tleline1 = '';
|
||||
$tleline2 = '';
|
||||
// Process each line
|
||||
for ($i = 0; $i < count($lines); $i += 3) {
|
||||
$count++;
|
||||
// Check if there are at least three lines remaining
|
||||
if (isset($lines[$i], $lines[$i + 1], $lines[$i + 2])) {
|
||||
// Get the three lines
|
||||
$satname = $lines[$i];
|
||||
$tleline1 = $lines[$i + 1];
|
||||
$tleline2 = $lines[$i + 2];
|
||||
$sql = "INSERT INTO tle (satelliteid, tle) select id, ? from satellite where name = ? or exportname = ?";
|
||||
$this->db->query($sql,array($tleline1."\n".$tleline2,$satname,$satname));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$mtime = microtime();
|
||||
$mtime = explode(" ",$mtime);
|
||||
$mtime = $mtime[1] + $mtime[0];
|
||||
$endtime = $mtime;
|
||||
$totaltime = ($endtime - $starttime);
|
||||
echo "This page was created in ".$totaltime." seconds <br />";
|
||||
echo "Records inserted: " . $count . " <br/>";
|
||||
$datetime = new DateTime("now", new DateTimeZone('UTC'));
|
||||
$datetime = $datetime->format('Ymd h:i');
|
||||
$this->optionslib->update('tle_update', $datetime , 'no');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -5,20 +5,44 @@ class User extends CI_Controller {
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
|
||||
if (!$this->load->is_loaded('encryption')) {
|
||||
$this->load->library('encryption');
|
||||
}
|
||||
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$data['results'] = $this->user_model->users();
|
||||
$data['session_uid'] = $this->session->userdata('user_id');
|
||||
|
||||
// Check if impersonating is disabled in the config
|
||||
if ($this->config->item('disable_impersonate')) {
|
||||
$data['disable_impersonate'] = true;
|
||||
} else {
|
||||
$data['disable_impersonate'] = false;
|
||||
}
|
||||
|
||||
// Get Date format
|
||||
if($this->session->userdata('user_date_format')) {
|
||||
// If Logged in and session exists
|
||||
$data['custom_date_format'] = $this->session->userdata('user_date_format');
|
||||
} else {
|
||||
// Get Default date format from /config/wavelog.php
|
||||
$data['custom_date_format'] = $this->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
$data['has_flossie'] = ($this->config->item('encryption_key') == 'flossie1234555541') ? true : false;
|
||||
|
||||
$data['page_title'] = __("User Accounts");
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('user/main');
|
||||
$this->load->view('user/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
function add() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$data['existing_languages'] = $this->config->item('languages');
|
||||
|
||||
@@ -203,8 +227,8 @@ class User extends CI_Controller {
|
||||
|
||||
function edit() {
|
||||
$this->load->model('user_model');
|
||||
if ( ($this->session->userdata('user_id') == '') || ((!$this->user_model->authorize(99)) && ($this->session->userdata('user_id') != $this->uri->segment(3))) ) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if ( $this->config->item('special_callsign') && $this->session->userdata('user_type') != '99' && $this->config->item('sc_hide_usermenu') ) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if ( ($this->session->userdata('user_id') == '') || ((!$this->user_model->authorize(99)) && ($this->session->userdata('user_id') != $this->uri->segment(3))) ) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
if ( $this->config->item('special_callsign') && $this->session->userdata('user_type') != '99' && $this->config->item('sc_hide_usermenu') ) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$query = $this->user_model->get_by_id($this->uri->segment(3));
|
||||
|
||||
$data['existing_languages'] = $this->config->item('languages');
|
||||
@@ -379,7 +403,7 @@ class User extends CI_Controller {
|
||||
$data['user_language'] = $q->user_language;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($this->input->post('user_stylesheet')) {
|
||||
$data['user_stylesheet'] = $this->input->post('user_stylesheet', true);
|
||||
} else {
|
||||
@@ -591,12 +615,12 @@ class User extends CI_Controller {
|
||||
$data['user_map_'.$row->option_key.'_'.$ktype] = $this->input->post('user_map_'.$row->option_key.'_'.$ktype, true);
|
||||
} else {
|
||||
$data['user_map_'.$row->option_key.'_'.$ktype] = $vtype;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$data['user_map_'.$row->option_name.'_'.$row->option_key] = $row->option_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$data['user_map_qso_icon'] = "fas fa-dot-circle";
|
||||
$data['user_map_qso_color'] = "#FF0000";
|
||||
@@ -613,7 +637,7 @@ class User extends CI_Controller {
|
||||
|
||||
$data['user_locations_quickswitch'] = ($this->user_options_model->get_options('header_menu', array('option_name'=>'locations_quickswitch'), $this->uri->segment(3))->row()->option_value ?? 'false');
|
||||
$data['user_utc_headermenu'] = ($this->user_options_model->get_options('header_menu', array('option_name'=>'utc_headermenu'), $this->uri->segment(3))->row()->option_value ?? 'false');
|
||||
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('user/edit', $data);
|
||||
$this->load->view('interface_assets/footer');
|
||||
@@ -635,7 +659,7 @@ class User extends CI_Controller {
|
||||
if ($this->session->userdata('user_id') == $this->uri->segment(3)) { // Editing own User? Set cookie!
|
||||
$cookie= array(
|
||||
|
||||
'name' => 'language',
|
||||
'name' => $this->config->item('gettext_cookie', 'gettext'),
|
||||
'value' => $this->input->post('user_language', true),
|
||||
'expire' => time()+1000,
|
||||
'secure' => FALSE
|
||||
@@ -651,7 +675,7 @@ class User extends CI_Controller {
|
||||
$data_options['user_map_'.$icon.'_color'] = xss_clean($this->input->post('user_map_'.$icon.'_color', true));
|
||||
}
|
||||
if (!empty($data_options['user_map_qso_icon'])) {
|
||||
foreach ($array_icon as $icon) {
|
||||
foreach ($array_icon as $icon) {
|
||||
$json = json_encode(array('icon'=>$data_options['user_map_'.$icon.'_icon'], 'color'=>$data_options['user_map_'.$icon.'_color']));
|
||||
$this->user_options_model->set_option('map_custom','icon',array($icon=>$json));
|
||||
}
|
||||
@@ -716,7 +740,7 @@ class User extends CI_Controller {
|
||||
|
||||
function profile() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$query = $this->user_model->get_by_id($this->session->userdata('user_id'));
|
||||
$q = $query->row();
|
||||
$data['page_title'] = __("Profile");
|
||||
@@ -735,7 +759,7 @@ class User extends CI_Controller {
|
||||
|
||||
function delete() {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$query = $this->user_model->get_by_id($this->uri->segment(3));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
@@ -830,7 +854,7 @@ class User extends CI_Controller {
|
||||
log_message('debug', "User ID: [$uid] Login rejected because of an active maintenance mode (and he is no admin).");
|
||||
|
||||
// Delete keep_login cookie
|
||||
setcookie('keep_login', '', time() - 3600, '/');
|
||||
$this->input->set_cookie('keep_login', '', time() - 3600, '');
|
||||
|
||||
redirect('user/login');
|
||||
}
|
||||
@@ -839,7 +863,7 @@ class User extends CI_Controller {
|
||||
log_message('debug', "User ID: [$uid] Login rejected because of non matching hash key ('Keep Login').");
|
||||
|
||||
// Delete keep_login cookie
|
||||
setcookie('keep_login', '', time() - 3600, '/');
|
||||
$this->input->set_cookie('keep_login', '', time() - 3600, '');
|
||||
$this->session->set_flashdata('error', __("Login failed. Try again."));
|
||||
redirect('user/login');
|
||||
}
|
||||
@@ -848,12 +872,12 @@ class User extends CI_Controller {
|
||||
log_message('error', "User ID: [".$uid."]; 'Keep Login' failed. Cookie deleted. Message: ".$e);
|
||||
|
||||
// Delete keep_login cookie
|
||||
setcookie('keep_login', '', time() - 3600, '/');
|
||||
$this->input->set_cookie('keep_login', '', time() - 3600, '');
|
||||
|
||||
$this->session->set_flashdata('error', __("Login failed. Try again."));
|
||||
redirect('user/login');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($this->form_validation->run() == FALSE) {
|
||||
@@ -865,11 +889,10 @@ class User extends CI_Controller {
|
||||
|
||||
} else {
|
||||
if($this->user_model->login() == 1) {
|
||||
$this->session->set_flashdata('notice', __("User logged in"));
|
||||
$this->user_model->update_session($data['user']->user_id);
|
||||
$cookie= array(
|
||||
|
||||
'name' => 'language',
|
||||
'name' => $this->config->item('gettext_cookie', 'gettext'),
|
||||
'value' => $data['user']->user_language,
|
||||
'expire' => time()+1000,
|
||||
'secure' => FALSE
|
||||
@@ -912,7 +935,7 @@ class User extends CI_Controller {
|
||||
$user_name = $this->session->userdata('user_name');
|
||||
|
||||
// Delete keep_login cookie
|
||||
setcookie('keep_login', '', time() - 3600, '/');
|
||||
$this->input->set_cookie('keep_login', '', time() - 3600, '');
|
||||
|
||||
$this->user_model->clear_session();
|
||||
|
||||
@@ -934,7 +957,7 @@ class User extends CI_Controller {
|
||||
redirect('user/login');
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
@@ -1013,13 +1036,13 @@ class User extends CI_Controller {
|
||||
public function admin_send_password_reset() {
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
|
||||
if ($this->input->is_ajax_request()) { // just additional, to make sure request is from ajax
|
||||
if ($this->input->post('submit_allowed')) {
|
||||
|
||||
$this->load->model('user_model');
|
||||
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
|
||||
$query = $this->user_model->get_by_id($this->input->post('user_id'));
|
||||
|
||||
@@ -1091,8 +1114,7 @@ class User extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
function reset_password($reset_code = NULL)
|
||||
{
|
||||
function reset_password($reset_code = NULL) {
|
||||
$data['reset_code'] = $reset_code;
|
||||
if($reset_code != NULL) {
|
||||
$this->load->helper(array('form', 'url'));
|
||||
@@ -1123,38 +1145,118 @@ class User extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
function check_locator($grid) {
|
||||
$grid = $this->input->post('user_locator');
|
||||
// Allow empty locator
|
||||
if (preg_match('/^$/', $grid)) return true;
|
||||
// Allow 6-digit locator
|
||||
if (preg_match('/^[A-Ra-r]{2}[0-9]{2}[A-Za-z]{2}$/', $grid)) return true;
|
||||
// Allow 4-digit locator
|
||||
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2}$/', $grid)) return true;
|
||||
// Allow 4-digit grid line
|
||||
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2},[A-Ra-r]{2}[0-9]{2}$/', $grid)) return true;
|
||||
// Allow 4-digit grid corner
|
||||
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2},[A-Ra-r]{2}[0-9]{2},[A-Ra-r]{2}[0-9]{2},[A-Ra-r]{2}[0-9]{2}$/', $grid)) return true;
|
||||
// Allow 2-digit locator
|
||||
else if (preg_match('/^[A-Ra-r]{2}$/', $grid)) return true;
|
||||
// Allow 8-digit locator
|
||||
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2}[A-Za-z]{2}[0-9]{2}$/', $grid)) return true;
|
||||
else {
|
||||
$this->form_validation->set_message('check_locator', 'Please check value for grid locator ('.strtoupper($grid).').');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function check_locator($grid) {
|
||||
$grid = $this->input->post('user_locator');
|
||||
// Allow empty locator
|
||||
if (preg_match('/^$/', $grid)) return true;
|
||||
// Allow 6-digit locator
|
||||
if (preg_match('/^[A-Ra-r]{2}[0-9]{2}[A-Za-z]{2}$/', $grid)) return true;
|
||||
// Allow 4-digit locator
|
||||
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2}$/', $grid)) return true;
|
||||
// Allow 4-digit grid line
|
||||
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2},[A-Ra-r]{2}[0-9]{2}$/', $grid)) return true;
|
||||
// Allow 4-digit grid corner
|
||||
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2},[A-Ra-r]{2}[0-9]{2},[A-Ra-r]{2}[0-9]{2},[A-Ra-r]{2}[0-9]{2}$/', $grid)) return true;
|
||||
// Allow 2-digit locator
|
||||
else if (preg_match('/^[A-Ra-r]{2}$/', $grid)) return true;
|
||||
// Allow 8-digit locator
|
||||
else if (preg_match('/^[A-Ra-r]{2}[0-9]{2}[A-Za-z]{2}[0-9]{2}$/', $grid)) return true;
|
||||
else {
|
||||
$this->form_validation->set_message('check_locator', 'Please check value for grid locator ('.strtoupper($grid).').');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function https_check() {
|
||||
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
|
||||
return true;
|
||||
function https_check() {
|
||||
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
|
||||
return true;
|
||||
}
|
||||
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
|
||||
return true;
|
||||
}
|
||||
if (!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] === 'on') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
|
||||
return true;
|
||||
|
||||
public function impersonate() {
|
||||
|
||||
// Check if impersonating is disabled in the config
|
||||
if ($this->config->item('disable_impersonate')) {
|
||||
show_404();
|
||||
}
|
||||
|
||||
// Load the encryption library
|
||||
if (!$this->load->is_loaded('encryption')) {
|
||||
$this->load->library('encryption');
|
||||
}
|
||||
// Load the user model
|
||||
$this->load->model('user_model');
|
||||
|
||||
// Precheck: If the encryption key is still default, we can't impersonate another user for security reasons
|
||||
if ($this->config->item('encryption_key') == 'flossie1234555541') {
|
||||
$this->session->set_flashdata('error', __("You currently can't impersonate another user. Please change the encryption_key in your config.php file first!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
// Prepare the hash
|
||||
$raw_hash = $this->encryption->decrypt($this->input->post('hash', TRUE) ?? '');
|
||||
if (!$raw_hash) {
|
||||
$this->session->set_flashdata('error', __("Invalid Hash"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
$hash_parts = explode('/', $raw_hash);
|
||||
$source_uid = $hash_parts[0];
|
||||
$target_uid = $hash_parts[1];
|
||||
$timestamp = $hash_parts[2];
|
||||
|
||||
/**
|
||||
* Security Checks
|
||||
*/
|
||||
// make sure the timestamp is not too old
|
||||
if (time() - $timestamp > 600) { // 10 minutes
|
||||
$this->session->set_flashdata('error', __("The impersonation hash is too old. Please try again."));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
// is the source user still logged in?
|
||||
// We fetch the source user from database to also make sure the user exists. We could use source_uid directly, but this is more secure
|
||||
if ($this->session->userdata('user_id') != $this->user_model->get_by_id($source_uid)->row()->user_id) {
|
||||
$this->session->set_flashdata('error', __("You can't impersonate another user while you're not logged in as the source user"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
// in addition to the check if the user is logged in, we also can check if the session id matches the cookie
|
||||
if ($this->session->session_id != $this->input->cookie($this->config->item('sess_cookie_name'), TRUE)) {
|
||||
$this->session->set_flashdata('error', __("There was a problem with your session. Please try again."));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
// make sure the target user exists
|
||||
$target_user = $this->user_model->get_by_id($target_uid)->row();
|
||||
if (!$target_user) {
|
||||
$this->session->set_flashdata('error', __("The requested user to impersonate does not exist"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
// before we can impersonate a user, we need to make sure the current user is an admin
|
||||
// TODO: authorize from additional datatable 'impersonators' to allow other user types to impersonate
|
||||
$source_user = $this->user_model->get_by_id($source_uid)->row();
|
||||
if(!$source_user || !$this->user_model->authorize(99)) {
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!"));
|
||||
redirect('dashboard');
|
||||
}
|
||||
|
||||
/**
|
||||
* Impersonate the user
|
||||
*/
|
||||
// Update the session with the new user_id
|
||||
// TODO: Find a solution for sessiondata 'radio', so a user would be able to use e.g. his own radio while impersonating another user
|
||||
// Due the fact that the user is now impersonating another user, he can't use his default radio anymore
|
||||
$this->user_model->update_session($target_uid);
|
||||
|
||||
// Redirect to the dashboard, the user should now be logged in as the other user
|
||||
redirect('dashboard');
|
||||
}
|
||||
if (!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] === 'on') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class User_Options extends CI_Controller {
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('user_options_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
}
|
||||
|
||||
public function add_edit_fav() {
|
||||
|
||||
@@ -224,7 +224,7 @@ class Visitor extends CI_Controller {
|
||||
|
||||
|
||||
// Get Confirmed LoTW & Paper Squares (non VUCC)
|
||||
$query = $this->gridmap_model->get_band_confirmed('SAT', 'All', 'false', 'true', 'false', 'false', 'All', 'All', $logbooks_locations_array);
|
||||
$query = $this->gridmap_model->get_band_confirmed('SAT', 'All', 'false', 'true', 'false', 'false', 'All', 'All', 'All', $logbooks_locations_array);
|
||||
|
||||
|
||||
if ($query && $query->num_rows() > 0)
|
||||
@@ -260,7 +260,7 @@ class Visitor extends CI_Controller {
|
||||
}
|
||||
|
||||
// Get worked squares
|
||||
$query = $this->gridmap_model->get_band('SAT', 'All', 'false', 'true', 'false', 'false', 'All', 'All', $logbooks_locations_array);
|
||||
$query = $this->gridmap_model->get_band('SAT', 'All', 'false', 'true', 'false', 'false', 'All', 'All', 'All', $logbooks_locations_array);
|
||||
|
||||
if ($query && $query->num_rows() > 0)
|
||||
{
|
||||
@@ -294,7 +294,7 @@ class Visitor extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$query_vucc = $this->gridmap_model->get_band_worked_vucc_squares('SAT', 'All', 'false', 'true', 'false', 'false', 'All', 'All', $logbooks_locations_array);
|
||||
$query_vucc = $this->gridmap_model->get_band_worked_vucc_squares('SAT', 'All', 'false', 'true', 'false', 'false', 'All', 'All', 'All', $logbooks_locations_array);
|
||||
|
||||
if ($query && $query_vucc->num_rows() > 0)
|
||||
{
|
||||
@@ -321,7 +321,7 @@ class Visitor extends CI_Controller {
|
||||
}
|
||||
|
||||
// Confirmed Squares
|
||||
$query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares('SAT', 'All', 'false', 'true', 'false', 'false', 'All', 'All', $logbooks_locations_array);
|
||||
$query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares('SAT', 'All', 'false', 'true', 'false', 'false', 'All', 'All', 'All', $logbooks_locations_array);
|
||||
|
||||
if ($query && $query_vucc->num_rows() > 0)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ class Widgets extends CI_Controller {
|
||||
$data['theme'] = $this->config->item('option_theme');
|
||||
}
|
||||
|
||||
$data['user_callsign'] = $user_callsign;
|
||||
$data['user_callsign'] = strtoupper($this->security->xss_clean($user_callsign));
|
||||
$this->load->view('widgets/oqrs', $data);
|
||||
}
|
||||
}
|
||||
@@ -279,7 +279,7 @@ class Gettext
|
||||
$folder = NULL;
|
||||
|
||||
// Check if any cookie is set
|
||||
if ($cookie = $IN->cookie(config_item('cookie_prefix').$this->config['cookie'], TRUE))
|
||||
if ($cookie = $IN->cookie($this->config['cookie'], TRUE))
|
||||
{
|
||||
$folder = $cookie;
|
||||
}
|
||||
@@ -308,7 +308,7 @@ class Gettext
|
||||
// Use cookie if enabled
|
||||
if ( ! empty($this->config['cookie']))
|
||||
{
|
||||
$IN->set_cookie($this->config['cookie'], $current['folder'], 2678400);
|
||||
$IN->set_cookie(str_replace(config_item('cookie_prefix'), '', $this->config['cookie']), $current['folder'], 2678400);
|
||||
}
|
||||
|
||||
// In case we use session
|
||||
@@ -401,7 +401,7 @@ class Gettext
|
||||
// If the use of cookies is ON
|
||||
if ($this->config['cookie'] !== NULL)
|
||||
{
|
||||
$IN->set_cookie($this->config['cookie'], $lang['folder'], 2678400);
|
||||
$IN->set_cookie(str_replace(config_item('cookie_prefix'), '', $this->config['cookie']), $lang['folder'], 2678400);
|
||||
}
|
||||
|
||||
// In case COOKIE are off but SESSION is on
|
||||
|
||||
@@ -211,7 +211,7 @@ function _encode($text)
|
||||
if ($source_encoding != $target_encoding) $text = mb_convert_encoding($text, $target_encoding, $source_encoding);
|
||||
}
|
||||
|
||||
return $text;
|
||||
return htmlentities($text);
|
||||
}
|
||||
|
||||
// Custom implementation of the standard gettext related functions
|
||||
|
||||
@@ -225,9 +225,95 @@ class Frequency {
|
||||
return $Band;
|
||||
}
|
||||
|
||||
// converts a frequency in Hz to MHz output
|
||||
function hz_to_mhz($frequency) {
|
||||
return number_format(($frequency / 1000 / 1000), 3) . " MHz";
|
||||
/**
|
||||
* Convert a frequency to a specified unit and return it in a specified format.
|
||||
*
|
||||
* @param float $frequency The frequency value to be converted.
|
||||
*
|
||||
* @param int $r_option (Optional) The result format option.
|
||||
* 0: Return as a string with just the frequency.
|
||||
* 1 (default): Return as a string with frequency and unit.
|
||||
* 2: Return as a string with frequency, unit, and band.
|
||||
*
|
||||
* @param string $source_unit (Optional) The source unit of the frequency.
|
||||
* Possible values: 'Hz', 'kHz', 'MHz', 'GHz'.
|
||||
* Default is 'Hz'.
|
||||
* ! If the source unit is not 'Hz', you have to provide the source unit. !
|
||||
*
|
||||
* @param string $target_unit (Optional) The target unit for conversion.
|
||||
* Possible values: 'Hz', 'kHz', 'MHz', 'GHz'.
|
||||
* If not provided, the unit is determined based on session data (function qrg_unit()).
|
||||
*
|
||||
* @return string The converted frequency in the specified format.
|
||||
*
|
||||
* To change the number of decimals shown per unit, add in your config.php
|
||||
*
|
||||
* $config['qrg_hz_dec'] = 0;
|
||||
* $config['qrg_khz_dec'] = 0;
|
||||
* $config['qrg_mhz_dec'] = 3;
|
||||
* $config['qrg_ghz_dec'] = 3;
|
||||
*
|
||||
* and adjust the values to your needs.
|
||||
*
|
||||
*/
|
||||
function qrg_conversion($frequency, $r_option = 1, $source_unit = 'Hz', $target_unit = NULL) {
|
||||
|
||||
$CI = &get_instance();
|
||||
|
||||
// Get the band
|
||||
$band = $this->GetBand($frequency);
|
||||
|
||||
// Get the target unit
|
||||
if ($target_unit === NULL) {
|
||||
$target_unit = $this->qrg_unit($band);
|
||||
}
|
||||
|
||||
// Convert the frequency to Hz
|
||||
switch ($source_unit) {
|
||||
case 'Hz':
|
||||
break;
|
||||
case 'kHz':
|
||||
$frequency *= 1000;
|
||||
break;
|
||||
case 'MHz':
|
||||
$frequency *= 1000000; // 1000 * 1000
|
||||
break;
|
||||
case 'GHz':
|
||||
$frequency *= 1000000000; // 1000 * 1000 * 1000
|
||||
break;
|
||||
}
|
||||
|
||||
// Convert the frequency to the target unit
|
||||
switch ($target_unit) {
|
||||
case 'Hz':
|
||||
$decimals = $CI->config->item('qrg_hz_dec') ?? 0;
|
||||
break;
|
||||
case 'kHz':
|
||||
$frequency /= 1000;
|
||||
$decimals = $CI->config->item('qrg_khz_dec') ?? 0;
|
||||
break;
|
||||
case 'MHz':
|
||||
$frequency /= 1000000; // 1000 * 1000
|
||||
$decimals = $CI->config->item('qrg_mhz_dec') ?? 3;
|
||||
break;
|
||||
case 'GHz':
|
||||
$frequency /= 1000000000; // 1000 * 1000 * 1000
|
||||
$decimals = $CI->config->item('qrg_ghz_dec') ?? 3;
|
||||
break;
|
||||
}
|
||||
|
||||
// Return
|
||||
switch ($r_option) {
|
||||
case 0:
|
||||
return number_format($frequency, $decimals, '.', '');
|
||||
break;
|
||||
case 1:
|
||||
return number_format($frequency, $decimals, '.', '') . ' ' . $target_unit;
|
||||
break;
|
||||
case 2:
|
||||
return number_format($frequency, $decimals, '.', '') . ' ' . $target_unit . ' (' . $band . ')';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function qrg_unit($band) {
|
||||
|
||||
@@ -140,7 +140,9 @@ class Qra {
|
||||
} else if ($unit == "N") {
|
||||
$dist *= 0.8684;
|
||||
}
|
||||
|
||||
if ((is_nan($dist)) || !(is_numeric($dist))) { // Special-Case, catch same grid and/or Errors
|
||||
$dist=0;
|
||||
}
|
||||
return round($dist, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class Subdivisions {
|
||||
case '318':
|
||||
case '375':
|
||||
case '386':
|
||||
return 'Province';
|
||||
return _pgettext("Division Name (States in various countries).", "Province");
|
||||
case '27':
|
||||
case '15':
|
||||
case '54':
|
||||
@@ -36,37 +36,37 @@ class Subdivisions {
|
||||
case '126':
|
||||
case '151':
|
||||
case '288':
|
||||
return 'Oblast';
|
||||
return _pgettext("Division Name (States in various countries).", "Oblast");
|
||||
case '112':
|
||||
return 'Region';
|
||||
return _pgettext("Division Name (States in various countries).", "Region");
|
||||
case '132':
|
||||
case '144':
|
||||
case '227':
|
||||
return 'Department';
|
||||
return _pgettext("Division Name (States in various countries).", "Department");
|
||||
case '170':
|
||||
return 'Region';
|
||||
return _pgettext("Division Name (States in various countries).", "Region");
|
||||
case '224':
|
||||
return 'Municipality';
|
||||
return _pgettext("Division Name (States in various countries).", "Municipality");
|
||||
case '230':
|
||||
return 'Federal State';
|
||||
return _pgettext("Division Name (States in various countries).", "Federal State");
|
||||
case '239':
|
||||
case '245':
|
||||
case '275':
|
||||
case '497':
|
||||
return 'County';
|
||||
return _pgettext("Division Name (States in various countries).", "County");
|
||||
case '272':
|
||||
case '503':
|
||||
case '504':
|
||||
return 'District';
|
||||
return _pgettext("Division Name (States in various countries).", "District");
|
||||
case '287':
|
||||
return 'Canton';
|
||||
return _pgettext("Division Name (States in various countries).", "Canton");
|
||||
case '291':
|
||||
return 'US State';
|
||||
return _pgettext("Division Name (States in various countries).", "US State");
|
||||
case '318':
|
||||
case '339':
|
||||
return 'Prefecture';
|
||||
return _pgettext("Division Name (States in various countries).", "Prefecture");
|
||||
}
|
||||
return 'State';
|
||||
return _pgettext("Division Name (States in various countries).", "State");
|
||||
}
|
||||
|
||||
public function get_secondary_subdivision_name($dxcc) {
|
||||
@@ -75,23 +75,23 @@ class Subdivisions {
|
||||
case '6':
|
||||
case '110':
|
||||
case '291':
|
||||
return 'US County';
|
||||
return _pgettext("Division Name (States in various countries).", "US County");
|
||||
case '15':
|
||||
case '54':
|
||||
case '61':
|
||||
case '126':
|
||||
case '151':
|
||||
case '288':
|
||||
return 'District';
|
||||
return _pgettext("Division Name (States in various countries).", "District");
|
||||
case '21':
|
||||
case '29':
|
||||
case '32':
|
||||
case '281':
|
||||
return 'DME';
|
||||
return _pgettext("Division Name (States in various countries).", "DME");
|
||||
case '339':
|
||||
return 'City / Ku / Gun';
|
||||
return _pgettext("Division Name (States in various countries).", "City / Ku / Gun");
|
||||
}
|
||||
return 'County';
|
||||
return _pgettext("Division Name (States in various countries).", "County");
|
||||
}
|
||||
|
||||
public function get_state_list($dxcc) {
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
application/locale/bs/LC_MESSAGES/messages.mo
Normal file
BIN
application/locale/bs/LC_MESSAGES/messages.mo
Normal file
Binary file not shown.
10953
application/locale/bs/LC_MESSAGES/messages.po
Normal file
10953
application/locale/bs/LC_MESSAGES/messages.po
Normal file
File diff suppressed because it is too large
Load Diff
11
application/locale/bs/index.html
Normal file
11
application/locale/bs/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden. </p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
application/locale/cnr/LC_MESSAGES/messages.mo
Normal file
BIN
application/locale/cnr/LC_MESSAGES/messages.mo
Normal file
Binary file not shown.
10953
application/locale/cnr/LC_MESSAGES/messages.po
Normal file
10953
application/locale/cnr/LC_MESSAGES/messages.po
Normal file
File diff suppressed because it is too large
Load Diff
11
application/locale/cnr/index.html
Normal file
11
application/locale/cnr/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden. </p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
application/locale/hr/LC_MESSAGES/messages.mo
Normal file
BIN
application/locale/hr/LC_MESSAGES/messages.mo
Normal file
Binary file not shown.
10953
application/locale/hr/LC_MESSAGES/messages.po
Normal file
10953
application/locale/hr/LC_MESSAGES/messages.po
Normal file
File diff suppressed because it is too large
Load Diff
11
application/locale/hr/index.html
Normal file
11
application/locale/hr/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden. </p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user