Skip to content
Merged

2.8.15 #3448

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion application/config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,11 @@
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_cloudlog';
$config['sess_expiration'] = 0;
$config['sess_save_path'] = '/tmp';
$cloudlog_session_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'cloudlog_' . md5((string) (realpath(FCPATH) ?: FCPATH)) . '_sessions';
if (!is_dir($cloudlog_session_path)) {
@mkdir($cloudlog_session_path, 0700, true);
}
$config['sess_save_path'] = $cloudlog_session_path;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
Expand Down
2 changes: 1 addition & 1 deletion application/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
|
*/

$config['migration_version'] = 271;
$config['migration_version'] = 272;

/*
|--------------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions application/controllers/Awards.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function dok()
}

if ($logbooks_locations_array) {
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));
$data['dok_array'] = $this->dok->get_dok_array($bands, $postdata, $location_list);
$data['dok_summary'] = $this->dok->get_dok_summary($bands, $postdata, $location_list);
} else {
Expand Down Expand Up @@ -1715,7 +1715,7 @@ public function get_dxcc_qsos()
{
$this->load->model('logbooks_model');

$dxcc_id = $this->security->xss_clean($this->input->post('dxcc_id'));
$dxcc_id = (int) $this->security->xss_clean($this->input->post('dxcc_id'));
$limit = $this->security->xss_clean($this->input->post('limit')) ?: 20;

if (!$dxcc_id || !is_numeric($dxcc_id)) {
Expand All @@ -1732,7 +1732,7 @@ public function get_dxcc_qsos()
return;
}

$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));

try {
// Get QSOs for this DXCC
Expand Down Expand Up @@ -1776,7 +1776,7 @@ public function get_dxcc_qsos_by_status()
{
$this->load->model('logbooks_model');

$dxcc_id = $this->security->xss_clean($this->input->post('dxcc_id'));
$dxcc_id = (int) $this->security->xss_clean($this->input->post('dxcc_id'));
$status = $this->security->xss_clean($this->input->post('status'));
$limit = $this->security->xss_clean($this->input->post('limit')) ?: 100;

Expand All @@ -1794,7 +1794,7 @@ public function get_dxcc_qsos_by_status()
return;
}

$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));

try {
// Build WHERE clause for status filter
Expand Down Expand Up @@ -1864,7 +1864,7 @@ public function get_continent_qsos()
return;
}

$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));

try {
// Get all DXCC entities for this continent with their status in a single query
Expand All @@ -1881,7 +1881,7 @@ public function get_continent_qsos()
END as status
FROM dxcc_entities d
LEFT JOIN " . $this->config->item('table_name') . " c ON d.adif = c.col_dxcc AND c.station_id IN (" . $location_list . ")
WHERE d.cont = '" . $this->db->escape_like_str($continent_code) . "'
WHERE d.cont = '" . $this->db->escape_str($continent_code) . "'
GROUP BY d.adif, d.name, d.prefix, d.cont
ORDER BY d.name ASC
");
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Contesting.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function edit($id) {
$this->load->model('Contesting_model');
$this->load->library('form_validation');

$item_id_clean = $this->security->xss_clean($id);
$item_id_clean = (int) $id;

$data['contest'] = $this->Contesting_model->contest($item_id_clean);

Expand Down
10 changes: 5 additions & 5 deletions application/controllers/Labels.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function printids() {
}

public function print($station_id) {
$clean_id = xss_clean($station_id);
$clean_id = (int) $station_id;
$offset = xss_clean($this->input->post('startat'));
$grid = xss_clean($this->input->post('grid') ?? 0);
$via = xss_clean($this->input->post('via') ?? 0);
Expand Down Expand Up @@ -397,7 +397,7 @@ function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso,$orie
public function edit($id) {
$this->load->model('labels_model');

$cleanid = $this->security->xss_clean($id);
$cleanid = (int) $id;

$data['label'] = $this->labels_model->getLabel($cleanid,$this->session->userdata('user_id'));

Expand Down Expand Up @@ -425,7 +425,7 @@ public function delete($id) {
}

public function saveDefaultLabel() {
$id = $this->input->post('id');
$id = (int) $this->input->post('id');
$this->load->model('labels_model');
$this->labels_model->saveDefaultLabel($id);
}
Expand All @@ -438,7 +438,7 @@ public function startAtLabel() {
public function editPaper($id) {
$this->load->model('labels_model');

$cleanid = $this->security->xss_clean($id);
$cleanid = (int) $id;

$data['paper'] = $this->labels_model->getPaper($cleanid);

Expand All @@ -455,7 +455,7 @@ public function updatePaper($id) {
$this->labels_model->updatePaper($id);
} catch (\Throwable $th) {
$this->session->set_flashdata('error', 'Your paper could not be saved. Remember that it can\'t have the same name as existing paper types.');
$cleanid = $this->security->xss_clean($id);
$cleanid = (int) $id;
redirect('labels/editpaper/'.$cleanid);
}
$this->session->set_flashdata('message', 'Paper was saved.');
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function search() {
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));

$location_list = "'".implode("','",$logbooks_locations_array)."'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));

$this->load->model('lookup_model');
$this->load->model('bands');
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Oqrs.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function requests() {
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));

if ($logbooks_locations_array) {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));
} else {
$location_list = null;
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function edit($id)

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

$item_id_clean = $this->security->xss_clean($id);
$item_id_clean = (int) $id;

$data['theme'] = $this->Themes_model->theme($item_id_clean);

Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public function satellites()
$data['page_title'] = "Public Gridsquare Map";

// Get available bands for this logbook
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));

// Get bands (excluding satellites)
$bands_query = $this->db->query(
Expand Down
30 changes: 30 additions & 0 deletions application/migrations/272_tag_2_8_15.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

/*
* Tag Cloudlog as 2.8.15 Migration
*/

class Migration_tag_2_8_15 extends CI_Migration {

public function up()
{

// Tag Cloudlog 2.8.15
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.8.15'));

// Trigger Version Info Dialog
$this->db->where('option_type', 'version_dialog');
$this->db->where('option_name', 'confirmed');
$this->db->update('user_options', array('option_value' => 'false'));

}

public function down()
{
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.8.14'));
}
}
5 changes: 4 additions & 1 deletion application/models/Accumulate_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ function get_accumulated_data($band, $award, $mode, $period) {
return array();
}

$location_list = "'".implode("','",$logbooks_locations_array)."'";
$location_ids = array_map('intval', $logbooks_locations_array);
$location_list = implode(',', $location_ids);
$band = $this->db->escape_str($band);
$mode = $this->db->escape_str($mode);

switch ($award) {
case 'dxcc': $result = $this->get_accumulated_dxcc($band, $mode, $period, $location_list); break;
Expand Down
22 changes: 17 additions & 5 deletions application/models/Activated_gridmap_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat) {
return null;
}

$location_list = "'".implode("','",$logbooks_locations_array)."'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));
$band = $this->db->escape_str($band);
$mode = $this->db->escape_str($mode);
$sat = $this->db->escape_str($sat);

$sql = 'SELECT DISTINCT station_gridsquare AS GRID_SQUARES, COL_BAND FROM '
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
Expand Down Expand Up @@ -48,7 +51,10 @@ function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat) {
return null;
}

$location_list = "'".implode("','",$logbooks_locations_array)."'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));
$band = $this->db->escape_str($band);
$mode = $this->db->escape_str($mode);
$sat = $this->db->escape_str($sat);

$sql = 'SELECT DISTINCT station_gridsquare AS GRID_SQUARES, COL_BAND FROM '
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
Expand Down Expand Up @@ -84,7 +90,10 @@ function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $s
return null;
}

$location_list = "'".implode("','",$logbooks_locations_array)."'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));
$band = $this->db->escape_str($band);
$mode = $this->db->escape_str($mode);
$sat = $this->db->escape_str($sat);

$sql = 'SELECT distinct COL_VUCC_GRIDS, COL_BAND FROM '
.$this->config->item('table_name')
Expand Down Expand Up @@ -121,7 +130,10 @@ function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz,
return null;
}

$location_list = "'".implode("','",$logbooks_locations_array)."'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));
$band = $this->db->escape_str($band);
$mode = $this->db->escape_str($mode);
$sat = $this->db->escape_str($sat);

$sql = 'SELECT distinct COL_VUCC_GRIDS, COL_BAND FROM '
.$this->config->item('table_name')
Expand Down Expand Up @@ -188,7 +200,7 @@ function get_worked_modes() {
return null;
}

$location_list = "'".implode("','",$logbooks_locations_array)."'";
$location_list = implode(',', array_map('intval', $logbooks_locations_array));

// get all worked modes from database
$data = $this->db->query(
Expand Down
Loading
Loading