From aed402245edf69dd14aecbac4a7a74b62cd7ad9d Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 6 Jun 2023 10:55:05 +0200 Subject: [PATCH 1/6] #11461 Add warning about php and mysql versions --- pandora_console/index.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pandora_console/index.php b/pandora_console/index.php index aaf960eb91..200ea7572c 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1165,6 +1165,26 @@ if ((bool) ($config['maintenance_mode'] ?? false) === true exit(''); } +if (empty($_GET['sec']) === true) { + // PHP Version. + if (version_compare('8.1', PHP_VERSION) >= 0) { + ui_print_warning_message( + __( + 'You should update your PHP version because it will be out of official support.' + ).'
'.__('Current PHP version: ').PHP_VERSION + ); + } + + // MYSQL Version. + $mysql_version = explode(' ', mysqli_get_client_info())[1]; + if (version_compare('8.0', $mysql_version) >= 0) { + ui_print_warning_message( + __( + 'You should update your MYSQL version because it will be out of official support.' + ).'
'.__('Current MYSQL version: ').$mysql_version + ); + } +} // Pure. if ($config['pure'] == 0) { From d6f296553f2e38b409a4bfa6a52bb95475dd17a1 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 6 Jun 2023 12:03:18 +0200 Subject: [PATCH 2/6] #11461 Add warning about php and mysql versions --- .../include/class/ConsoleSupervisor.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 4dc665fb26..feb1a17d1d 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -278,6 +278,12 @@ class ConsoleSupervisor if ((bool) enterprise_installed() === true) { $this->checkLibaryError(); } + + /* + * Check MYSQL Support Version + */ + + $this->checkMYSQLSettings(); } @@ -560,6 +566,12 @@ class ConsoleSupervisor $this->checkLibaryError(); } + /* + * Check MYSQL Support Version + * + */ + $this->checkMYSQLSettings(); + } @@ -1790,6 +1802,45 @@ class ConsoleSupervisor $this->cleanNotifications('NOTIF.PHP.SERIALIZE_PRECISION'); } + if (version_compare('8.1', PHP_VERSION) >= 0) { + $url = 'https://www.php.net/supported-versions.php'; + $this->notify( + [ + 'type' => 'NOTIF.PHP.VERSION', + 'title' => __('PHP UPDATE REQUIRED'), + 'message' => __('You should update your PHP version because it will be out of official support').'
'.__('Current PHP version: ').PHP_VERSION, + 'url' => $url, + ] + ); + } else { + $this->cleanNotifications('NOTIF.PHP.VERSION'); + } + } + + + /** + * Checks if MYSQL version is supported. + * + * @return void + */ + public function checkMYSQLSettings() + { + global $config; + + $mysql_version = $config['dbconnection']->server_info; + if (version_compare('8.0', $mysql_version) <= 0) { + $url = 'https://www.mysql.com/support/eol-notice.html'; + $this->notify( + [ + 'type' => 'NOTIF.MYSQL.VERSION', + 'title' => __('MYSQL UPDATE REQUIRED'), + 'message' => __('You should update your MYSQL version because it will be out of official support').'
'.__('Current MYSQL version: ').$mysql_version, + 'url' => $url, + ] + ); + } else { + $this->cleanNotifications('NOTIF.PHP.VERSION'); + } } From 764d96fcc673c1df28a8b2f2d4c49b9fe20f0c18 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 6 Jun 2023 12:03:59 +0200 Subject: [PATCH 3/6] #11461 Delete index warnings --- pandora_console/index.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/pandora_console/index.php b/pandora_console/index.php index 200ea7572c..43927ae948 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1165,27 +1165,6 @@ if ((bool) ($config['maintenance_mode'] ?? false) === true exit(''); } -if (empty($_GET['sec']) === true) { - // PHP Version. - if (version_compare('8.1', PHP_VERSION) >= 0) { - ui_print_warning_message( - __( - 'You should update your PHP version because it will be out of official support.' - ).'
'.__('Current PHP version: ').PHP_VERSION - ); - } - - // MYSQL Version. - $mysql_version = explode(' ', mysqli_get_client_info())[1]; - if (version_compare('8.0', $mysql_version) >= 0) { - ui_print_warning_message( - __( - 'You should update your MYSQL version because it will be out of official support.' - ).'
'.__('Current MYSQL version: ').$mysql_version - ); - } -} - // Pure. if ($config['pure'] == 0) { // Menu container prepared to autohide menu. From 4aabb5d66909483ad01e397c08d58e55e2500dbd Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 6 Jun 2023 12:04:55 +0200 Subject: [PATCH 4/6] #11461 Fix index --- pandora_console/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/index.php b/pandora_console/index.php index 43927ae948..aaf960eb91 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1165,6 +1165,7 @@ if ((bool) ($config['maintenance_mode'] ?? false) === true exit(''); } + // Pure. if ($config['pure'] == 0) { // Menu container prepared to autohide menu. From 88d64a0e09dc994e8335975371d2d1c6c73eb85a Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Tue, 6 Jun 2023 12:06:27 +0200 Subject: [PATCH 5/6] #11461 Fix notify --- pandora_console/include/class/ConsoleSupervisor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index feb1a17d1d..5f354b6683 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -872,6 +872,7 @@ class ConsoleSupervisor case 'NOTIF.CRON.CONFIGURED': case 'NOTIF.ALLOWOVERRIDE.MESSAGE': case 'NOTIF.HAMASTER.MESSAGE': + case 'NOTIF.MYSQL.VERSION': default: // NOTIF.SERVER.STATUS. @@ -1839,7 +1840,7 @@ class ConsoleSupervisor ] ); } else { - $this->cleanNotifications('NOTIF.PHP.VERSION'); + $this->cleanNotifications('NOTIF.MYSQL.VERSION'); } } From 19e5529c184e66036a2ec7429ce4040b8f7d015e Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Mon, 26 Jun 2023 08:42:49 +0200 Subject: [PATCH 6/6] #11461 Fix mysql compare version --- pandora_console/include/class/ConsoleSupervisor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 5f354b6683..c4e8316ecb 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -1829,7 +1829,7 @@ class ConsoleSupervisor global $config; $mysql_version = $config['dbconnection']->server_info; - if (version_compare('8.0', $mysql_version) <= 0) { + if (version_compare('8.0', $mysql_version) >= 0) { $url = 'https://www.mysql.com/support/eol-notice.html'; $this->notify( [