Skip to content

Commit

Permalink
tag 2.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
magicbug authored Apr 14, 2024
2 parents d2bb80f + 7303206 commit 2607b77
Show file tree
Hide file tree
Showing 21 changed files with 55,435 additions and 39,737 deletions.
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'] = 176;
$config['migration_version'] = 178;

/*
|--------------------------------------------------------------------------
Expand Down
86 changes: 86 additions & 0 deletions application/controllers/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,61 @@ function add() {
$data['timezones'] = $this->user_model->timezones();
$data['language'] = 'english';

// Set defaults
$data['dashboard_upcoming_dx_card'] = false;
$data['dashboard_qslcard_card'] = false;
$data['dashboard_eqslcard_card'] = false;
$data['dashboard_lotw_card'] = false;
$data['dashboard_vuccgrids_card'] = false;

$dashboard_options = $this->user_options_model->get_options('dashboard')->result();

foreach ($dashboard_options as $item) {
$option_name = $item->option_name;
$option_key = $item->option_key;
$option_value = $item->option_value;

if ($option_name == 'dashboard_upcoming_dx_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_upcoming_dx_card'] = true;
} else {
$data['dashboard_upcoming_dx_card'] = false;
}
}

if ($option_name == 'dashboard_qslcards_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_qslcard_card'] = true;
} else {
$data['dashboard_qslcard_card'] = false;
}
}

if ($option_name == 'dashboard_eqslcards_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_eqslcard_card'] = true;
} else {
$data['dashboard_eqslcard_card'] = false;
}
}

if ($option_name == 'dashboard_lotw_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_lotw_card'] = true;
} else {
$data['dashboard_lotw_card'] = false;
}
}

if ($option_name == 'dashboard_vuccgrids_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_vuccgrids_card'] = true;
} else {
$data['dashboard_vuccgrids_card'] = false;
}
}
}

if ($this->form_validation->run() == FALSE) {
$data['page_title'] = "Add User";
$data['measurement_base'] = $this->config->item('measurement_base');
Expand Down Expand Up @@ -757,6 +812,37 @@ function profile() {
$this->load->view('interface_assets/footer');
}


/**
* Deletes a user by their ID.
*
* This function first loads the 'user_model'. It then checks if the current user has the authorization level of 99.
* If not, it sets a flash message and redirects the user to the dashboard.
*
* If the user is authorized, it gets the user to be deleted by their ID from the URI segment 3.
* It then calls the 'delete' function from the 'user_model' with the user ID as a parameter.
*
* If the 'delete' function executes successfully, it sets the HTTP status code to 200.
* If the 'delete' function fails, it sets the HTTP status code to 500.
*
* @param int $id The ID of the user to delete.
*/
function delete_new($id) {
$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'); }
$query = $this->user_model->get_by_id($this->uri->segment(3));

// call $this->user_model->delete and if no errors return true
if ($this->user_model->delete($id)) {
// request responds with a 200 status code and empty content
$this->output->set_status_header(200);
} else {
// request responds with a 500 status code and empty content
$this->output->set_status_header(500);
}

}

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'); }
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function index($public_slug = NULL)
$config['base_url'] = base_url().'index.php/visitor/'. $public_slug . '/index';
$config['total_rows'] = $this->logbook_model->total_qsos($logbooks_locations_array);
$config['per_page'] = '25';
$config['num_links'] = $this->logbook_model->total_qsos($logbooks_locations_array) / 25;
$config['num_links'] = 6;
$config['full_tag_open'] = '<ul class="pagination">';
$config['full_tag_close'] = '</ul>';
$config['attributes'] = ['class' => 'page-link'];
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Workabledxcc.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function index()
public function dxcclist()
{

$json = file_get_contents('https://cdn.cloudlog.org/read_ng3k_dxped_list.php');
$json = file_get_contents($this->optionslib->get_option('dxped_url'));

// Decode the JSON data into a PHP array
$dataResult = json_decode($json, true);
Expand Down
30 changes: 17 additions & 13 deletions application/helpers/storage_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@

if (!function_exists('folderSize')) {
function folderSize($dir){
$count_size = 0;
$count = 0;
$dir_array = scandir($dir);
foreach($dir_array as $key=>$filename){
if($filename!=".." && $filename!="."){
if(is_dir($dir."/".$filename)){
$new_foldersize = folderSize($dir."/".$filename);
$count_size = $count_size+ $new_foldersize;
}else if(is_file($dir."/".$filename)){
$count_size = $count_size + filesize($dir."/".$filename);
$count++;
if (is_dir($dir)) {
$count_size = 0;
$count = 0;
$dir_array = scandir($dir);
foreach($dir_array as $key=>$filename){
if($filename!=".." && $filename!="."){
if(is_dir($dir."/".$filename)){
$new_foldersize = folderSize($dir."/".$filename);
$count_size = $count_size+ $new_foldersize;
}else if(is_file($dir."/".$filename)){
$count_size = $count_size + filesize($dir."/".$filename);
$count++;
}
}
}
return $count_size;
} else {
return 0;
}
return $count_size;
}
}
}

if (!function_exists('sizeFormat')) {
Expand Down
4 changes: 4 additions & 0 deletions application/language/german/general_words_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
$lang['general_word_qslcard'] = 'QSL Karte';
$lang['general_word_qslcard_management'] = 'QSL Verwaltung';
$lang['general_word_qslcards'] = 'QSL Karten';
$lang['general_word_sstv_management'] = 'SSTV Management';
$lang['general_word_sstvimages'] = 'SSTV Bilder';
$lang['general_sstv_upload'] = 'Hochgeladene SSTV Bilder';
$lang['general_sstv_upload_button'] = 'Lade SSTV Bild(er) hoch';
$lang['general_word_qslcard_direct'] = 'Direkt';
$lang['general_word_qslcard_bureau'] = 'Büro';
$lang['general_word_qslcard_electronic'] = 'Elektronisch';
Expand Down
1 change: 1 addition & 0 deletions application/language/german/menu_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$lang['menu_bandmap'] = 'Bandmap';
$lang['menu_view_qsl'] = 'QSL Ansicht';
$lang['menu_view_eqsl'] = 'eQSL Ansicht';
$lang['menu_view_sstv'] = 'SSTV Bilder';

$lang['menu_notes'] = 'Notizen';

Expand Down
2 changes: 1 addition & 1 deletion application/language/german/sstv_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

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

$lang['sstv_string_disk_space'] = 'of disk space to store SSTV image assets';
$lang['sstv_string_disk_space'] = 'an Speicherplatz, um SSTV-Bilder zu speichern';
25 changes: 25 additions & 0 deletions application/migrations/177_add_dxped_url_option.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

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

/*
* This migration adds a dxped_url-key to the options table, to configure
* the endpoint, from where the dxpedition-data is being loaded.
*/

class Migration_add_dxped_url_option extends CI_Migration {

public function up()
{
$data = array(
array('option_name' => "dxped_url", 'option_value' => "https://cdn.cloudlog.org/read_ng3k_dxped_list.php", 'autoload' => "yes"),
);

$this->db->insert_batch('options', $data);
}

public function down()
{
// No option to down
}
}
30 changes: 30 additions & 0 deletions application/migrations/178_tag_2_6_9.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.6.9
*/

class Migration_tag_2_6_9 extends CI_Migration {

public function up()
{

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

// 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.6.8'));
}
}
3 changes: 2 additions & 1 deletion application/models/User_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ function add($username, $password, $email, $type, $firstname, $lastname, $callsi
'user_qso_end_times' => xss_clean($user_qso_end_times),
'user_quicklog' => xss_clean($user_quicklog),
'user_quicklog_enter' => xss_clean($user_quicklog_enter),
'language' => xss_clean($language)
'language' => xss_clean($language),
'user_eqsl_qth_nickname' => "",
);

// Check the password is valid
Expand Down
2 changes: 1 addition & 1 deletion application/models/Workabledxcc_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Workabledxcc_model extends CI_Model

public function GetThisWeek()
{
$json = file_get_contents('https://cdn.cloudlog.org/read_ng3k_dxped_list.php');
$json = file_get_contents($this->optionslib->get_option('dxped_url'));

// Step 2: Convert the JSON data to an array.
$data = json_decode($json, true);
Expand Down
2 changes: 1 addition & 1 deletion application/views/interface_assets/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/eqslcharcounter.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/version_dialog.js"></script>

<script src="https://unpkg.com/htmx.[email protected]"></script>
<script src="<?php echo base_url(); ?>assets/js/htmx.min.js"></script>

<script>
// Reinitialize tooltips after new content has been loaded
Expand Down
2 changes: 1 addition & 1 deletion application/views/map/custom_date.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@
</div>

<!-- Map -->
<div id="custommap" class="map-leaflet mt-2" style="width: 100%; height: calc(100vh - 390px); max-height: 900px;"></div>
<div id="custommap" class="map-leaflet mt-2" style="width: 100%; height: 1000px;"></div>

<div class="alert alert-success" role="alert">Showing QSOs for Custom Date for Active Logbook <?php echo $logbook_name ?></div>
Loading

0 comments on commit 2607b77

Please sign in to comment.