removed ticketsystem; lots of work on cron stuff
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
use \Froxlor\Database;
|
||||
use \Froxlor\Settings;
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
@@ -21,9 +24,9 @@ if (! defined('_CRON_UPDATE')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.40.1')) {
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.9.40.1')) {
|
||||
showUpdateStep("Updating from 0.9.40.1 to 0.10.0", false);
|
||||
|
||||
|
||||
showUpdateStep("Adding new api keys table");
|
||||
Database::query("DROP TABLE IF EXISTS `api_keys`;");
|
||||
$sql = "CREATE TABLE `api_keys` (
|
||||
@@ -40,15 +43,15 @@ if (isFroxlorVersion('0.9.40.1')) {
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;";
|
||||
Database::query($sql);
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
showUpdateStep("Adding new api settings");
|
||||
Settings::AddNew('api.enabled', 0);
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
showUpdateStep("Adding new default-ssl-ip setting");
|
||||
Settings::AddNew('system.defaultsslip', '');
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
showUpdateStep("Altering admin ip's field to allow multiple ip addresses");
|
||||
// get all admins for updating the new field
|
||||
$sel_stmt = Database::prepare("SELECT adminid, ip FROM `panel_admins`");
|
||||
@@ -65,20 +68,20 @@ if (isFroxlorVersion('0.9.40.1')) {
|
||||
}
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.10.0');
|
||||
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.0');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201809280')) {
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201809280')) {
|
||||
|
||||
showUpdateStep("Adding dhparams-file setting");
|
||||
Settings::AddNew("system.dhparams_file", '');
|
||||
Settings::AddNew("system.dhparams_file", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201811180');
|
||||
\Froxlor\Froxlor::updateToDbVersion('201811180');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201811180')) {
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201811180')) {
|
||||
|
||||
showUpdateStep("Adding new settings for 2FA");
|
||||
Settings::AddNew('2fa.enabled', '1', true);
|
||||
@@ -94,33 +97,74 @@ if (isDatabaseVersion('201811180')) {
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `data_2fa` varchar(500) NOT NULL default '' AFTER `type_2fa`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201811300');
|
||||
\Froxlor\Froxlor::updateToDbVersion('201811300');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201811300')) {
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201811300')) {
|
||||
|
||||
showUpdateStep("Adding new logview-flag to customers");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `logviewenabled` tinyint(1) NOT NULL default '0';");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201812010');
|
||||
\Froxlor\Froxlor::updateToDbVersion('201812010');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201812010')) {
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201812010')) {
|
||||
|
||||
showUpdateStep("Adding new is_configured-flag");
|
||||
// updated systems are already configured (most likely :P)
|
||||
Settings::AddNew('panel.is_configured', '1', true);
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201812100');
|
||||
\Froxlor\Froxlor::updateToDbVersion('201812100');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201812100')) {
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201812100')) {
|
||||
|
||||
showUpdateStep("Adding fields writeaccesslog and writeerrorlog for domains");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `writeaccesslog` tinyint(1) NOT NULL default '1';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `writeerrorlog` tinyint(1) NOT NULL default '1';");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201812180');
|
||||
\Froxlor\Froxlor::updateToDbVersion('201812180');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201812180')) {
|
||||
|
||||
showUpdateStep("Updating cronjob table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CRONRUNS . "` ADD `cronclass` varchar(500) NOT NULL AFTER `cronfile`");
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `cronclass` = :cc WHERE `cronfile` = :cf");
|
||||
Database::pexecute($upd_stmt, array('cc' => '\\Froxlor\\Cron\\TasksCron', 'cf' => 'tasks'));
|
||||
Database::pexecute($upd_stmt, array('cc' => '\\Froxlor\\Cron\\Traffic\\TrafficCron', 'cf' => 'traffic'));
|
||||
Database::pexecute($upd_stmt, array('cc' => '\\Froxlor\\Cron\\Traffic\\ReportsCron', 'cf' => 'usage_report'));
|
||||
Database::pexecute($upd_stmt, array('cc' => '\\Froxlor\\Cron\\System\\MailboxsizeCron', 'cf' => 'mailboxsize'));
|
||||
Database::pexecute($upd_stmt, array('cc' => '\\Froxlor\\Cron\\LetsEncrypt\\LetsEncrypt', 'cf' => 'letsencrypt'));
|
||||
Database::pexecute($upd_stmt, array('cc' => '\\Froxlor\\Cron\\System\\BackupCron', 'cf' => 'backup'));
|
||||
Database::query("DELETE FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `module` = 'froxlor/ticket'");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Removing ticketsystem");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` DROP `tickets`");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` DROP `tickets_used`");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` DROP `tickets_see_all`");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` DROP `tickets`");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` DROP `tickets_used`");
|
||||
Database::query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'ticket'");
|
||||
|
||||
define('TABLE_PANEL_TICKETS', 'panel_tickets');
|
||||
define('TABLE_PANEL_TICKET_CATS', 'panel_ticket_categories');
|
||||
Database::query("DROP TABLE IF EXISTS `" . TABLE_PANEL_TICKETS . "`;");
|
||||
Database::query("DROP TABLE IF EXISTS `" . TABLE_PANEL_TICKET_CATS . "`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Updating nameserver settings");
|
||||
$dns_target = 'Bind';
|
||||
if (Settings::Get('system.dns_server') != 'bind') {
|
||||
$dns_target = 'PowerDNS';
|
||||
}
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = :v WHERE `settinggroup` = 'system' AND `varname` = 'dns_server'");
|
||||
Database::pexecute($upd_stmt, array('v' => $dns_target));
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201812190');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user