Skip to content

Commit 2607b77

Browse files
authored
tag 2.6.9
2 parents d2bb80f + 7303206 commit 2607b77

File tree

21 files changed

+55435
-39737
lines changed

21 files changed

+55435
-39737
lines changed

application/config/migration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
|
2323
*/
2424

25-
$config['migration_version'] = 176;
25+
$config['migration_version'] = 178;
2626

2727
/*
2828
|--------------------------------------------------------------------------

application/controllers/User.php

+86
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,61 @@ function add() {
5959
$data['timezones'] = $this->user_model->timezones();
6060
$data['language'] = 'english';
6161

62+
// Set defaults
63+
$data['dashboard_upcoming_dx_card'] = false;
64+
$data['dashboard_qslcard_card'] = false;
65+
$data['dashboard_eqslcard_card'] = false;
66+
$data['dashboard_lotw_card'] = false;
67+
$data['dashboard_vuccgrids_card'] = false;
68+
69+
$dashboard_options = $this->user_options_model->get_options('dashboard')->result();
70+
71+
foreach ($dashboard_options as $item) {
72+
$option_name = $item->option_name;
73+
$option_key = $item->option_key;
74+
$option_value = $item->option_value;
75+
76+
if ($option_name == 'dashboard_upcoming_dx_card' && $option_key == 'enabled') {
77+
if($item->option_value == 'true') {
78+
$data['dashboard_upcoming_dx_card'] = true;
79+
} else {
80+
$data['dashboard_upcoming_dx_card'] = false;
81+
}
82+
}
83+
84+
if ($option_name == 'dashboard_qslcards_card' && $option_key == 'enabled') {
85+
if($item->option_value == 'true') {
86+
$data['dashboard_qslcard_card'] = true;
87+
} else {
88+
$data['dashboard_qslcard_card'] = false;
89+
}
90+
}
91+
92+
if ($option_name == 'dashboard_eqslcards_card' && $option_key == 'enabled') {
93+
if($item->option_value == 'true') {
94+
$data['dashboard_eqslcard_card'] = true;
95+
} else {
96+
$data['dashboard_eqslcard_card'] = false;
97+
}
98+
}
99+
100+
if ($option_name == 'dashboard_lotw_card' && $option_key == 'enabled') {
101+
if($item->option_value == 'true') {
102+
$data['dashboard_lotw_card'] = true;
103+
} else {
104+
$data['dashboard_lotw_card'] = false;
105+
}
106+
}
107+
108+
if ($option_name == 'dashboard_vuccgrids_card' && $option_key == 'enabled') {
109+
if($item->option_value == 'true') {
110+
$data['dashboard_vuccgrids_card'] = true;
111+
} else {
112+
$data['dashboard_vuccgrids_card'] = false;
113+
}
114+
}
115+
}
116+
62117
if ($this->form_validation->run() == FALSE) {
63118
$data['page_title'] = "Add User";
64119
$data['measurement_base'] = $this->config->item('measurement_base');
@@ -757,6 +812,37 @@ function profile() {
757812
$this->load->view('interface_assets/footer');
758813
}
759814

815+
816+
/**
817+
* Deletes a user by their ID.
818+
*
819+
* This function first loads the 'user_model'. It then checks if the current user has the authorization level of 99.
820+
* If not, it sets a flash message and redirects the user to the dashboard.
821+
*
822+
* If the user is authorized, it gets the user to be deleted by their ID from the URI segment 3.
823+
* It then calls the 'delete' function from the 'user_model' with the user ID as a parameter.
824+
*
825+
* If the 'delete' function executes successfully, it sets the HTTP status code to 200.
826+
* If the 'delete' function fails, it sets the HTTP status code to 500.
827+
*
828+
* @param int $id The ID of the user to delete.
829+
*/
830+
function delete_new($id) {
831+
$this->load->model('user_model');
832+
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
833+
$query = $this->user_model->get_by_id($this->uri->segment(3));
834+
835+
// call $this->user_model->delete and if no errors return true
836+
if ($this->user_model->delete($id)) {
837+
// request responds with a 200 status code and empty content
838+
$this->output->set_status_header(200);
839+
} else {
840+
// request responds with a 500 status code and empty content
841+
$this->output->set_status_header(500);
842+
}
843+
844+
}
845+
760846
function delete() {
761847
$this->load->model('user_model');
762848
if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }

application/controllers/Visitor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function index($public_slug = NULL)
8282
$config['base_url'] = base_url().'index.php/visitor/'. $public_slug . '/index';
8383
$config['total_rows'] = $this->logbook_model->total_qsos($logbooks_locations_array);
8484
$config['per_page'] = '25';
85-
$config['num_links'] = $this->logbook_model->total_qsos($logbooks_locations_array) / 25;
85+
$config['num_links'] = 6;
8686
$config['full_tag_open'] = '<ul class="pagination">';
8787
$config['full_tag_close'] = '</ul>';
8888
$config['attributes'] = ['class' => 'page-link'];

application/controllers/Workabledxcc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function index()
3030
public function dxcclist()
3131
{
3232

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

3535
// Decode the JSON data into a PHP array
3636
$dataResult = json_decode($json, true);

application/helpers/storage_helper.php

+17-13
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,26 @@
22

33
if (!function_exists('folderSize')) {
44
function folderSize($dir){
5-
$count_size = 0;
6-
$count = 0;
7-
$dir_array = scandir($dir);
8-
foreach($dir_array as $key=>$filename){
9-
if($filename!=".." && $filename!="."){
10-
if(is_dir($dir."/".$filename)){
11-
$new_foldersize = folderSize($dir."/".$filename);
12-
$count_size = $count_size+ $new_foldersize;
13-
}else if(is_file($dir."/".$filename)){
14-
$count_size = $count_size + filesize($dir."/".$filename);
15-
$count++;
5+
if (is_dir($dir)) {
6+
$count_size = 0;
7+
$count = 0;
8+
$dir_array = scandir($dir);
9+
foreach($dir_array as $key=>$filename){
10+
if($filename!=".." && $filename!="."){
11+
if(is_dir($dir."/".$filename)){
12+
$new_foldersize = folderSize($dir."/".$filename);
13+
$count_size = $count_size+ $new_foldersize;
14+
}else if(is_file($dir."/".$filename)){
15+
$count_size = $count_size + filesize($dir."/".$filename);
16+
$count++;
17+
}
1618
}
1719
}
20+
return $count_size;
21+
} else {
22+
return 0;
1823
}
19-
return $count_size;
20-
}
24+
}
2125
}
2226

2327
if (!function_exists('sizeFormat')) {

application/language/german/general_words_lang.php

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
$lang['general_word_qslcard'] = 'QSL Karte';
7575
$lang['general_word_qslcard_management'] = 'QSL Verwaltung';
7676
$lang['general_word_qslcards'] = 'QSL Karten';
77+
$lang['general_word_sstv_management'] = 'SSTV Management';
78+
$lang['general_word_sstvimages'] = 'SSTV Bilder';
79+
$lang['general_sstv_upload'] = 'Hochgeladene SSTV Bilder';
80+
$lang['general_sstv_upload_button'] = 'Lade SSTV Bild(er) hoch';
7781
$lang['general_word_qslcard_direct'] = 'Direkt';
7882
$lang['general_word_qslcard_bureau'] = 'Büro';
7983
$lang['general_word_qslcard_electronic'] = 'Elektronisch';

application/language/german/menu_lang.php

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
$lang['menu_bandmap'] = 'Bandmap';
1818
$lang['menu_view_qsl'] = 'QSL Ansicht';
1919
$lang['menu_view_eqsl'] = 'eQSL Ansicht';
20+
$lang['menu_view_sstv'] = 'SSTV Bilder';
2021

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

application/language/german/sstv_lang.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

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

5-
$lang['sstv_string_disk_space'] = 'of disk space to store SSTV image assets';
5+
$lang['sstv_string_disk_space'] = 'an Speicherplatz, um SSTV-Bilder zu speichern';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
defined('BASEPATH') OR exit('No direct script access allowed');
4+
5+
/*
6+
* This migration adds a dxped_url-key to the options table, to configure
7+
* the endpoint, from where the dxpedition-data is being loaded.
8+
*/
9+
10+
class Migration_add_dxped_url_option extends CI_Migration {
11+
12+
public function up()
13+
{
14+
$data = array(
15+
array('option_name' => "dxped_url", 'option_value' => "https://cdn.cloudlog.org/read_ng3k_dxped_list.php", 'autoload' => "yes"),
16+
);
17+
18+
$this->db->insert_batch('options', $data);
19+
}
20+
21+
public function down()
22+
{
23+
// No option to down
24+
}
25+
}
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
defined('BASEPATH') OR exit('No direct script access allowed');
4+
5+
/*
6+
* Tag Cloudlog as 2.6.9
7+
*/
8+
9+
class Migration_tag_2_6_9 extends CI_Migration {
10+
11+
public function up()
12+
{
13+
14+
// Tag Cloudlog 2.6.3
15+
$this->db->where('option_name', 'version');
16+
$this->db->update('options', array('option_value' => '2.6.9'));
17+
18+
// Trigger Version Info Dialog
19+
$this->db->where('option_type', 'version_dialog');
20+
$this->db->where('option_name', 'confirmed');
21+
$this->db->update('user_options', array('option_value' => 'false'));
22+
23+
}
24+
25+
public function down()
26+
{
27+
$this->db->where('option_name', 'version');
28+
$this->db->update('options', array('option_value' => '2.6.8'));
29+
}
30+
}

application/models/User_model.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ function add($username, $password, $email, $type, $firstname, $lastname, $callsi
185185
'user_qso_end_times' => xss_clean($user_qso_end_times),
186186
'user_quicklog' => xss_clean($user_quicklog),
187187
'user_quicklog_enter' => xss_clean($user_quicklog_enter),
188-
'language' => xss_clean($language)
188+
'language' => xss_clean($language),
189+
'user_eqsl_qth_nickname' => "",
189190
);
190191

191192
// Check the password is valid

application/models/Workabledxcc_model.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Workabledxcc_model extends CI_Model
55

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

1010
// Step 2: Convert the JSON data to an array.
1111
$data = json_decode($json, true);

application/views/interface_assets/footer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/eqslcharcounter.js"></script>
4848
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/version_dialog.js"></script>
4949

50-
<script src="https://unpkg.com/htmx.org@1.6.1"></script>
50+
<script src="<?php echo base_url(); ?>assets/js/htmx.min.js"></script>
5151

5252
<script>
5353
// Reinitialize tooltips after new content has been loaded

application/views/map/custom_date.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@
9494
</div>
9595

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

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

0 commit comments

Comments
 (0)