diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php
index 397f4f456..2d126c301 100644
--- a/application/controllers/Debug.php
+++ b/application/controllers/Debug.php
@@ -28,8 +28,8 @@ class Debug extends CI_Controller
$footerData['scripts'] = ['assets/js/sections/debug.js'];
$data['running_version'] = $this->optionslib->get_option('version');
- $data['latest_release'] = $this->Update_model->wavelog_latest_release();
- if (version_compare($data['latest_release'], $data['running_version'], '>')) {
+ $data['latest_release'] = $this->optionslib->get_option('latest_release');
+ if ($data['latest_release'] && version_compare($data['latest_release'], $data['running_version'], '>')) {
$data['newer_version_available'] = true;
} else {
$data['newer_version_available'] = false;
diff --git a/application/controllers/Update.php b/application/controllers/Update.php
index 3cd5d4180..9de022838 100644
--- a/application/controllers/Update.php
+++ b/application/controllers/Update.php
@@ -427,5 +427,16 @@ class Update extends CI_Controller {
$this->optionslib->update('tle_update', $datetime , 'no');
}
+ function wavelog_update_check() {
+ if ($this->config->item('version_check')) {
+ $this->load->model('Update_model');
+ $running_version = $this->optionslib->get_option('version');
+ $latest_release = $this->Update_model->wavelog_latest_release();
+ if (version_compare($latest_release, $running_version, '>')) {
+ print __("Newer release available:")." ".$latest_release;
+ $this->Update_model->set_latest_release($latest_release);
+ }
+ }
+ }
}
?>
diff --git a/application/models/Update_model.php b/application/models/Update_model.php
index d1d45bfc7..d07180ae5 100644
--- a/application/models/Update_model.php
+++ b/application/models/Update_model.php
@@ -274,4 +274,19 @@ class Update_model extends CI_Model {
$latest_tag = $json[0]['tag_name'];
return $latest_tag;
}
+
+ function set_latest_release($release) {
+ $this->db->select('option_value');
+ $this->db->where('option_name', 'latest_release');
+ $query = $this->db->get('options');
+ if ($query->num_rows() > 0) {
+ $this->db->where('option_name', 'latest_release');
+ $this->db->update('options', array('option_value' => $release));
+ } else {
+ $data = array(
+ array('option_name' => "latest_release", 'option_value' => $release, 'autoload' => "yes"),
+ );
+ $this->db->insert_batch('options', $data);
+ }
+ }
}
diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php
index 4d3e130ca..2510cb254 100644
--- a/application/views/dashboard/index.php
+++ b/application/views/dashboard/index.php
@@ -58,6 +58,13 @@ function echo_table_col($row, $name) {
= __("You need to upgrade your PHP version. Minimum version is 7.4. Your version is") . ' ' . PHP_VERSION . '.';?>
+ session->userdata('user_type') == 99) && $this->config->item('version_check') && $this->optionslib->get_option('latest_release')) { ?>
+ optionslib->get_option('latest_release'), $this->optionslib->get_option('version'), '>')) { ?>
+
+
+
diff --git a/application/views/debug/index.php b/application/views/debug/index.php
index bc7558e6b..7077382e4 100644
--- a/application/views/debug/index.php
+++ b/application/views/debug/index.php
@@ -25,7 +25,11 @@
| = __("Version"); ?> |
- |
+
+
+ = __("Latest Version"); ?>
+
+ |
diff --git a/install/config/config.php b/install/config/config.php
index 246484332..1d55f90dd 100644
--- a/install/config/config.php
+++ b/install/config/config.php
@@ -25,11 +25,11 @@ $config['datadir'] = null; // default to install directory
|
| 'table_name' SQL table where log can be found
| 'locator' Default locator used to calculate bearings/distance
-| 'display_freq' Show or Hide frequnecy info
+| 'display_freq' Show or Hide frequnecy info
*/
-$config['table_name'] = 'TABLE_HRD_CONTACTS_V01';
-$config['locator'] = '%baselocator%';
+$config['table_name'] = 'TABLE_HRD_CONTACTS_V01';
+$config['locator'] = '%baselocator%';
$config['display_freq'] = true;
/*
@@ -64,7 +64,7 @@ $config['hamqth_password'] = '%hamqth_password%';
|
| 'use_auth' False turns all authentication off, best used when setting up
| 'auth_table' MySQL Database Table defaults "users"
-| 'auth_mode' Minimum user level required 0 = anonymous, 1 = viewer,
+| 'auth_mode' Minimum user level required 0 = anonymous, 1 = viewer,
| 2 = editor, 3 = api user, 99 = owner
| 'auth_level[]' Defines level titles
*/
@@ -631,7 +631,7 @@ $config['disable_manual_qrz'] = false;
| Disables QSL-Image-Feature
|--------------------------------------------------------------------------
|
-| This disabled the whole QSL image feature if you don't need it and want to hide it.
+| This disabled the whole QSL image feature if you don't need it and want to hide it.
| Set to true will hide all QSL image related stuff in Wavelog
|
*/
@@ -643,7 +643,7 @@ $config['disable_qsl'] = false;
| Disables OQRS-Feature
|--------------------------------------------------------------------------
|
-| This disabled the whole OQRS feature if you don't need it and want to hide it.
+| This disabled the whole OQRS feature if you don't need it and want to hide it.
| Set to true will hide all OQRS related stuff in Wavelog
|
*/
@@ -658,18 +658,18 @@ $config['disable_oqrs'] = false;
| This config switch is meant to use for Special Callsign operations in a dedicated Wavelog Installation
| If this switch is set to true it will enable a dialog which pops up for each operator after login
| to ask for his personal callsign. This causes the QSOs to get saved with the correct operator data.
-| Example: Special Callsign: DL250CDF
+| Example: Special Callsign: DL250CDF
| Operator: DF2TG
-|
-| It is recommend to enable also "Disable Syncing to 3rd party-Services at UI"
-| More Information about this feature and how to use it, you can find here:
+|
+| It is recommend to enable also "Disable Syncing to 3rd party-Services at UI"
+| More Information about this feature and how to use it, you can find here:
| https://github.com/wavelog/wavelog/wiki/Recommended-Setup-for-Special-Callsigns-and-Clubs
*/
$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;
/*
@@ -679,10 +679,10 @@ $config['sc_hide_usermenu'] = true;
|
| 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;
+$config['disable_impersonate'] = false;
/*
@@ -692,7 +692,19 @@ $config['disable_impersonate'] = false;
|
| 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;
\ No newline at end of file
+$config['cron_allow_insecure'] = false;
+
+/*
+|--------------------------------------------------------------------------
+| Update / version check
+|--------------------------------------------------------------------------
+
+| This config switch enabled the check for newer releases on github and
+| displays a banner to admin users if a newer release as published.
+| Default on.
+ */
+
+$config['version_check'] = false;