fix customer listing for admins when deactivated customers exist; fix potential row-size too large error for panel_customers; fix possible undefined timestamps in opcache-info; set version to 2.0.1
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -155,6 +155,9 @@ if ($page == 'showinfo' && $userinfo['change_serversettings'] == '1') {
|
||||
if ($config['directives']['opcache.file_cache_only'] || !empty($status['file_cache_only'])) {
|
||||
$overview = false;
|
||||
} else {
|
||||
$status['opcache_statistics']['start_time'] = $status['opcache_statistics']['start_time'] ?? time();
|
||||
$status['opcache_statistics']['last_restart_time'] = $status['opcache_statistics']['last_restart_time'] ?? time();
|
||||
|
||||
$overview = array_merge(
|
||||
$status['memory_usage'],
|
||||
$status['opcache_statistics'],
|
||||
|
||||
@@ -176,7 +176,7 @@ CREATE TABLE `panel_customers` (
|
||||
`phone` varchar(50) NOT NULL default '',
|
||||
`fax` varchar(50) NOT NULL default '',
|
||||
`email` varchar(255) NOT NULL default '',
|
||||
`customernumber` varchar(255) NOT NULL default '',
|
||||
`customernumber` varchar(100) NOT NULL default '',
|
||||
`def_language` varchar(100) NOT NULL default '',
|
||||
`diskspace` bigint(30) NOT NULL default '0',
|
||||
`diskspace_used` bigint(30) NOT NULL default '0',
|
||||
@@ -217,12 +217,12 @@ CREATE TABLE `panel_customers` (
|
||||
`lepublickey` mediumtext default NULL,
|
||||
`leprivatekey` mediumtext default NULL,
|
||||
`leregistered` tinyint(1) NOT NULL default '0',
|
||||
`allowed_phpconfigs` varchar(500) NOT NULL default '',
|
||||
`allowed_phpconfigs` text NOT NULL default '',
|
||||
`type_2fa` tinyint(1) NOT NULL default '0',
|
||||
`data_2fa` varchar(25) NOT NULL default '',
|
||||
`api_allowed` tinyint(1) NOT NULL default '1',
|
||||
`logviewenabled` tinyint(1) NOT NULL default '0',
|
||||
`allowed_mysqlserver` varchar(500) NOT NULL default '[0]',
|
||||
`allowed_mysqlserver` text NOT NULL default '[0]',
|
||||
PRIMARY KEY (`customerid`),
|
||||
UNIQUE KEY `loginname` (`loginname`)
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
@@ -696,7 +696,7 @@ opcache.validate_timestamps'),
|
||||
('system', 'distribution', ''),
|
||||
('system', 'update_channel', 'stable'),
|
||||
('system', 'updatecheck_data', ''),
|
||||
('system', 'update_notify_last', '2.0.0'),
|
||||
('system', 'update_notify_last', '2.0.1'),
|
||||
('system', 'traffictool', 'goaccess'),
|
||||
('api', 'enabled', '0'),
|
||||
('2fa', 'enabled', '1'),
|
||||
@@ -740,7 +740,7 @@ opcache.validate_timestamps'),
|
||||
('panel', 'logo_overridetheme', '0'),
|
||||
('panel', 'logo_overridecustom', '0'),
|
||||
('panel', 'settings_mode', '0'),
|
||||
('panel', 'version', '2.0.0-beta1'),
|
||||
('panel', 'version', '2.0.1'),
|
||||
('panel', 'db_version', '202212060');
|
||||
|
||||
|
||||
|
||||
@@ -67,7 +67,10 @@ if (Froxlor::isFroxlorVersion('0.10.38.3')) {
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;";
|
||||
Database::query($sql);
|
||||
// new customer allowed_mysqlserver field
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `allowed_mysqlserver` varchar(500) NOT NULL default '[0]';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `allowed_mysqlserver` text NOT NULL default '[0]';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE COLUMN `allowed_phpconfigs` `allowed_phpconfigs` text NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE COLUMN `customernumber` `customernumber` varchar(100) NOT NULL default '';");
|
||||
$has_customer_table_update_200 = true;
|
||||
// ftp_users adjustments
|
||||
Database::query("ALTER TABLE `" . TABLE_FTP_USERS . "` CHANGE COLUMN `password` `password` varchar(255) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_FTP_QUOTALIMITS . "` CHANGE COLUMN `name` `name` varchar(255) default NULL;");
|
||||
@@ -207,6 +210,7 @@ if (Froxlor::isDatabaseVersion('202211030')) {
|
||||
$newCronBin = Froxlor::getInstallDir().'/bin/froxlor-cli';
|
||||
$compCron = <<<EOF
|
||||
<?php
|
||||
chmod($newCronBin, 0755);
|
||||
// re-create cron.d configuration file
|
||||
exec('$newCronBin froxlor:cron -r 99');
|
||||
exit;
|
||||
@@ -221,3 +225,18 @@ if (Froxlor::isFroxlorVersion('2.0.0-beta1')) {
|
||||
Update::showUpdateStep("Updating from 2.0.0-beta1 to 2.0.0", false);
|
||||
Froxlor::updateToVersion('2.0.0');
|
||||
}
|
||||
|
||||
if (Froxlor::isFroxlorVersion('2.0.0')) {
|
||||
Update::showUpdateStep("Updating from 2.0.0 to 2.0.1", false);
|
||||
|
||||
if (!isset($has_customer_table_update_200)) {
|
||||
Update::showUpdateStep("Creating new tables and fields");
|
||||
// new customer allowed_mysqlserver field
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE COLUMN `allowed_mysqlserver` `allowed_mysqlserver` text NOT NULL default '[0]';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE COLUMN `allowed_phpconfigs` `allowed_phpconfigs` text NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE COLUMN `customernumber` `customernumber` varchar(100) NOT NULL default '';");
|
||||
Update::lastStepStatus(0);
|
||||
}
|
||||
|
||||
Froxlor::updateToVersion('2.0.1');
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ final class Froxlor
|
||||
{
|
||||
|
||||
// Main version variable
|
||||
const VERSION = '2.0.0';
|
||||
const VERSION = '2.0.1';
|
||||
|
||||
// Database version (YYYYMMDDC where C is a daily counter)
|
||||
const DBVERSION = '202212060';
|
||||
|
||||
@@ -94,6 +94,7 @@ class ProgressBar
|
||||
{
|
||||
$skip_customer_traffic = false;
|
||||
try {
|
||||
$attributes['fields']['deactivated'] = 0;
|
||||
$result = Traffic::getCustomerStats($attributes['fields'], 'currentmonth');
|
||||
} catch (Exception $e) {
|
||||
if ($e->getCode() === 405) {
|
||||
|
||||
Reference in New Issue
Block a user