additional removes for new language mgmt; combined pre-requirement checks for cli commands; removed updaters for 0.9.x and 0.10.x (the last 0.10.x will be upgradable to 0.11.x of course)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -1,982 +0,0 @@
|
||||
<?php
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\System\IPTools;
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Install
|
||||
*
|
||||
*/
|
||||
if (! defined('_CRON_UPDATE')) {
|
||||
if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
||||
header('Location: ../../../../index.php');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.9.40.1')) {
|
||||
showUpdateStep("Updating from 0.9.40.1 to 0.10.0-rc1", false);
|
||||
|
||||
showUpdateStep("Adding new api keys table");
|
||||
Database::query("DROP TABLE IF EXISTS `api_keys`;");
|
||||
$sql = "CREATE TABLE `api_keys` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`adminid` int(11) NOT NULL default '0',
|
||||
`customerid` int(11) NOT NULL default '0',
|
||||
`apikey` varchar(500) NOT NULL default '',
|
||||
`secret` varchar(500) NOT NULL default '',
|
||||
`allowed_from` text NOT NULL,
|
||||
`valid_until` int(15) NOT NULL default '0',
|
||||
PRIMARY KEY (id),
|
||||
KEY adminid (adminid),
|
||||
KEY customerid (customerid)
|
||||
) 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`");
|
||||
Database::pexecute($sel_stmt);
|
||||
$all_admins = $sel_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
Database::query("ALTER TABLE `panel_admins` MODIFY `ip` varchar(500) NOT NULL default '-1';");
|
||||
$upd_stmt = Database::prepare("UPDATE `panel_admins` SET `ip` = :ip WHERE `adminid` = :adminid");
|
||||
foreach ($all_admins as $adm) {
|
||||
if ($adm['ip'] != '-1') {
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'ip' => json_encode($adm['ip']),
|
||||
'adminid' => $adm['adminid']
|
||||
));
|
||||
}
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.0-rc1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201809280')) {
|
||||
|
||||
showUpdateStep("Adding dhparams-file setting");
|
||||
Settings::AddNew("system.dhparams_file", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201811180');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201811180')) {
|
||||
|
||||
showUpdateStep("Adding new settings for 2FA");
|
||||
Settings::AddNew('2fa.enabled', '1', true);
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding new fields to admin-table for 2FA");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` ADD `type_2fa` tinyint(1) NOT NULL default '0';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` ADD `data_2fa` varchar(500) NOT NULL default '' AFTER `type_2fa`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding new fields to customer-table for 2FA");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `type_2fa` tinyint(1) NOT NULL default '0';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `data_2fa` varchar(500) NOT NULL default '' AFTER `type_2fa`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('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);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('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);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('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);
|
||||
|
||||
\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\\System\\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\\Http\\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');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201812190')) {
|
||||
|
||||
showUpdateStep("Adding new webserver error-log-level setting");
|
||||
Settings::AddNew('system.errorlog_level', (\Froxlor\Settings::Get('system.webserver') == 'nginx' ? 'error' : 'warn'));
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201902120');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201902120')) {
|
||||
|
||||
showUpdateStep("Adding new ECC / ECDSA setting for Let's Encrypt");
|
||||
Settings::AddNew('system.leecc', '0');
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `cronclass` = :cc WHERE `cronfile` = :cf");
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'cc' => '\\Froxlor\\Cron\\Http\\LetsEncrypt\\AcmeSh',
|
||||
'cf' => 'letsencrypt'
|
||||
));
|
||||
Settings::Set('system.letsencryptkeysize', '4096', true);
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Removing current Let's Encrypt certificates due to new implementation of acme.sh");
|
||||
$sel_result = Database::query("SELECT id FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `letsencrypt` = '1'");
|
||||
$domain_ids = $sel_result->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (count($domain_ids) > 0) {
|
||||
$domain_in = "";
|
||||
foreach ($domain_ids as $domain_id) {
|
||||
$domain_in .= "'" . $domain_id['id'] . "',";
|
||||
}
|
||||
$domain_in = substr($domain_in, 0, - 1);
|
||||
Database::query("DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` IN (" . $domain_in . ")");
|
||||
}
|
||||
// check for froxlor domain using let's encrypt
|
||||
if (Settings::Get('system.le_froxlor_enabled') == 1) {
|
||||
Database::query("DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = '0'");
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Inserting job to regenerate configfiles");
|
||||
\Froxlor\System\Cronjob::inserttask('1');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201902170');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201902170')) {
|
||||
|
||||
showUpdateStep("Adding new froxlor vhost domain alias setting");
|
||||
Settings::AddNew('system.froxloraliases', "");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201902210');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201902210')) {
|
||||
|
||||
// set correct version for people that have tested 0.10.0 before
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.0-rc1');
|
||||
\Froxlor\Froxlor::updateToDbVersion('201904100');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201904100')) {
|
||||
|
||||
showUpdateStep("Converting all MyISAM tables to InnoDB");
|
||||
Database::needRoot(true);
|
||||
Database::needSqlData();
|
||||
$sql_data = Database::getSqlData();
|
||||
$result = Database::query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '" . $sql_data['db'] . "' AND ENGINE = 'MyISAM'");
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
Database::query("ALTER TABLE `" . $row['TABLE_NAME'] . "` ENGINE=INNODB");
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201904250');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.0-rc1')) {
|
||||
showUpdateStep("Updating from 0.10.0-rc1 to 0.10.0-rc2", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.0-rc2');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201904250')) {
|
||||
|
||||
showUpdateStep("Adding new settings for CAA");
|
||||
Settings::AddNew('caa.caa_entry', '', true);
|
||||
Settings::AddNew('system.dns_createcaaentry', 1, true);
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201907270');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201907270')) {
|
||||
|
||||
showUpdateStep("Cleaning up old files");
|
||||
$to_clean = array(
|
||||
"actions/admin/settings/000.version.php",
|
||||
"actions/admin/settings/190.ticket.php",
|
||||
"admin_tickets.php",
|
||||
"customer_tickets.php",
|
||||
"install/scripts/language-check.php",
|
||||
"install/updates/froxlor/upgrade_syscp.inc.php",
|
||||
"lib/classes",
|
||||
"lib/configfiles/precise.xml",
|
||||
"lib/cron_init.php",
|
||||
"lib/cron_shutdown.php",
|
||||
"lib/formfields/admin/tickets",
|
||||
"lib/formfields/customer/tickets",
|
||||
"lib/functions.php",
|
||||
"lib/functions",
|
||||
"lib/navigation/10.tickets.php",
|
||||
"scripts/classes",
|
||||
"scripts/jobs",
|
||||
"templates/Sparkle/admin/tickets",
|
||||
"templates/Sparkle/customer/tickets"
|
||||
);
|
||||
$disabled = explode(',', ini_get('disable_functions'));
|
||||
$exec_allowed = ! in_array('exec', $disabled);
|
||||
$del_list = "";
|
||||
foreach ($to_clean as $filedir) {
|
||||
$complete_filedir = \Froxlor\Froxlor::getInstallDir() . $filedir;
|
||||
if (file_exists($complete_filedir)) {
|
||||
if ($exec_allowed) {
|
||||
Froxlor\FileDir::safe_exec("rm -rf " . escapeshellarg($complete_filedir));
|
||||
} else {
|
||||
$del_list .= "rm -rf " . escapeshellarg($complete_filedir) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($exec_allowed) {
|
||||
lastStepStatus(0);
|
||||
} else {
|
||||
if (empty($del_list)) {
|
||||
// none of the files existed
|
||||
lastStepStatus(0);
|
||||
} else {
|
||||
lastStepStatus(1, 'manual commands needed');
|
||||
echo '<span class="update-step update-step-err">Please run the following commands manually:</span><br><pre>' . $del_list . '</pre><br>';
|
||||
}
|
||||
}
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201909150');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.0-rc2')) {
|
||||
showUpdateStep("Updating from 0.10.0-rc2 to 0.10.0 final", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.0');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201909150')) {
|
||||
|
||||
showUpdateStep("Adding TLSv1.3-cipherlist setting");
|
||||
Settings::AddNew("system.tlsv13_cipher_list", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910030');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910030')) {
|
||||
|
||||
showUpdateStep("Adding field api_allowed to admins and customers");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` ADD `api_allowed` tinyint(1) NOT NULL default '1';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `api_allowed` tinyint(1) NOT NULL default '1';");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910090');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.0')) {
|
||||
showUpdateStep("Updating from 0.10.0 to 0.10.1 final", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910090')) {
|
||||
|
||||
showUpdateStep("Adjusting Let's Encrypt API setting");
|
||||
Settings::Set("system.leapiversion", '2');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910110');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910110')) {
|
||||
|
||||
showUpdateStep("Adding new settings for ssl-vhost default content");
|
||||
Settings::AddNew("system.default_sslvhostconf", '');
|
||||
Settings::AddNew("system.include_default_vhostconf", '0');
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding new fields to ips and ports-table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` ADD `ssl_specialsettings` text AFTER `docroot`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` ADD `include_specialsettings` tinyint(1) NOT NULL default '0' AFTER `ssl_specialsettings`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` ADD `ssl_default_vhostconf_domain` text AFTER `include_specialsettings`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` ADD `include_default_vhostconf_domain` tinyint(1) NOT NULL default '0' AFTER `ssl_default_vhostconf_domain`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding new fields to domains-table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_specialsettings` text AFTER `specialsettings`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `include_specialsettings` tinyint(1) NOT NULL default '0' AFTER `ssl_specialsettings`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
// select all ips/ports with specialsettings and SSL enabled to include the specialsettings in the ssl-vhost
|
||||
// because the former implementation included it and users might rely on that, see https://github.com/Froxlor/Froxlor/issues/727
|
||||
$sel_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `specialsettings` <> '' AND `ssl` = '1'");
|
||||
Database::pexecute($sel_stmt);
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_IPSANDPORTS . "` SET `include_specialsettings` = '1' WHERE `id` = :id");
|
||||
if ($sel_stmt->columnCount() > 0) {
|
||||
showUpdateStep("Adjusting IP/port settings for downward compatibility");
|
||||
while ($row = $sel_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
Database::pexecute($upd_stmt, [
|
||||
'id' => $row['id']
|
||||
]);
|
||||
}
|
||||
lastStepStatus(0);
|
||||
}
|
||||
|
||||
// select all domains with an ssl IP connected and specialsettings content to include these in the ssl-vhost
|
||||
// to maintain former behavior
|
||||
$sel_stmt = Database::prepare("
|
||||
SELECT d.id FROM `" . TABLE_PANEL_DOMAINS . "` d
|
||||
LEFT JOIN `" . TABLE_DOMAINTOIP . "` d2i ON d2i.id_domain = d.id
|
||||
LEFT JOIN `" . TABLE_PANEL_IPSANDPORTS . "` i ON i.id = d2i.id_ipandports
|
||||
WHERE d.specialsettings <> '' AND i.ssl = '1'
|
||||
");
|
||||
Database::pexecute($sel_stmt);
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `include_specialsettings` = '1' WHERE `id` = :id");
|
||||
if ($sel_stmt->columnCount() > 0) {
|
||||
showUpdateStep("Adjusting domain settings for downward compatibility");
|
||||
while ($row = $sel_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
Database::pexecute($upd_stmt, [
|
||||
'id' => $row['id']
|
||||
]);
|
||||
}
|
||||
lastStepStatus(0);
|
||||
}
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910120');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.1')) {
|
||||
showUpdateStep("Updating from 0.10.1 to 0.10.2", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.2');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910120')) {
|
||||
|
||||
showUpdateStep("Adding new TLS options to domains-table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `override_tls` tinyint(1) DEFAULT '0' AFTER `writeerrorlog`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_protocols` text AFTER `override_tls`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_cipher_list` text AFTER `ssl_protocols`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `tlsv13_cipher_list` text AFTER `ssl_cipher_list`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910200');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.2')) {
|
||||
showUpdateStep("Updating from 0.10.2 to 0.10.3", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.3');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.3')) {
|
||||
showUpdateStep("Updating from 0.10.3 to 0.10.4", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.4');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.4')) {
|
||||
showUpdateStep("Updating from 0.10.4 to 0.10.5", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.5');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910200')) {
|
||||
|
||||
showUpdateStep("Optimizing customer and admin table for size");
|
||||
// ALTER TABLE `panel_customers` CHANGE `name` `name` VARCHAR(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `zipcode` `zipcode` varchar(25) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `phone` `phone` varchar(50) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `fax` `fax` varchar(50) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `def_language` `def_language` varchar(100) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `theme` `theme` varchar(50) NOT NULL default 'Sparkle';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `data_2fa` `data_2fa` varchar(25) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `def_language` `def_language` varchar(100) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` DROP `leaccount`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` CHANGE `def_language` `def_language` varchar(100) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` CHANGE `theme` `theme` varchar(50) NOT NULL default 'Sparkle';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` CHANGE `data_2fa` `data_2fa` varchar(25) NOT NULL default '';");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201911130');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.5')) {
|
||||
showUpdateStep("Updating from 0.10.5 to 0.10.6", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.6');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201911130')) {
|
||||
showUpdateStep("Adding new settings for domain edit form default values");
|
||||
Settings::AddNew("system.apply_specialsettings_default", '1');
|
||||
Settings::AddNew("system.apply_phpconfigs_default", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201911220');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.6')) {
|
||||
showUpdateStep("Updating from 0.10.6 to 0.10.7", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.7');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.7')) {
|
||||
showUpdateStep("Updating from 0.10.7 to 0.10.8", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.8');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.8')) {
|
||||
showUpdateStep("Updating from 0.10.8 to 0.10.9", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.9');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201911220')) {
|
||||
showUpdateStep("Adding enhanced SSL control over domains");
|
||||
// customer domains
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_enabled` tinyint(1) DEFAULT '1';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_honorcipherorder` tinyint(1) DEFAULT '0' AFTER `ssl_enabled`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_sessiontickets` tinyint(1) DEFAULT '1' AFTER `ssl_honorcipherorder`;");
|
||||
// as setting for froxlor vhost
|
||||
Settings::AddNew("system.honorcipherorder", '0');
|
||||
Settings::AddNew("system.sessiontickets", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912100');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.9')) {
|
||||
showUpdateStep("Updating from 0.10.9 to 0.10.10", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.10');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912100')) {
|
||||
showUpdateStep("Adding option to disable SSL sessiontickets for older systems");
|
||||
Settings::AddNew("system.sessionticketsenabled", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912310');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912310')) {
|
||||
showUpdateStep("Adding custom phpfpm pool configuration field");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_FPMDAEMONS . "` ADD `custom_config` text AFTER `limit_extensions`;");
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912311');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.10')) {
|
||||
showUpdateStep("Updating from 0.10.10 to 0.10.11", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.11');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912311')) {
|
||||
showUpdateStep("Migrate logfiles_format setting");
|
||||
$current_format = Settings::Set('system.logfiles_format');
|
||||
if (! empty($current_format)) {
|
||||
Settings::Set('system.logfiles_format', '"' . Settings::Get('system.logfiles_format') . '"');
|
||||
lastStepStatus(0);
|
||||
} else {
|
||||
lastStepStatus(0, 'not needed');
|
||||
}
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912312');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912312')) {
|
||||
showUpdateStep("Adding option change awstats LogFormat");
|
||||
Settings::AddNew("system.awstats_logformat", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912313');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.11')) {
|
||||
showUpdateStep("Updating from 0.10.11 to 0.10.12", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.12');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.12')) {
|
||||
showUpdateStep("Updating from 0.10.12 to 0.10.13", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.13');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912313')) {
|
||||
showUpdateStep("Adding new field to domains table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `domain_ace` varchar(255) NOT NULL default '' AFTER `domain`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Updating domain entries");
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `domain_ace` = :ace WHERE `id` = :domainid");
|
||||
$sel_stmt = Database::prepare("SELECT id, domain FROM `" . TABLE_PANEL_DOMAINS . "` ORDER BY id ASC");
|
||||
Database::pexecute($sel_stmt);
|
||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||
while ($domain = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
Database::pexecute($upd_stmt, [
|
||||
'ace' => $idna_convert->decode($domain['domain']),
|
||||
'domainid' => $domain['id']
|
||||
]);
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202002290');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.13')) {
|
||||
showUpdateStep("Updating from 0.10.13 to 0.10.14", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.14');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.14')) {
|
||||
showUpdateStep("Updating from 0.10.14 to 0.10.15", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.15');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202002290')) {
|
||||
showUpdateStep("Adding new setting to validate DNS when using Let's Encrypt");
|
||||
Database::query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'disable_le_selfcheck'");
|
||||
$le_domain_dnscheck = isset($_POST['system_le_domain_dnscheck']) ? (int) $_POST['system_le_domain_dnscheck'] : '1';
|
||||
Settings::AddNew("system.le_domain_dnscheck", $le_domain_dnscheck);
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202004140');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.15')) {
|
||||
showUpdateStep("Updating from 0.10.15 to 0.10.16", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.16');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202004140')) {
|
||||
|
||||
showUpdateStep("Adding unique key on domainid field in domain ssl table");
|
||||
// check for duplicate entries prior to set a unique key to avoid errors on update
|
||||
Database::query("
|
||||
DELETE a.* FROM domain_ssl_settings AS a
|
||||
LEFT JOIN domain_ssl_settings AS b ON
|
||||
((b.`domainid`=a.`domainid` AND UNIX_TIMESTAMP(b.`expirationdate`) > UNIX_TIMESTAMP(a.`expirationdate`))
|
||||
OR (UNIX_TIMESTAMP(b.`expirationdate`) = UNIX_TIMESTAMP(a.`expirationdate`) AND b.`id`>a.`id`))
|
||||
WHERE b.`id` IS NOT NULL
|
||||
");
|
||||
Database::query("ALTER TABLE `domain_ssl_settings` ADD UNIQUE(`domainid`)");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202005150');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.16')) {
|
||||
showUpdateStep("Updating from 0.10.16 to 0.10.17", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.17');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.17')) {
|
||||
showUpdateStep("Updating from 0.10.17 to 0.10.18", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.18');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.18')) {
|
||||
showUpdateStep("Updating from 0.10.18 to 0.10.19", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.19');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202005150')) {
|
||||
|
||||
showUpdateStep("Add new performance indexes", true);
|
||||
Database::query("ALTER TABLE panel_customers ADD INDEX guid (guid);");
|
||||
Database::query("ALTER TABLE panel_tasks ADD INDEX type (type);");
|
||||
Database::query("ALTER TABLE mail_users ADD INDEX username (username);");
|
||||
Database::query("ALTER TABLE mail_users ADD INDEX imap (imap);");
|
||||
Database::query("ALTER TABLE mail_users ADD INDEX pop3 (pop3);");
|
||||
Database::query("ALTER TABLE ftp_groups ADD INDEX gid (gid);");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202007240');
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.20')) {
|
||||
showUpdateStep("Updating from 0.10.20 to 0.10.21", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.21');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.21')) {
|
||||
|
||||
showUpdateStep("Adding settings for ssl-vhost default content if not updated from db-version 201910110", true);
|
||||
Settings::AddNew("system.default_sslvhostconf", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Updating from 0.10.21 to 0.10.22", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.22');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.22')) {
|
||||
showUpdateStep("Updating from 0.10.22 to 0.10.23", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.23');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.23')) {
|
||||
showUpdateStep("Updating from 0.10.23 to 0.10.23.1", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.23.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202009070')) {
|
||||
|
||||
showUpdateStep("Adding setting to hide incompatible settings", true);
|
||||
Settings::AddNew("system.hide_incompatible_settings", '0');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202012300');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202012300')) {
|
||||
|
||||
showUpdateStep("Adding setting for DKIM private key extension/suffix", true);
|
||||
Settings::AddNew("dkim.privkeysuffix", '.priv');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202101200');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.23.1')) {
|
||||
showUpdateStep("Updating from 0.10.23.1 to 0.10.24", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.24');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202101200')) {
|
||||
|
||||
showUpdateStep("Adding setting for mail address used in SOA records", true);
|
||||
Settings::AddNew("system.soaemail", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202102200');
|
||||
}
|
||||
|
||||
/*
|
||||
* skip due to potential "1118 Row size too large" error
|
||||
*
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202102200')) {
|
||||
|
||||
showUpdateStep("Add new description fields to mail and domain table", true);
|
||||
Database::query("ALTER TABLE panel_domains ADD `description` varchar(255) NOT NULL DEFAULT '' AFTER `ssl_sessiontickets`;");
|
||||
Database::query("ALTER TABLE mail_virtual ADD `description` varchar(255) NOT NULL DEFAULT '' AFTER `iscatchall`");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202103030');
|
||||
}
|
||||
*/
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.24')) {
|
||||
showUpdateStep("Updating from 0.10.24 to 0.10.25", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.25');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202102200') || \Froxlor\Froxlor::isDatabaseVersion('202103030')) {
|
||||
|
||||
showUpdateStep("Refactoring columns from large tables", true);
|
||||
Database::query("ALTER TABLE panel_domains CHANGE `ssl_protocols` `ssl_protocols` varchar(255) NOT NULL DEFAULT '';");
|
||||
Database::query("ALTER TABLE panel_domains CHANGE `ssl_cipher_list` `ssl_cipher_list` varchar(500) NOT NULL DEFAULT '';");
|
||||
Database::query("ALTER TABLE panel_domains CHANGE `tlsv13_cipher_list` `tlsv13_cipher_list` varchar(500) NOT NULL DEFAULT '';");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Add new description fields to mail and domain table", true);
|
||||
$result = Database::query("DESCRIBE `panel_domains`");
|
||||
$columnfound = 0;
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($row['Field'] == 'description') {
|
||||
$columnfound = 1;
|
||||
}
|
||||
}
|
||||
if (! $columnfound) {
|
||||
Database::query("ALTER TABLE panel_domains ADD `description` varchar(255) NOT NULL DEFAULT '' AFTER `ssl_sessiontickets`;");
|
||||
}
|
||||
$result = Database::query("DESCRIBE `mail_virtual`");
|
||||
$columnfound = 0;
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($row['Field'] == 'description') {
|
||||
$columnfound = 1;
|
||||
}
|
||||
}
|
||||
if (! $columnfound) {
|
||||
Database::query("ALTER TABLE mail_virtual ADD `description` varchar(255) NOT NULL DEFAULT '' AFTER `iscatchall`");
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202103110');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202103110')) {
|
||||
|
||||
showUpdateStep("Adding settings for imprint, terms of use and privacy policy URLs", true);
|
||||
Settings::AddNew("panel.imprint_url", '');
|
||||
Settings::AddNew("panel.terms_url", '');
|
||||
Settings::AddNew("panel.privacy_url", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202103240');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.25')) {
|
||||
showUpdateStep("Updating from 0.10.25 to 0.10.26", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.26');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202103240')) {
|
||||
|
||||
showUpdateStep("Adding setting for default serveralias value for new domains", true);
|
||||
Settings::AddNew("system.domaindefaultalias", '0');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202106160');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202106160')) {
|
||||
|
||||
showUpdateStep("Adjusting Let's Encrypt endpoint configuration to support ZeroSSL", true);
|
||||
if (Settings::Get('system.letsencryptca') == 'testing') {
|
||||
Settings::Set("system.letsencryptca", 'letsencrypt_test');
|
||||
} else {
|
||||
Settings::Set("system.letsencryptca", 'letsencrypt');
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202106270');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202106270')) {
|
||||
showUpdateStep("Adding custom logo image settings", true);
|
||||
Settings::AddNew("panel.logo_image_header", '');
|
||||
Settings::AddNew("panel.logo_image_login", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
// Migrating old custom logo over, if exists
|
||||
$custom_logo_file_old = \Froxlor\Froxlor::getInstallDir() . '/templates/Sparkle/assets/img/logo_custom.png';
|
||||
if (file_exists($custom_logo_file_old)) {
|
||||
showUpdateStep("Migrating existing custom logo to new settings", true);
|
||||
|
||||
$path = \Froxlor\Froxlor::getInstallDir().'/img/';
|
||||
if (!is_dir($path) && !mkdir($path, 0775)) {
|
||||
throw new \Exception("img directory does not exist and cannot be created");
|
||||
}
|
||||
if (!is_writable($path)) {
|
||||
if (!chmod($path, 0775)) {
|
||||
throw new \Exception("Cannot write to img directory");
|
||||
}
|
||||
}
|
||||
|
||||
// Save as new custom logo header
|
||||
$save_to = 'logo_header.png';
|
||||
copy($custom_logo_file_old, $path.$save_to);
|
||||
Settings::Set("panel.logo_image_header", "img/{$save_to}?v=".time());
|
||||
|
||||
// Save as new custom logo login
|
||||
$save_to = 'logo_login.png';
|
||||
copy($custom_logo_file_old, $path.$save_to);
|
||||
Settings::Set("panel.logo_image_login", "img/{$save_to}?v=".time());
|
||||
|
||||
lastStepStatus(0);
|
||||
}
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107070');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.26')) {
|
||||
showUpdateStep("Updating from 0.10.26 to 0.10.27", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.27');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107070')) {
|
||||
showUpdateStep("Adding settings to overwrite theme- or custom theme-logo with the new logo settings", true);
|
||||
Settings::AddNew("panel.logo_overridetheme", '0');
|
||||
Settings::AddNew("panel.logo_overridecustom", '0');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107200');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107200')) {
|
||||
showUpdateStep("Adding settings to define default value of 'create std-subdomain' when creating a customer", true);
|
||||
Settings::AddNew("system.createstdsubdom_default", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107210');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107210')) {
|
||||
showUpdateStep("Normalizing ipv6 for correct comparison", true);
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `id`, `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "`"
|
||||
);
|
||||
Database::pexecute($result_stmt);
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_IPSANDPORTS . "` SET `ip` = :ip WHERE `id` = :id");
|
||||
while ($iprow = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
if (IPTools::is_ipv6($iprow['ip'])) {
|
||||
$ip = inet_ntop(inet_pton($iprow['ip']));
|
||||
Database::pexecute($upd_stmt, [
|
||||
'ip' => $ip,
|
||||
'id' => $iprow['id']
|
||||
]);
|
||||
}
|
||||
}
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107260');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107260')) {
|
||||
showUpdateStep("Removing setting for search-engine allow yes/no", true);
|
||||
Database::query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'panel' AND `varname` = 'no_robots'");
|
||||
lastStepStatus(0);
|
||||
showUpdateStep("Adding setting to have all froxlor customers in a local group", true);
|
||||
Settings::AddNew("system.froxlorusergroup", '');
|
||||
Settings::AddNew("system.froxlorusergroup_gid", '');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107300');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107300')) {
|
||||
showUpdateStep("Adds the possibility to select the PowerDNS Operation Mode", true);
|
||||
Settings::AddNew("system.powerdns_mode", 'Native');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202108180');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.27')) {
|
||||
showUpdateStep("Updating from 0.10.27 to 0.10.28", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.28');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202108180')) {
|
||||
showUpdateStep("Adding czech language file", true);
|
||||
Database::query("INSERT INTO `" . TABLE_PANEL_LANGUAGE . "` SET `language` = 'Česká republika', `iso` = 'cs', `file` = 'lng/czech.lng.php'");
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202109040');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.28')) {
|
||||
showUpdateStep("Updating from 0.10.28 to 0.10.29", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.29');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.29')) {
|
||||
showUpdateStep("Updating from 0.10.29 to 0.10.29.1", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.29.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.29.1')) {
|
||||
showUpdateStep("Updating from 0.10.29.1 to 0.10.30", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.30');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.30')) {
|
||||
showUpdateStep("Updating from 0.10.30 to 0.10.31", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.31');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202109040')) {
|
||||
showUpdateStep("Add setting for acme.sh install location", true);
|
||||
Settings::AddNew("system.acmeshpath", '/root/.acme.sh/acme.sh');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202112310');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.31')) {
|
||||
showUpdateStep("Updating from 0.10.31 to 0.10.32", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.32');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.32')) {
|
||||
showUpdateStep("Updating from 0.10.32 to 0.10.33", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.33');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.33')) {
|
||||
showUpdateStep("Updating from 0.10.33 to 0.10.34", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.34');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34')) {
|
||||
showUpdateStep("Updating from 0.10.34 to 0.10.34.1", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.34.1');
|
||||
}
|
||||
@@ -1,22 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Install
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license http://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
|
||||
if (!defined('_CRON_UPDATE')) {
|
||||
if (!defined('AREA') || (defined('AREA') && AREA != 'admin') || !isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
||||
header('Location: ../../../../index.php');
|
||||
@@ -30,6 +39,7 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) {
|
||||
|
||||
showUpdateStep("Removing unused table");
|
||||
Database::query("DROP TABLE IF EXISTS `panel_sessions`;");
|
||||
Database::query("DROP TABLE IF EXISTS `panel_languages`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Updating froxlor - theme");
|
||||
@@ -38,7 +48,7 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) {
|
||||
Settings::Set('panel.default_theme', 'Froxlor');
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Creating new tables");
|
||||
showUpdateStep("Creating new tables and fields");
|
||||
Database::query("DROP TABLE IF EXISTS `panel_usercolumns`;");
|
||||
$sql = "CREATE TABLE `panel_usercolumns` (
|
||||
`adminid` int(11) NOT NULL default '0',
|
||||
@@ -55,8 +65,19 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) {
|
||||
|
||||
showUpdateStep("Cleaning up old files");
|
||||
$to_clean = array(
|
||||
"install/lib",
|
||||
"install/lng",
|
||||
"templates/Sparkle",
|
||||
"lib/version.inc.php"
|
||||
"lib/version.inc.php",
|
||||
"lng/czech.lng.php",
|
||||
"lng/dutch.lng.php",
|
||||
"lng/english.lng.php",
|
||||
"lng/french.lng.php",
|
||||
"lng/german.lng.php",
|
||||
"lng/italian.lng.php",
|
||||
"lng/lng_references.php",
|
||||
"lng/portugues.lng.php",
|
||||
"lng/swedish.lng.php",
|
||||
);
|
||||
$disabled = explode(',', ini_get('disable_functions'));
|
||||
$exec_allowed = !in_array('exec', $disabled);
|
||||
@@ -89,6 +110,18 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.99')) {
|
||||
|
||||
showUpdateStep("Adjusting existing settings");
|
||||
Settings::Set('system.passwordcryptfunc', PASSWORD_DEFAULT);
|
||||
// remap default-language
|
||||
$lang_map = [
|
||||
'Deutsch' => 'de',
|
||||
'English' => 'en',
|
||||
'Français' => 'fr',
|
||||
'Português' => 'pt',
|
||||
'Italiano' => 'it',
|
||||
'Nederlands' => 'nl',
|
||||
'Svenska' => 'sv',
|
||||
'Česká republika' => 'cs'
|
||||
];
|
||||
Settings::Set('panel.standardlanguage', $lang_map[Settings::Get('panel_standardlanguage')] ?? 'en');
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,15 +4,23 @@
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Language
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license http://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -30,20 +38,6 @@ function getPreConfig($current_version, $current_db_version): array
|
||||
{
|
||||
$has_preconfig = false;
|
||||
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.9/preconfig_0.9.inc.php');
|
||||
$return['section_09'] = [
|
||||
'title' => '0.9.x updates',
|
||||
'fields' => []
|
||||
];
|
||||
parseAndOutputPreconfig09($has_preconfig, $return['section_09']['fields'], $current_version, $current_db_version);
|
||||
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.10/preconfig_0.10.inc.php');
|
||||
$return['section_010'] = [
|
||||
'title' => '0.10.x updates',
|
||||
'fields' => []
|
||||
];
|
||||
parseAndOutputPreconfig010($has_preconfig, $return['section_010']['fields'], $current_version, $current_db_version);
|
||||
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.11/preconfig_0.11.inc.php');
|
||||
$return['section_011'] = [
|
||||
'title' => '0.11.x updates',
|
||||
@@ -51,12 +45,6 @@ function getPreConfig($current_version, $current_db_version): array
|
||||
];
|
||||
parseAndOutputPreconfig011($has_preconfig, $return['section_011']['fields'], $current_version, $current_db_version);
|
||||
|
||||
if (empty($return['section_09']['fields'])) {
|
||||
unset($return['section_09']);
|
||||
}
|
||||
if (empty($return['section_010']['fields'])) {
|
||||
unset($return['section_010']);
|
||||
}
|
||||
if (empty($return['section_011']['fields'])) {
|
||||
unset($return['section_011']);
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Updater
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* checks if the new-version has some updating to do
|
||||
*
|
||||
* @param boolean $has_preconfig
|
||||
* pointer to check if any preconfig has to be output
|
||||
* @param string $return
|
||||
* pointer to output string
|
||||
* @param string $current_version
|
||||
* current froxlor version
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function parseAndOutputPreconfig010(&$has_preconfig, &$return, $current_version, $current_db_version)
|
||||
{
|
||||
global $lng;
|
||||
|
||||
if (versionInUpdate($current_db_version, '202004140')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor can now optionally validate the dns entries of domains that request Lets Encrypt certificates to reduce dns-related problems (e.g. freshly registered domain or updated a-record).';
|
||||
$question = '<strong>Validate DNS of domains when using Lets Encrypt';
|
||||
$return['system_le_domain_dnscheck_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['system_le_domain_dnscheck'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
}
|
||||
@@ -1,768 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Language
|
||||
*
|
||||
*/
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
|
||||
/**
|
||||
* checks if the new-version has some updating to do
|
||||
*
|
||||
* @param boolean $has_preconfig
|
||||
* pointer to check if any preconfig has to be output
|
||||
* @param string $return
|
||||
* pointer to output string
|
||||
* @param string $current_version
|
||||
* current froxlor version
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function parseAndOutputPreconfig09(&$has_preconfig, &$return, $current_version, $current_db_version)
|
||||
{
|
||||
global $lng;
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.4-svn2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now enables the usage of a domain-wildcard entry and subdomains for this domain at the same time (subdomains are parsed before the main-domain vhost container).';
|
||||
$description .= 'This makes it possible to catch all non-existing subdomains with the main vhost but also have the ability to use subdomains for that domain.<br />';
|
||||
$description .= 'If you would like Froxlor to do so with your domains, the update script can set the correct values for existing domains for you. Note: future domains will have wildcard-entries enabled by default no matter how you decide here.';
|
||||
$question = '<strong>Do you want to use wildcard-entries for existing domains?:</strong>';
|
||||
|
||||
$return['update_domainwildcardentry_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_domainwildcardentry'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.6-svn2')) {
|
||||
if (!PHPMailer::ValidateAddress(Settings::Get('panel.adminmail'))) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor uses a newer version of the PHPMailer-Class and determined that your current admin-mail address is invalid.';
|
||||
$question = '<strong>Please specify a new admin-email address:</strong>';
|
||||
|
||||
$return['update_adminmail_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_adminmail'] = ['type' => 'text', 'value' => Settings::Get('panel.adminmail'), 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.6-svn3')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You now have the possibility to define default error-documents for your webserver which replace the default webserver error-messages.';
|
||||
$question = '<strong>Do you want to enable default error-documents?:</strong>';
|
||||
|
||||
$return['update_deferr_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_deferr_enable'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
if (Settings::Get('system.webserver') == 'apache2') {
|
||||
$return['update_deferr_500'] = ['type' => 'text', 'value' => "", 'label' => 'Path/URL for error 500:'];
|
||||
$return['update_deferr_401'] = ['type' => 'text', 'value' => "", 'label' => 'Path/URL for error 401:'];
|
||||
$return['update_deferr_403'] = ['type' => 'text', 'value' => "", 'label' => 'Path/URL for error 403:'];
|
||||
}
|
||||
$return['update_deferr_404'] = ['type' => 'text', 'value' => "", 'label' => 'Path/URL for error 404:'];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.6-svn4')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can define a default support-ticket priority level which is pre-selected for new support-tickets.';
|
||||
$question = '<strong>Which should be the default ticket-priority?:</strong>';
|
||||
|
||||
$return['update_deftic_priority_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_deftic_priority'] = ['type' => 'select', 'select_var' => [1 => $lng['ticket']['high'], 2 => $lng['ticket']['normal'], 3 => $lng['ticket']['low']], 'selected' => 2, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.6-svn5')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'If you have more than one PHP configurations defined in Froxlor you can now set a default one which will be used for every domain.';
|
||||
$question = '<strong>Select default PHP configuration:</strong>';
|
||||
|
||||
$return['update_defsys_phpconfig_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$configs_array = \Froxlor\Http\PhpConfig::getPhpConfigs();
|
||||
$configs = '';
|
||||
foreach ($configs_array as $idx => $desc) {
|
||||
$configs[$idx] = $desc;
|
||||
}
|
||||
$return['update_defsys_phpconfig'] = ['type' => 'select', 'select_var' => $configs, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.6-svn6')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'For the new FTP-quota feature, you can now chose the currently used ftpd-software.';
|
||||
$question = '<strong>Used FTPd-software:</strong>';
|
||||
|
||||
$return['update_defsys_ftpserver_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_defsys_ftpserver'] = ['type' => 'select', 'select_var' => ['proftpd' => 'ProFTPd', 'pureftpd' => 'PureFTPd'], 'selected' => 'proftpd', 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.7-svn1')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can now choose whether customers can select the http-redirect code and which of them acts as default.';
|
||||
$question = '<strong>Allow customer chosen redirects?:</strong>';
|
||||
$return['update_customredirect_enable_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_customredirect_enable'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
|
||||
|
||||
$question = '<strong>Select default redirect code (default: empty):</strong>';
|
||||
$return['update_customredirect_default'] = [
|
||||
'type' => 'select',
|
||||
'select_var' => [
|
||||
1 => '--- (' . $lng['redirect_desc']['rc_default'] . ')',
|
||||
2 => '301 (' . $lng['redirect_desc']['rc_movedperm'] . ')',
|
||||
3 => '302 (' . $lng['redirect_desc']['rc_found'] . ')',
|
||||
4 => '303 (' . $lng['redirect_desc']['rc_seeother'] . ')',
|
||||
5 => '307 (' . $lng['redirect_desc']['rc_tempred'] . ')'
|
||||
],
|
||||
'selected' => 1,
|
||||
'label' => $question
|
||||
];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.7-svn2')) {
|
||||
$result = Database::query("SELECT `domain` FROM " . TABLE_PANEL_DOMAINS . " WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
|
||||
$wrongOpenBasedirDomain = array();
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$wrongOpenBasedirDomain[] = $row['domain'];
|
||||
}
|
||||
|
||||
if (count($wrongOpenBasedirDomain) > 0) {
|
||||
$has_preconfig = true;
|
||||
$description = '<strong>Due to a security - issue regarding open_basedir, Froxlor will set the open_basedir for the following domains to the customers root instead of the chosen documentroot:</strong><br /> ';
|
||||
$description .= '<ul>';
|
||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||
foreach ($wrongOpenBasedirDomain as $domain) {
|
||||
$description .= '<li>' . $idna_convert->decode($domain) . '</li>';
|
||||
}
|
||||
$description .= '</ul>';
|
||||
$return['update_reset_openbasedirpath_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.9-svn1')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'When entering MX servers to Froxlor there was no mail-, imap-, pop3- and smtp-"A record" created. You can now chose whether this should be done or not.';
|
||||
$question = '<strong>Do you want these A-records to be created even with MX servers given?:</strong>';
|
||||
|
||||
$return['update_defdns_mailentry_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_defdns_mailentry'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.10-svn1')) {
|
||||
$has_nouser = false;
|
||||
$has_nogroup = false;
|
||||
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!isset($result) || !isset($result['value'])) {
|
||||
$has_preconfig = true;
|
||||
$has_nouser = true;
|
||||
$guessed_user = 'www-data';
|
||||
if (function_exists('posix_getuid') && function_exists('posix_getpwuid')) {
|
||||
$_httpuser = posix_getpwuid(posix_getuid());
|
||||
$guessed_user = $_httpuser['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!isset($result) || !isset($result['value'])) {
|
||||
$has_preconfig = true;
|
||||
$has_nogroup = true;
|
||||
$guessed_group = 'www-data';
|
||||
if (function_exists('posix_getgid') && function_exists('posix_getgrgid')) {
|
||||
$_httpgroup = posix_getgrgid(posix_getgid());
|
||||
$guessed_group = $_httpgroup['name'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($has_nouser || $has_nogroup) {
|
||||
$description = 'Please enter the correct username/groupname of the webserver on your system We\'re guessing the user but it might not be correct, so please check.';
|
||||
$return['update_httpusergroup_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
if ($has_nouser) {
|
||||
$question = '<strong>Please enter the webservers username:</strong>';
|
||||
$return['update_httpuser'] = ['type' => 'text', 'value' => $guessed_user, 'label' => $question];
|
||||
}
|
||||
if ($has_nogroup) {
|
||||
$question = '<strong>Please enter the webservers groupname:</strong>';
|
||||
$return['update_httpgroup'] = ['type' => 'text', 'value' => $guessed_group, 'label' => $question];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.10')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'you can now decide whether Froxlor should be reached via hostname/froxlor or directly via the hostname.';
|
||||
$question = '<strong>Do you want Froxlor to be reached directly via the hostname?:</strong>';
|
||||
$return['update_directlyviahostname_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_directlyviahostname'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.11-svn1')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'It is possible to enhance security with setting a regular expression to force your customers to enter more complex passwords.';
|
||||
$question = '<strong>Enter a regular expression to force a higher password complexity (leave empty for none):</strong>';
|
||||
$return['update_pwdregex_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_pwdregex'] = ['type' => 'text', 'value' => '', 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.11-svn3')) {
|
||||
if (Settings::Get('system.webserver') == 'lighttpd') {
|
||||
$has_preconfig = true;
|
||||
$description = 'As Froxlor can now handle perl, you have to specify where the perl executable is.';
|
||||
$question = '<strong>Path to perl (default \'/usr/bin/perl\'):</strong>';
|
||||
$return['update_perlpath_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_perlpath'] = ['type' => 'text', 'value' => '/usr/bin/perl', 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.12-svn1')) {
|
||||
if (Settings::Get('system.mod_fcgid') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want Froxlor to use FCGID itself too now.';
|
||||
$question = '<strong>Use FCGID for the Froxlor Panel?:</strong>';
|
||||
$return['update_fcgid_ownvhost_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_fcgid_ownvhost'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
|
||||
$question = '<strong>If \'yes\', please specify local user (has to exist, Froxlor does not add it automatically):</strong>';
|
||||
$return['update_fcgid_httpuser'] = ['type' => 'text', 'value' => 'froxlorlocal', 'label' => $question];
|
||||
$question = '<strong>If \'yes\', please specify local group (has to exist, Froxlor does not add it automatically):</strong>';
|
||||
$return['update_fcgid_httpgroup'] = ['type' => 'text', 'value' => 'froxlorlocal', 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.12-svn2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Many apache user will have problems using perl/CGI as the customer docroots are not within the suexec path. Froxlor provides a simple workaround for that.';
|
||||
$question = '<strong>Enable Apache/SuExec/Perl workaround?:</strong>';
|
||||
$return['update_perl_suexecworkaround_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_perl_suexecworkaround'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
|
||||
$description = '<strong>If \'yes\', please specify a path within the suexec path where Froxlor will create symlinks to customer perl-enabled paths:</strong>';
|
||||
$question = 'Path for symlinks (must be within suexec path):';
|
||||
$return['update_perl_suexecpath_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_perl_suexecpath'] = ['type' => 'text', 'value' => '/var/www/cgi-bin/', 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.12-svn4')) {
|
||||
if ((int) Settings::Get('system.awstats_enabled') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Due to different paths of awstats_buildstaticpages.pl and awstats.pl you can set a different path for awstats.pl now.';
|
||||
$question = '<strong>Path to \'awstats.pl\'?:</strong>';
|
||||
$return['update_awstats_awstatspath_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_awstats_awstatspath'] = ['type' => 'text', 'value' => Settings::Get('system.awstats_path'), 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.13-svn1')) {
|
||||
if ((int) Settings::Get('autoresponder.autoresponder_active') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor can now limit the number of autoresponder-entries for each user. Here you can set the value which will be available for each customer (Of course you can change the value for each customer separately after the update).';
|
||||
$question = '<strong>How many autoresponders should your customers be able to add?:</strong><br><small>-1 equals no limit</small>';
|
||||
$return['update_autoresponder_default_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_autoresponder_default'] = ['type' => 'number', 'value' => -1, 'min' => -1, 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.13.1')) {
|
||||
if ((int) Settings::Get('system.mod_fcgid_ownvhost') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You have FCGID for Froxlor itself activated. You can now specify a PHP-configuration for this.';
|
||||
$question = '<strong>Select Froxlor-vhost PHP configuration:</strong>';
|
||||
$return['update_defaultini_ownvhost_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$configs_array = \Froxlor\Http\PhpConfig::getPhpConfigs();
|
||||
$configs = '';
|
||||
foreach ($configs_array as $idx => $desc) {
|
||||
$configs[$idx] = $desc;
|
||||
}
|
||||
$return['update_defaultini_ownvhost'] = [
|
||||
'type' => 'select',
|
||||
'select_var' => $configs,
|
||||
'selected' => 1,
|
||||
'label' => $question
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.14-svn3')) {
|
||||
if ((int) Settings::Get('system.awstats_enabled') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'To have icons in AWStats statistic-pages please enter the path to AWStats icons folder.';
|
||||
$question = '<strong>Path to AWSTats icons folder:</strong>';
|
||||
$return['update_awstats_icons_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_awstats_icons'] = ['type' => 'text', 'value' => Settings::Get('system.awstats_icons'), 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.14-svn4')) {
|
||||
if ((int) Settings::Get('system.use_ssl') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now has the possibility to set \'SSLCertificateChainFile\' for the apache webserver.';
|
||||
$question = '<strong>Enter filename (leave empty for none):</strong>';
|
||||
$return['update_ssl_cert_chainfile_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_ssl_cert_chainfile'] = ['type' => 'text', 'value' => Settings::Get('system.ssl_cert_chainfile'), 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.14-svn6')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can now allow customers to use any of their domains as username for the login.';
|
||||
$question = '<strong>Do you want to enable domain-login for all customers?:</strong>';
|
||||
$return['update_allow_domain_login_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_allow_domain_login'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.14-svn10')) {
|
||||
$has_preconfig = true;
|
||||
$description = '<strong>This update removes the unsupported real-time option. Additionally the deprecated tables for navigation and cronscripts are removed, any modules using these tables need to be updated to the new structure!</strong>';
|
||||
$return['update_unsported_realtime_option_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.16-svn1')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now features support for php-fpm.';
|
||||
$question = '<strong>Do you want to enable php-fpm?:</strong>';
|
||||
$return['update_phpfpm_enabled_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_phpfpm_enabled'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
|
||||
$question = 'If \'yes\', please specify the configuration directory:';
|
||||
$return['update_phpfpm_configdir'] = ['type' => 'text', 'value' => "/etc/php-fpm.d/", 'label' => $question];
|
||||
$question = 'Please specify the temporary files directory:';
|
||||
$return['update_phpfpm_tmpdir'] = ['type' => 'text', 'value' => "/var/customers/tmp/", 'label' => $question];
|
||||
$question = 'Please specify the PEAR directory:';
|
||||
$return['update_phpfpm_peardir'] = ['type' => 'text', 'value' => "/usr/share/php/:/usr/share/php5/", 'label' => $question];
|
||||
$question = 'Please specify the php-fpm restart-command:';
|
||||
$return['update_phpfpm_reload'] = ['type' => 'text', 'value' => "/etc/init.d/php-fpm restart", 'label' => $question];
|
||||
$question = 'Please specify the php-fpm rocess manager control:';
|
||||
$return['update_phpfpm_pm'] = [
|
||||
'type' => 'select',
|
||||
'select_var' => [
|
||||
'static' => 'static',
|
||||
'dynamic' => 'dynamic'
|
||||
],
|
||||
'selected' => 'dynamic',
|
||||
'label' => $question
|
||||
];
|
||||
$question = 'Please specify the number of child processes:';
|
||||
$return['update_phpfpm_max_children'] = ['type' => 'number', 'value' => "2", 'label' => $question];
|
||||
$question = 'Please specify the number of requests per child before respawning:';
|
||||
$return['update_phpfpm_max_requests'] = ['type' => 'number', 'value' => "0", 'label' => $question];
|
||||
$description = '<em>The following settings are only required if you chose process manager = dynamic</em>';
|
||||
$return['update_phpfpm_dynamic_pm_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$question = 'Please specify the number of child processes created on startup:';
|
||||
$return['update_phpfpm_start_servers'] = ['type' => 'number', 'value' => "20", 'label' => $question];
|
||||
$question = 'Please specify the desired minimum number of idle server processes:';
|
||||
$return['update_phpfpm_min_spare_servers'] = ['type' => 'number', 'value' => "5", 'label' => $question];
|
||||
$question = 'Please specify the desired maximum number of idle server processes:';
|
||||
$return['update_phpfpm_max_spare_servers'] = ['type' => 'number', 'value' => "35", 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.16-svn2')) {
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want Froxlor to use PHP-FPM itself too now.';
|
||||
$question = '<strong>Use PHP-FPM for the Froxlor Panel?:</strong>';
|
||||
$return['update_phpfpm_enabled_ownvhost_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_phpfpm_enabled_ownvhost'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
|
||||
$question = '<strong>If \'yes\', please specify local user (has to exist, Froxlor does not add it automatically):</strong>';
|
||||
$return['update_phpfpm_httpuser'] = ['type' => 'text', 'value' => Settings::Get('system.mod_fcgid_httpuser'), 'label' => $question];
|
||||
$question = '<strong>If \'yes\', please specify local group (has to exist, Froxlor does not add it automatically):</strong>';
|
||||
$return['update_phpfpm_httpgroup'] = ['type' => 'text', 'value' => Settings::Get('system.mod_fcgid_httpgroup'), 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.17-svn1')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Select if you want to enable the web- and traffic-reports';
|
||||
$question = '<strong>Enable?:</strong>';
|
||||
$return['update_system_report_enable_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_system_report_enable'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
|
||||
$question = '<strong>If \'yes\', please specify a percentage value for web-usage when reports are to be sent:</strong>';
|
||||
$return['update_system_report_webmax'] = ['type' => 'number', 'value' => '90', 'label' => $question];
|
||||
$question = '<strong>If \'yes\', please specify a percentage value for traffic-usage when reports are to be sent:</strong>';
|
||||
$return['update_system_report_trafficmax'] = ['type' => 'number', 'value' => '90', 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.18-svn2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'As you can (obviously) see, Froxlor now comes with a new theme. You also have the possibility to switch back to "Classic" if you want to.';
|
||||
$return['update_default_theme_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$question = '<strong>Select default panel theme:</strong>';
|
||||
$themes = UI::getThemes();
|
||||
$sel_themes = [];
|
||||
foreach ($themes as $cur_theme) {
|
||||
$sel_themes[$cur_theme] = $cur_theme;
|
||||
}
|
||||
$return['update_default_theme'] = [
|
||||
'type' => 'select',
|
||||
'select_var' => $sel_themes,
|
||||
'selected' => 'Froxlor',
|
||||
'label' => $question
|
||||
];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.28-svn4')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'This version introduces a lot of profound changes:';
|
||||
$description .= '<br /><ul><li>Improving the whole template system</li><li>Full UTF-8 support</li><li><strong>Removing support for the former default theme \'Classic\'</strong></li></ul>';
|
||||
$description .= '<br /><br />Notice: This update will <strong>alter your Froxlor database to use UTF-8</strong> as default charset. ';
|
||||
$description .= 'Even though this is already tested, we <span class="red">strongly recommend</span> to ';
|
||||
$description .= 'test this update in a testing environment using your existing data.<br /><br />';
|
||||
$return['classic_theme_replacement_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$question = '<strong>Select your preferred Classic Theme replacement:</strong>';
|
||||
$themes = UI::getThemes();
|
||||
$sel_themes = [];
|
||||
foreach ($themes as $cur_theme) {
|
||||
$sel_themes[$cur_theme] = $cur_theme;
|
||||
}
|
||||
$return['classic_theme_replacement'] = [
|
||||
'type' => 'select',
|
||||
'select_var' => $sel_themes,
|
||||
'selected' => 'Froxlor',
|
||||
'label' => $question
|
||||
];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.28-svn6')) {
|
||||
|
||||
if (Settings::Get('system.webserver') == 'apache2') {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in order to use it.<br />';
|
||||
$description .= '<pre>LoadModule authz_core_module modules/mod_authz_core.so
|
||||
LoadModule authz_host_module modules/mod_authz_host.so</pre>';
|
||||
$question = '<strong>Do you want to enable the Apache-2.4 modification?:</strong>';
|
||||
$return['update_system_apache24_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_system_apache24'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
} elseif (Settings::Get('system.webserver') == 'nginx') {
|
||||
$has_preconfig = true;
|
||||
$description = 'The path to nginx\'s fastcgi_params file is now customizable.';
|
||||
$question = '<strong>Please enter full path to you nginx/fastcgi_params file (including filename):</strong>';
|
||||
$return['nginx_fastcgi_params_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['nginx_fastcgi_params'] = ['type' => 'text', 'value' => "/etc/nginx/fastcgi_params", 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.28-rc2')) {
|
||||
|
||||
$has_preconfig = true;
|
||||
|
||||
$description = 'This version adds an option to append the domain-name to the document-root for domains and subdomains.<br />';
|
||||
$description .= 'You can enable or disable this feature anytime from settings -> system settings.';
|
||||
$question = '<strong>Do you want to automatically append the domain-name to the documentroot of newly created domains?:</strong>';
|
||||
$return['update_system_documentroot_use_default_value_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_system_documentroot_use_default_value'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.28')) {
|
||||
|
||||
$has_preconfig = true;
|
||||
// just an information about the new sendmail parameter (#1134)
|
||||
$description = 'Froxlor changed the default parameter-set of sendmail (php.ini)<br />';
|
||||
$description .= 'sendmail_path = "/usr/sbin/sendmail -t <strong>-i</strong> -f {CUSTOMER_EMAIL}"<br /><br />';
|
||||
$description .= 'If you don\'t have any problems with sending mails, you don\'t need to change this';
|
||||
if (Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') {
|
||||
// information about removal of php's safe_mode
|
||||
$description .= '<br /><br />The php safe_mode flag has been removed as current versions of PHP do not support it anymore.<br /><br />';
|
||||
$description .= 'Please check your php-configurations and remove safe_mode-directives to avoid php notices/warnings.';
|
||||
}
|
||||
$return['update_default_sendmail_params_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.29-dev1')) {
|
||||
// we only need to ask if fcgid|php-fpm is enabled
|
||||
if (Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') {
|
||||
$has_preconfig = true;
|
||||
$description = 'Standard-subdomains can now be hidden from the php-configuration overview.';
|
||||
$question = '<strong>Do you want to hide the standard-subdomains (this can be changed in the settings any time)?:</strong>';
|
||||
$return['hide_stdsubdomains_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['hide_stdsubdomains'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.29-dev2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can now decide whether admins/customers are able to change the theme<br />';
|
||||
$return['allow_themechange_ac_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$question = '<strong>Allow theme-changing for admins:</strong>';
|
||||
$return['allow_themechange_a'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
|
||||
$question = '<strong>Allow theme-changing for customers:</strong>';
|
||||
$return['allow_themechange_c'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.29-dev3')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'There is now a possibility to specify AXFR servers for your bind zone-configuration';
|
||||
$question = '<strong>Enter a comma-separated list of AXFR servers or leave empty (default):</strong>';
|
||||
$return['system_afxrservers_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['system_afxrservers'] = ['type' => 'text', 'value' => '', 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.29-dev4')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'As customers can now specify ssl-certificate data for their domains, you need to specify where the generated files are stored';
|
||||
$question = '<strong>Specify the directory for customer ssl-certificates:</strong>';
|
||||
$return['system_customersslpath_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['system_customersslpath'] = ['type' => 'text', 'value' => '/etc/ssl/froxlor-custom/', 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.29.1-dev3')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'The build in logrotation-feature has been removed. Please follow the configuration-instructions for your system to enable logrotating again.';
|
||||
$return['update_removed_builtin_logrotate_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
}
|
||||
|
||||
// let the apache+fpm users know that they MUST change their config
|
||||
// for the domains / webserver to work after the update
|
||||
if (versionInUpdate($current_version, '0.9.30-dev1')) {
|
||||
if (Settings::Get('system.webserver') == 'apache2' && Settings::Get('phpfpm.enabled') == '1') {
|
||||
$has_preconfig = true;
|
||||
$description = 'The PHP-FPM implementation for apache2 has changed. Please look for the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) within /etc/apache2/ and change it as shown below:<br /><br />';
|
||||
$description .= '<pre class="code-block"><IfModule mod_fastcgi.c>
|
||||
FastCgiIpcDir /var/lib/apache2/fastcgi/
|
||||
<Location "/fastcgiphp">
|
||||
Order Deny,Allow
|
||||
Deny from All
|
||||
# Prevent accessing this path directly
|
||||
Allow from env=REDIRECT_STATUS
|
||||
</Location>
|
||||
</IfModule></pre>';
|
||||
$return['update_fpm_implementation_changed_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.31-dev2')) {
|
||||
if (Settings::Get('system.webserver') == 'apache2' && Settings::Get('phpfpm.enabled') == '1') {
|
||||
$has_preconfig = true;
|
||||
$description = 'The FPM socket directory is now a setting in froxlor. Its default is <b>/var/lib/apache2/fastcgi/</b>.<br/>If you are using <b>/var/run/apache2</b> in the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) please correct this path accordingly';
|
||||
$return['update_fpm_socket_directory_changed_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.31-dev4')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'The template-variable {PASSWORD} has been replaced with {LINK}. Please update your password reset templates!';
|
||||
$return['update_template_var_password_changed_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.31-dev5')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can enable/disable error-reporting for admins and customers!';
|
||||
$return['update_error_report_admin_customer_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
|
||||
$question = '<strong>Do you want to enable error-reporting for admins? (default: yes):</strong>';
|
||||
$return['update_error_report_admin'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
|
||||
$question = '<strong>Do you want to enable error-reporting for customers? (default: no):</strong>';
|
||||
$return['update_error_report_customer'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.31-rc2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can enable/disable the display/usage of the news-feed for admins';
|
||||
$question = '<strong>Do you want to enable the news-feed for admins? (default: yes):</strong>';
|
||||
$return['update_admin_news_feed_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['update_admin_news_feed'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.32-dev2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'To enable logging of the mail-traffic, you need to set the following settings accordingly';
|
||||
$question = '<strong>Do you want to enable the traffic collection for mail? (default: yes):</strong>';
|
||||
$return['mailtraffic_enabled_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['mailtraffic_enabled'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
|
||||
|
||||
$question = '<strong>Mail Transfer Agent</strong>';
|
||||
$return['mtaserver'] = [
|
||||
'type' => 'select',
|
||||
'select_var' => [
|
||||
'postfix' => 'Postfix',
|
||||
'exim4' => 'Exim4'
|
||||
],
|
||||
'selected' => 'postfix',
|
||||
'label' => $question
|
||||
];
|
||||
|
||||
$question = 'Logfile for your MTA:';
|
||||
$return['mtalog'] = ['type' => 'text', 'value' => "/var/log/mail.log", 'label' => $question];
|
||||
|
||||
$question = '<strong>Mail Delivery Agent</strong>';
|
||||
$return['mdaserver'] = [
|
||||
'type' => 'select',
|
||||
'select_var' => [
|
||||
'dovecot' => 'Dovecot',
|
||||
'courier' => 'Courier'
|
||||
],
|
||||
'selected' => 'dovecot',
|
||||
'label' => $question
|
||||
];
|
||||
|
||||
$question = 'Logfile for your MDA:';
|
||||
$return['mdalog'] = ['type' => 'text', 'value' => "/var/log/mail.log", 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.32-dev5')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now generates a cron-configuration file for the cron-daemon. Please set a filename which will be included automatically by your crond (e.g. files in /etc/cron.d/)';
|
||||
$question = '<strong>Path to the cron-service configuration-file.</strong> This file will be updated regularly and automatically by froxlor.<br />Note: please <b>be sure</b> to use the same filename as for the main froxlor cronjob (default: /etc/cron.d/froxlor)!';
|
||||
$return['crondfile_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['crondfile'] = ['type' => 'text', 'value' => "/etc/cron.d/froxlor", 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.32-dev6')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'In order for the new cron.d file to work properly, we need to know about the cron-service reload command.';
|
||||
$question = '<strong>Please specify the reload-command of your cron-daemon</strong> (default: /etc/init.d/cron reload)';
|
||||
$return['crondreload_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['crondreload'] = ['type' => 'text', 'value' => "/etc/init.d/cron reload", 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.32-rc2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.';
|
||||
$question = '<strong>Please specify the command to execute cronscripts</strong> (default: "/usr/bin/nice -n 5 /usr/bin/php -q")';
|
||||
$return['croncmdline_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['croncmdline'] = ['type' => 'text', 'value' => "/usr/bin/nice -n 5 /usr/bin/php -q", 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.33-dev1')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can enable/disable the display/usage of the custom newsfeed for customers.';
|
||||
$question = '<strong>Do you want to enable the custom newsfeed for customer? (default: no):</strong>';
|
||||
$return['customer_show_news_feed_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['customer_show_news_feed'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
|
||||
$question = '<strong>You have to set the URL for your RSS-feed here, if you have chosen to enable the custom newsfeed on the customer-dashboard:</strong>';
|
||||
$return['customer_news_feed_url'] = ['type' => 'text', 'value' => "", 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.33-dev2')) {
|
||||
// only if bind is used - if not the default will be set, which is '0' (off)
|
||||
if (Settings::get('system.bind_enable') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can enable/disable the generation of the bind-zone / config for the system hostname.';
|
||||
$question = '<strong>Do you want to generate a bind-zone for the system-hostname? (default: no):</strong>';
|
||||
$return['dns_createhostnameentry_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['dns_createhostnameentry'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.33-rc2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want to receive an e-mail on cronjob errors. Keep in mind that this can lead to an e-mail being sent every 5 minutes.';
|
||||
$question = '<strong>Do you want to receive cron-errors via mail? (default: no):</strong>';
|
||||
$return['system_send_cron_errors_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['system_send_cron_errors'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.34-dev3')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now requires the PHP mbstring-extension as we need to be multibyte-character safe in some cases<br><br>';
|
||||
$description .= '<strong>PHP mbstring</strong> is currently: ';
|
||||
if (!extension_loaded('mbstring')) {
|
||||
$description .= '<span class="red">not installed/loaded</span>';
|
||||
$description .= '<br>Please install the PHP mbstring extension in order to finish the update';
|
||||
} else {
|
||||
$description .= '<span class="green">installed/loaded</span>';
|
||||
}
|
||||
$return['update_php_mbstring_extension_installed_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201603070')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want to enable or disable our Let\'s Encrypt implementation.<br />Please remember that you need to go through the webserver-configuration when enabled because this feature needs a special configuration.';
|
||||
$question = '<strong>Do you want to enable Let\'s Encrypt? (default: yes):</strong>';
|
||||
$return['enable_letsencrypt_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['enable_letsencrypt'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201604270')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want to enable or disable our backup function.';
|
||||
$question = '<strong>Do you want to enable Backup? (default: no):</strong>';
|
||||
$return['enable_backup_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['enable_backup'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201605090')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want to enable or disable our DNS editor';
|
||||
$question = '<strong>Do you want to enable the DNS editor? (default: no):</strong>';
|
||||
$return['enable_dns_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['enable_dns'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201605170')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now supports the dns-daemon Power-DNS, you can chose between bind and powerdns now.';
|
||||
$return['new_dns_daemon_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$question = '<strong>Select dns-daemon you want to use:</strong>';
|
||||
$return['new_dns_daemon'] = [
|
||||
'type' => 'select',
|
||||
'select_var' => [
|
||||
'bind' => 'Bind9',
|
||||
'pdns' => 'PowerDNS'
|
||||
],
|
||||
'selected' => 'bind',
|
||||
'label' => $question
|
||||
];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201609120')) {
|
||||
if (Settings::Get('system.leenabled') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can now customize the path to your acme.conf file (global alias for Let\'s Encrypt). If you already set up Let\'s Encrypt and the acme.conf file, please set this to the complete path to the file!';
|
||||
$question = '<strong>Path to the acme.conf alias-file.</strong>';
|
||||
$return['acmeconffile_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['acmeconffile'] = ['type' => 'text', 'value' => "/etc/apache2/conf-enabled/acme.conf", 'label' => $question];
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201609200')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Specify SMTP settings which froxlor should use to send mail (optional)';
|
||||
$return['update_mail_via_smtp_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$question = '<strong>Enable sending mails via SMTP?</strong>';
|
||||
$return['smtp_enable'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
$question .= '<strong>Enable sending mails via SMTP?</strong>';
|
||||
$return['smtp_host'] = ['type' => 'text', 'value' => 'localhost', 'label' => $question];
|
||||
$question .= '<strong>TCP port to connect to?</strong>';
|
||||
$return['smtp_port'] = ['type' => 'number', 'value' => '25', 'label' => $question];
|
||||
$question .= '<strong>Enable TLS encryption?</strong>';
|
||||
$return['smtp_usetls'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
|
||||
$question .= '<strong>Enable SMTP authentication?</strong>';
|
||||
$return['smtp_auth'] = ['type' => 'checkbox', 'value' => 1, 'checked' => 1, 'label' => $question];
|
||||
$question .= '<strong>SMTP user?</strong>';
|
||||
$return['smtp_user'] = ['type' => 'text', 'value' => '', 'label' => $question];
|
||||
$question .= '<strong>SMTP password?</strong>';
|
||||
$return['smtp_user'] = ['type' => 'password', 'value' => '', 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201705050')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'DEBIAN/UBUNTU ONLY: Enable usage of libnss-extrausers as alternative to libnss-mysql (NOTE: if enabled, go through the configuration steps right after the update!!!)';
|
||||
$question = '<strong>Enable usage of libnss-extrausers?</strong>';
|
||||
$return['system_nssextrausers_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['system_nssextrausers'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201712310')) {
|
||||
if (Settings::Get('system.leenabled') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Chose whether you want to disable the Let\'s Encrypt selfcheck as it causes false positives for some configurations.';
|
||||
$question = '<strong>Disable Let\'s Encrypt self-check?</strong>';
|
||||
$return['system_disable_le_selfcheck_note'] = ['type' => 'infotext', 'value' => $description];
|
||||
$return['system_disable_le_selfcheck'] = ['type' => 'checkbox', 'value' => 1, 'label' => $question];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,25 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Install
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license http://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
use Froxlor\FroxlorLogger;
|
||||
@@ -46,8 +52,6 @@ if (\Froxlor\Froxlor::isFroxlor()) {
|
||||
$update_tasks = [];
|
||||
$task_counter = 0;
|
||||
|
||||
include_once(\Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/updates/froxlor/0.9/update_0.9.inc.php'));
|
||||
include_once(\Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/updates/froxlor/0.10/update_0.10.inc.php'));
|
||||
include_once(\Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/updates/froxlor/0.11/update_0.11.inc.php'));
|
||||
|
||||
// Check Froxlor - database integrity (only happens after all updates are done, so we know the db-layout is okay)
|
||||
|
||||
48
lib/Froxlor/Cli/CliCommand.php
Normal file
48
lib/Froxlor/Cli/CliCommand.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license http://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
namespace Froxlor\Cli;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Froxlor\Froxlor;
|
||||
|
||||
class CliCommand extends Command
|
||||
{
|
||||
|
||||
protected function validateRequirements(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
if (!file_exists(Froxlor::getInstallDir() . '/lib/userdata.inc.php')) {
|
||||
$output->writeln("<error>Could not find froxlor's userdata.inc.php file. You should use this script only with an installed froxlor system.</>");
|
||||
return self::INVALID;
|
||||
}
|
||||
if (Froxlor::hasUpdates() || Froxlor::hasDbUpdates()) {
|
||||
$output->writeln("<error>It seems that the froxlor files have been updated. Please login and finish the update procedure.</>");
|
||||
return self::INVALID;
|
||||
}
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license http://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
namespace Froxlor\Cli;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
@@ -15,21 +37,7 @@ use Froxlor\SImExporter;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Config\ConfigParser;
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2022 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2018-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
*
|
||||
*/
|
||||
final class ConfigServices extends Command
|
||||
final class ConfigServices extends CliCommand
|
||||
{
|
||||
|
||||
protected function configure()
|
||||
@@ -37,33 +45,37 @@ final class ConfigServices extends Command
|
||||
$this->setName('froxlor:config-services');
|
||||
$this->setDescription('Configure system services');
|
||||
$this->addOption('create', 'c', InputOption::VALUE_NONE, 'Create a services list configuration for the --apply option.')
|
||||
->addOption('apply', 'a', InputOption::VALUE_REQUIRED, 'Configure your services by given configuration file. To create one run the command with the --create option.')
|
||||
->addOption('apply', 'a', InputOption::VALUE_REQUIRED, 'Configure your services by given configuration file/string. To create one run the command with the --create option.')
|
||||
->addOption('list', 'l', InputOption::VALUE_NONE, 'Output the services that are going to be configured using a given config file (--apply option). No services will be configured.')
|
||||
->addOption('daemon', 'd', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'When used with --apply you can specify one or multiple daemons. These will be the only services that get configured.')
|
||||
->addOption('import-settings', 'i', InputOption::VALUE_REQUIRED, 'Import settings from another froxlor installation. This can be done standalone or in addition to --apply.');
|
||||
->addOption('import-settings', 'i', InputOption::VALUE_REQUIRED, 'Import settings from another froxlor installation. This can be done standalone or in addition to --apply.')
|
||||
->addOption('yes-to-all', 'A', InputOption::VALUE_NONE, 'Install packages without asking questions');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
global $lng;
|
||||
|
||||
if (!file_exists(Froxlor::getInstallDir() . '/lib/userdata.inc.php')) {
|
||||
$output->writeln("<error>Could not find froxlor's userdata.inc.php file. You should use this script only with an installed froxlor system.</>");
|
||||
$result = self::SUCCESS;
|
||||
|
||||
$result = $this->validateRequirements($input, $output);
|
||||
|
||||
if ($result == self::SUCCESS && $input->getOption('import-settings') == false && $input->getOption('create') == false && $input->getOption('apply') == false) {
|
||||
$output->writeln('<error>No option given to do something, exiting.</>');
|
||||
return self::INVALID;
|
||||
}
|
||||
|
||||
if ($input->getOption('import-settings') == false && $input->getOption('create') == false && $input->getOption('apply') == false) {
|
||||
$output->writeln('<error>No option given to do something, exiting.</>');
|
||||
return self::INVALID;
|
||||
if ($result == self::SUCCESS && $input->getOption('yes-to-all')) {
|
||||
putenv("DEBIAN_FRONTEND=noninteractive");
|
||||
exec("echo 'APT::Get::Assume-Yes \"true\";' > /tmp/_tmp_apt.conf");
|
||||
putenv("APT_CONFIG=/tmp/_tmp_apt.conf");
|
||||
}
|
||||
|
||||
include_once Froxlor::getInstallDir() . 'lng/english.lng.php';
|
||||
include_once Froxlor::getInstallDir() . 'lng/lng_references.php';
|
||||
|
||||
$result = self::SUCCESS;
|
||||
|
||||
// import settings if given
|
||||
if ($input->getOption('import-settings')) {
|
||||
if ($result == self::SUCCESS && $input->getOption('import-settings')) {
|
||||
$result = $this->importSettings($input, $output);
|
||||
}
|
||||
|
||||
@@ -79,6 +91,12 @@ final class ConfigServices extends Command
|
||||
}
|
||||
}
|
||||
|
||||
if ($input->getOption('yes-to-all')) {
|
||||
putenv("DEBIAN_FRONTEND");
|
||||
unlink("/tmp/_tmp_apt.conf");
|
||||
putenv("APT_CONFIG");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -112,7 +130,7 @@ final class ConfigServices extends Command
|
||||
// get configparser object
|
||||
$dist = new ConfigParser($_distribution);
|
||||
// get distro-info
|
||||
$dist_display = $this->getCompleteDistroName($dist);
|
||||
$dist_display = $dist->getCompleteDistroName();
|
||||
// store in tmp array
|
||||
$distributions_select_data[$dist_display] = str_replace(".xml", "", strtolower(basename($_distribution)));
|
||||
|
||||
@@ -152,6 +170,10 @@ final class ConfigServices extends Command
|
||||
$default_daemon = "";
|
||||
$table_rows = [];
|
||||
$valid_options = [];
|
||||
if ($si != 'system') {
|
||||
$table_rows[] = ['x', 'No'];
|
||||
$valid_options[] = 'x';
|
||||
}
|
||||
foreach ($daemons as $di => $dd) {
|
||||
$title = $dd->title;
|
||||
if ($dd->default) {
|
||||
@@ -161,10 +183,6 @@ final class ConfigServices extends Command
|
||||
$table_rows[] = [$di, $title];
|
||||
$valid_options[] = $di;
|
||||
}
|
||||
if ($si != 'system') {
|
||||
$table_rows[] = ['x', 'No'];
|
||||
$valid_options[] = 'x';
|
||||
}
|
||||
$io->table(
|
||||
['Value', 'Name'],
|
||||
$table_rows
|
||||
@@ -213,28 +231,37 @@ final class ConfigServices extends Command
|
||||
{
|
||||
$applyFile = $input->getOption('apply');
|
||||
|
||||
if (strtoupper(substr($applyFile, 0, 4)) == 'HTTP') {
|
||||
$output->writeln("Config file seems to be an URL, trying to download");
|
||||
$target = "/tmp/froxlor-config-" . time() . ".json";
|
||||
if (@file_exists($target)) {
|
||||
@unlink($target);
|
||||
}
|
||||
$this->downloadFile($applyFile, $target);
|
||||
$applyFile = $target;
|
||||
}
|
||||
if (!is_file($applyFile)) {
|
||||
$output->writeln('<error>Given config file is not a file</>');
|
||||
return self::INVALID;
|
||||
} elseif (!file_exists($applyFile)) {
|
||||
$output->writeln('<error>Given config file cannot be found (' . $applyFile . ')</>');
|
||||
return self::INVALID;
|
||||
} elseif (!is_readable($applyFile)) {
|
||||
$output->writeln('<error>Given config file cannot be read (' . $applyFile . ')</>');
|
||||
return self::INVALID;
|
||||
// check if plain JSON
|
||||
$decoded_config = json_decode($applyFile);
|
||||
$skipFileCheck = false;
|
||||
if (json_last_error() == JSON_ERROR_NONE) {
|
||||
$skipFileCheck = true;
|
||||
}
|
||||
|
||||
$config = file_get_contents($applyFile);
|
||||
$decoded_config = json_decode($config, true);
|
||||
if (!$skipFileCheck) {
|
||||
if (strtoupper(substr($applyFile, 0, 4)) == 'HTTP') {
|
||||
$output->writeln("Config file seems to be an URL, trying to download");
|
||||
$target = "/tmp/froxlor-config-" . time() . ".json";
|
||||
if (@file_exists($target)) {
|
||||
@unlink($target);
|
||||
}
|
||||
$this->downloadFile($applyFile, $target);
|
||||
$applyFile = $target;
|
||||
}
|
||||
if (!is_file($applyFile)) {
|
||||
$output->writeln('<error>Given config file is not a file</>');
|
||||
return self::INVALID;
|
||||
} elseif (!file_exists($applyFile)) {
|
||||
$output->writeln('<error>Given config file cannot be found (' . $applyFile . ')</>');
|
||||
return self::INVALID;
|
||||
} elseif (!is_readable($applyFile)) {
|
||||
$output->writeln('<error>Given config file cannot be read (' . $applyFile . ')</>');
|
||||
return self::INVALID;
|
||||
}
|
||||
|
||||
$config = file_get_contents($applyFile);
|
||||
$decoded_config = json_decode($config, true);
|
||||
}
|
||||
|
||||
if ($input->getOption('list') != false) {
|
||||
$table_rows = [];
|
||||
@@ -416,22 +443,6 @@ final class ConfigServices extends Command
|
||||
return $replace_arr;
|
||||
}
|
||||
|
||||
private function getCompleteDistroName($cparser)
|
||||
{
|
||||
// get distro-info
|
||||
$dist_display = $cparser->distributionName;
|
||||
if ($cparser->distributionCodename != '') {
|
||||
$dist_display .= " " . $cparser->distributionCodename;
|
||||
}
|
||||
if ($cparser->distributionVersion != '') {
|
||||
$dist_display .= " (" . $cparser->distributionVersion . ")";
|
||||
}
|
||||
if ($cparser->deprecated) {
|
||||
$dist_display .= " [deprecated]";
|
||||
}
|
||||
return $dist_display;
|
||||
}
|
||||
|
||||
private function importSettings(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$importFile = $input->getOption('import-settings');
|
||||
|
||||
@@ -1,8 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license http://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
namespace Froxlor\Cli;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
@@ -11,21 +33,7 @@ use Froxlor\FileDir;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\Database\Database;
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2022 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2018-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
*
|
||||
*/
|
||||
final class PhpSessionclean extends Command
|
||||
final class PhpSessionclean extends CliCommand
|
||||
{
|
||||
|
||||
protected function configure()
|
||||
@@ -37,23 +45,24 @@ final class PhpSessionclean extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if (!file_exists(Froxlor::getInstallDir() . '/lib/userdata.inc.php')) {
|
||||
$output->writeln("<error>Could not find froxlor's userdata.inc.php file. You should use this script only with an installed froxlor system.</>");
|
||||
return self::INVALID;
|
||||
}
|
||||
$result = $this->validateRequirements($input, $output);
|
||||
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
if ($input->hasArgument('max-lifetime') && is_numeric($input->getArgument('max-lifetime')) && $input->getArgument('max-lifetime') > 0) {
|
||||
$this->cleanSessionfiles((int)$input->getArgument('max-lifetime'));
|
||||
if ($result == self::SUCCESS) {
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
if ($input->hasArgument('max-lifetime') && is_numeric($input->getArgument('max-lifetime')) && $input->getArgument('max-lifetime') > 0) {
|
||||
$this->cleanSessionfiles((int)$input->getArgument('max-lifetime'));
|
||||
} else {
|
||||
// use default max-lifetime value
|
||||
$this->cleanSessionfiles();
|
||||
}
|
||||
$result = self::SUCCESS;
|
||||
} else {
|
||||
// use default max-lifetime value
|
||||
$this->cleanSessionfiles();
|
||||
// php-fpm not enabled
|
||||
$output->writeln('<comment>PHP-FPM not enabled for this installation.</comment>');
|
||||
$result = self::INVALID;
|
||||
}
|
||||
return self::SUCCESS;
|
||||
}
|
||||
// php-fpm not enabled
|
||||
$output->writeln('<comment>PHP-FPM not enabled for this installation.</comment>');
|
||||
return self::INVALID;
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function cleanSessionfiles(int $maxlifetime = 1440)
|
||||
|
||||
@@ -1,30 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license http://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
namespace Froxlor\Cli;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Froxlor\Froxlor;
|
||||
use Froxlor\Database\Database;
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2022 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2018-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
*
|
||||
*/
|
||||
final class SwitchServerIp extends Command
|
||||
final class SwitchServerIp extends CliCommand
|
||||
{
|
||||
|
||||
protected function configure()
|
||||
@@ -37,21 +44,18 @@ final class SwitchServerIp extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if (!file_exists(Froxlor::getInstallDir() . '/lib/userdata.inc.php')) {
|
||||
$output->writeln("<error>Could not find froxlor's userdata.inc.php file. You should use this script only with an installed froxlor system.</>");
|
||||
return self::INVALID;
|
||||
}
|
||||
$result = self::SUCCESS;
|
||||
|
||||
if ($input->getOption('list') == false && $input->getOption('switch') == false) {
|
||||
$result = $this->validateRequirements($input, $output);
|
||||
|
||||
if ($result == self::SUCCESS && $input->getOption('list') == false && $input->getOption('switch') == false) {
|
||||
$output->writeln('<error>Either --list or --switch option must be provided. Nothing to do, exiting.</>');
|
||||
return self::INVALID;
|
||||
$result = self::INVALID;
|
||||
}
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$result = self::SUCCESS;
|
||||
|
||||
if ($input->getOption('list')) {
|
||||
if ($result == self::SUCCESS && $input->getOption('list')) {
|
||||
|
||||
$sel_stmt = Database::prepare("SELECT * FROM panel_ipsandports ORDER BY ip ASC, port ASC");
|
||||
Database::pexecute($sel_stmt);
|
||||
@@ -67,7 +71,7 @@ final class SwitchServerIp extends Command
|
||||
);
|
||||
}
|
||||
|
||||
if ($input->getOption('switch')) {
|
||||
if ($result == self::SUCCESS && $input->getOption('switch')) {
|
||||
$result = $this->switchIPs($input, $output);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,19 +2,25 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package System
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license http://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
const TABLE_FTP_GROUPS = 'ftp_groups';
|
||||
@@ -37,7 +43,6 @@ const TABLE_PANEL_TEMPLATES = 'panel_templates';
|
||||
const TABLE_PANEL_TRAFFIC = 'panel_traffic';
|
||||
const TABLE_PANEL_TRAFFIC_ADMINS = 'panel_traffic_admins';
|
||||
const TABLE_PANEL_DISKSPACE = 'panel_diskspace';
|
||||
const TABLE_PANEL_LANGUAGE = 'panel_languages';
|
||||
const TABLE_PANEL_IPSANDPORTS = 'panel_ipsandports';
|
||||
const TABLE_PANEL_LOG = 'panel_syslog';
|
||||
const TABLE_PANEL_PHPCONFIGS = 'panel_phpconfigs';
|
||||
|
||||
Reference in New Issue
Block a user