diff --git a/install/froxlor.sql b/install/froxlor.sql index b828e81d..54dade6a 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -705,7 +705,7 @@ opcache.interned_strings_buffer'), ('panel', 'customer_hide_options', ''), ('panel', 'is_configured', '0'), ('panel', 'version', '0.10.20'), - ('panel', 'db_version', '202007240'); + ('panel', 'db_version', '202009070'); DROP TABLE IF EXISTS `panel_tasks`; @@ -786,23 +786,6 @@ CREATE TABLE `panel_diskspace` ( -DROP TABLE IF EXISTS `panel_diskspace_admins`; -CREATE TABLE `panel_diskspace_admins` ( - `id` int(11) unsigned NOT NULL auto_increment, - `adminid` int(11) unsigned NOT NULL default '0', - `year` int(4) unsigned zerofill NOT NULL default '0000', - `month` int(2) unsigned zerofill NOT NULL default '00', - `day` int(2) unsigned zerofill NOT NULL default '00', - `stamp` int(11) unsigned NOT NULL default '0', - `webspace` bigint(30) unsigned NOT NULL default '0', - `mail` bigint(30) unsigned NOT NULL default '0', - `mysql` bigint(30) unsigned NOT NULL default '0', - PRIMARY KEY (`id`), - KEY `adminid` (`adminid`) -) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci; - - - DROP TABLE IF EXISTS `panel_languages`; CREATE TABLE `panel_languages` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index a8b8e307..6873dd58 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -668,3 +668,12 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.19')) { showUpdateStep("Updating from 0.10.19 to 0.10.20", false); \Froxlor\Froxlor::updateToVersion('0.10.20'); } + +if (\Froxlor\Froxlor::isDatabaseVersion('202007240')) { + + showUpdateStep("Removing old unused table", true); + Database::query("DROP TABLE IF EXISTS `panel_diskspace_admins`;"); + lastStepStatus(0); + + \Froxlor\Froxlor::updateToDbVersion('202009070'); +} diff --git a/lib/Froxlor/Api/Commands/Admins.php b/lib/Froxlor/Api/Commands/Admins.php index b833290c..6c1a653b 100644 --- a/lib/Froxlor/Api/Commands/Admins.php +++ b/lib/Froxlor/Api/Commands/Admins.php @@ -730,14 +730,6 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt 'adminid' => $id ), true, true); - // delete the diskspace usage - $del_stmt = Database::prepare(" - DELETE FROM `" . TABLE_PANEL_DISKSPACE_ADMINS . "` WHERE `adminid` = :adminid - "); - Database::pexecute($del_stmt, array( - 'adminid' => $id - ), true, true); - // set admin-id of the old admin's customer to current admins $upd_stmt = Database::prepare(" UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET diff --git a/lib/Froxlor/Cron/Traffic/TrafficCron.php b/lib/Froxlor/Cron/Traffic/TrafficCron.php index 0a07099b..be5b0d57 100644 --- a/lib/Froxlor/Cron/Traffic/TrafficCron.php +++ b/lib/Froxlor/Cron/Traffic/TrafficCron.php @@ -570,29 +570,6 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron } if (isset($admin_diskspace[$row['adminid']])) { - - $ins_data = array( - 'adminid' => $row['adminid'], - 'year' => date('Y', time()), - 'month' => date('m', time()), - 'day' => date('d', time()), - 'stamp' => time(), - 'webspace' => $admin_diskspace[$row['adminid']]['webspace'], - 'mail' => $admin_diskspace[$row['adminid']]['mail'], - 'mysql' => $admin_diskspace[$row['adminid']]['mysql'] - ); - $ins_stmt = Database::prepare(" - INSERT INTO `" . TABLE_PANEL_DISKSPACE_ADMINS . "` SET - `adminid` = :adminid, - `year` = :year, - `month` = :month, - `day` = :day, - `stamp` = :stamp, - `webspace` = :webspace, - `mail` = :mail, - `mysql` = :mysql - "); - $upd_data = array( 'diskspace' => $admin_diskspace[$row['adminid']]['all'], 'adminid' => $row['adminid'] diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index 15fa0f16..bced46bf 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -10,7 +10,7 @@ final class Froxlor const VERSION = '0.10.20'; // Database version (YYYYMMDDC where C is a daily counter) - const DBVERSION = '202007240'; + const DBVERSION = '202009070'; // Distribution branding-tag (used for Debian etc.) const BRANDING = ''; diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 3dd0e658..94aa7eeb 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -37,7 +37,6 @@ define('TABLE_PANEL_TEMPLATES', 'panel_templates'); define('TABLE_PANEL_TRAFFIC', 'panel_traffic'); define('TABLE_PANEL_TRAFFIC_ADMINS', 'panel_traffic_admins'); define('TABLE_PANEL_DISKSPACE', 'panel_diskspace'); -define('TABLE_PANEL_DISKSPACE_ADMINS', 'panel_diskspace_admins'); define('TABLE_PANEL_LANGUAGE', 'panel_languages'); define('TABLE_PANEL_IPSANDPORTS', 'panel_ipsandports'); define('TABLE_PANEL_LOG', 'panel_syslog'); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index da941459..e2d5aeac 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -63,7 +63,6 @@ Database::query("TRUNCATE TABLE `" . TABLE_FTP_QUOTATALLIES . "`;"); Database::query("TRUNCATE TABLE `" . TABLE_MAIL_VIRTUAL . "`;"); Database::query("TRUNCATE TABLE `" . TABLE_MAIL_USERS . "`;"); Database::query("TRUNCATE TABLE `" . TABLE_PANEL_DISKSPACE . "`;"); -Database::query("TRUNCATE TABLE `" . TABLE_PANEL_DISKSPACE_ADMINS . "`;"); Database::query("TRUNCATE TABLE `" . TABLE_PANEL_TRAFFIC . "`;"); Database::query("TRUNCATE TABLE `" . TABLE_PANEL_TRAFFIC_ADMINS . "`;"); Database::query("TRUNCATE TABLE `" . TABLE_PANEL_TASKS . "`;");