Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` MODIFY `ssl_ca_file` mediumtext NOT NULL"); Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` MODIFY `ssl_cert_chainfile` mediumtext NOT NULL"); lastStepStatus(0); updateToVersion('0.9.34-dev2'); } if (isFroxlorVersion('0.9.34-dev2')) { showUpdateStep("Updating from 0.9.34-dev2 to 0.9.34-dev3", false); $do_update = true; showUpdateStep("Checking for required PHP mbstring-extension"); if (!extension_loaded('mbstring')) { $do_update = false; lastStepStatus(2, 'not installed'); } else { lastStepStatus(0); } if ($do_update) { updateToVersion('0.9.34-dev3'); } } if (isFroxlorVersion('0.9.34-dev3')) { showUpdateStep("Updating from 0.9.34-dev3 to 0.9.34-dev4", false); showUpdateStep("Adding field umask to phpconfig table"); Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `mod_fcgid_umask` varchar(15) NOT NULL DEFAULT '022' AFTER `mod_fcgid_maxrequests`"); lastStepStatus(0); updateToVersion('0.9.34-dev4'); } if (isFroxlorVersion('0.9.34-dev4')) { showUpdateStep("Updating from 0.9.34-dev4 to 0.9.34 final"); lastStepStatus(0); updateToVersion('0.9.34'); }
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_idle_timeout', '30');"); } // Get FastCGI timeout setting if available $handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'idle_timeout';"); // If timeout is set then skip if ($db->num_rows($handle) < 1) { $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'idle_timeout', '30');"); } updateToVersion('0.9.27-svn2'); } if (isFroxlorVersion('0.9.27-svn2')) { showUpdateStep("Updating from 0.9.27-svn2 to 0.9.27-rc1"); lastStepStatus(0); updateToVersion('0.9.27-rc1'); } if (isFroxlorVersion('0.9.27-rc1')) { showUpdateStep("Updating from 0.9.27-rc1 to 0.9.27"); lastStepStatus(0); updateToVersion('0.9.27'); } if (isFroxlorVersion('0.9.27')) { showUpdateStep("Updating from 0.9.27 to 0.9.28-svn1"); lastStepStatus(0); // Get AliasconfigDir setting if available $handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'aliasconfigdir';"); // If AliasconfigDir is set then skip if ($db->num_rows($handle) < 1) { $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'aliasconfigdir', '/var/www/php-fpm/');"); } updateToVersion('0.9.28-svn1'); }
<?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 <*****@*****.**> (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Install * */ if (!defined('AREA') || defined('AREA') && AREA != 'admin' || !isset($userinfo['loginname']) || isset($userinfo['loginname']) && $userinfo['loginname'] == '') { header('Location: ../../../index.php'); exit; } $updateto = '0.9-r0'; $frontend = 'froxlor'; showUpdateStep("Upgrading SysCP " . Settings::Get('panel.version') . " to Froxlor " . $updateto, false); updateToVersion($updateto); // add field frontend Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` SET\n\t`settinggroup` = 'panel',\n\t`varname` = 'frontend',\n\t`value` = 'froxlor'"); Settings::Set('panel.frontend', $frontend);
Settings::AddNew("system.mail_smtp_port", $smtp_port); Settings::AddNew("system.mail_smtp_usetls", $smtp_usetls); Settings::AddNew("system.mail_smtp_auth", $smtp_useauth); Settings::AddNew("system.mail_smtp_user", $smtp_user); Settings::AddNew("system.mail_smtp_passwd", $smtp_passwd); lastStepStatus(0); updateToDbVersion('201609200'); } if (isDatabaseVersion('201609200')) { showUpdateStep("Changing tables to be more mysql strict-mode compatible"); Database::query("ALTER TABLE `" . TABLE_MAIL_VIRTUAL . "` CHANGE `destination` `destination` TEXT NOT NULL DEFAULT '';"); Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` CHANGE `registration_date` `registration_date` DATE NULL DEFAULT NULL;"); Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` CHANGE `termination_date` `termination_date` DATE NULL DEFAULT NULL;"); lastStepStatus(0); updateToDbVersion('201609240'); } if (isDatabaseVersion('201609240')) { showUpdateStep("Add HSTS settings for froxlor-vhost"); Settings::AddNew("system.hsts_maxage", 0); Settings::AddNew("system.hsts_incsub", 0); Settings::AddNew("system.hsts_preload", 0); lastStepStatus(0); showUpdateStep("Settings HSTS default values for all domains (deactivated)"); Database::query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `hsts_sub` = '0', `hsts_preload` = '0';"); lastStepStatus(0); updateToDbVersion('201610070'); } if (isFroxlorVersion('0.9.37')) { showUpdateStep("Updating from 0.9.37 to 0.9.38-rc1", false); updateToVersion('0.9.38-rc1'); }
updateToVersion('0.9.32'); } if (isFroxlorVersion('0.9.32')) { showUpdateStep("Updating from 0.9.32 to 0.9.33-dev1", false); showUpdateStep("Adding settings for custom newsfeed on customer-dashboard"); Settings::AddNew("customer.show_news_feed", isset($_POST['customer_show_news_feed']) ? (int) $_POST['customer_show_news_feed'] : '0'); Settings::AddNew("customer.news_feed_url", isset($_POST['customer_news_feed_url']) ? $_POST['customer_news_feed_url'] : ''); lastStepStatus(0); updateToVersion('0.9.33-dev1'); } if (isFroxlorVersion('0.9.33-dev1')) { showUpdateStep("Updating from 0.9.33-dev1 to 0.9.33-dev2", false); showUpdateStep("Adding settings for hostname-dns-entry"); Settings::AddNew("system.dns_createhostnameentry", isset($_POST['dns_createhostnameentry']) ? (int) $_POST['dns_createhostnameentry'] : '0'); lastStepStatus(0); updateToVersion('0.9.33-dev2'); } if (isFroxlorVersion('0.9.33-dev2')) { showUpdateStep("Updating from 0.9.33-dev2 to 0.9.33-dev3", false); showUpdateStep("Adding settings for password-generation options"); Settings::AddNew("panel.password_alpha_lower", '1'); Settings::AddNew("panel.password_alpha_upper", '1'); Settings::AddNew("panel.password_numeric", '0'); Settings::AddNew("panel.password_special_char_required", '0'); Settings::AddNew("panel.password_special_char", '!?<>§$%&+#=@'); lastStepStatus(0); showUpdateStep("Adding settings for fpm-apache2.4-mod_proxy integration"); Settings::AddNew("phpfpm.use_mod_proxy", '0'); lastStepStatus(0); updateToVersion('0.9.33-dev3'); }
lastStepStatus(0); // Get FastCGI timeout setting if available $handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' AND `varname` = 'mod_fcgid_idle_timeout';"); // If timeout is set then skip if ($db->num_rows($handle) < 1) { $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_idle_timeout', '30');"); } // Get FastCGI timeout setting if available $handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'idle_timeout';"); // If timeout is set then skip if ($db->num_rows($handle) < 1) { $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'idle_timeout', '30');"); } updateToVersion('0.9.27-svn2'); } if (isFroxlorVersion('0.9.27-svn2')) { showUpdateStep("Updating from 0.9.27-svn2 to 0.9.27-rc1"); lastStepStatus(0); updateToVersion('0.9.27-rc1'); } if (isFroxlorVersion('0.9.27-rc1')) { showUpdateStep("Updating from 0.9.27-rc1 to 0.9.27"); lastStepStatus(0); // Add the external access column (see ticket #814); $db->query('ALTER TABLE froxlor.panel_databases ADD allow_external_access INT(1) DEFAULT 0'); $db->query('ALTER TABLE froxlor.panel_domains ADD special_phpsettings TEXT DEFAULT ""'); // Add php versions $db->query('ALTER TABLE froxlor.panel_domains ADD php_version VARCHAR(100) DEFAULT "5.3.22"'); $db->query('ALTER TABLE froxlor.panel_customers ADD nitrado_service_type VARCHAR(50) DEFAULT "beginner"'); updateToVersion('0.9.27'); }
lastStepStatus(0); updateToVersion('0.9.35.1'); } if (isFroxlorVersion('0.9.35.1') && isDatabaseVersion('201603150')) { showUpdateStep("Adding new backup settings and cron"); $enable_backup = isset($_POST['enable_backup']) ? (int) $_POST['enable_backup'] : "0"; Settings::AddNew("system.backupenabled", $enable_backup); $stmt = Database::prepare("\n\t\tINSERT INTO `" . TABLE_PANEL_CRONRUNS . "` SET\n\t\t`module` = 'froxlor/backup',\n\t\t`cronfile` = 'backup',\n\t\t`interval` = '1 DAY',\n\t\t`desc_lng_key` = 'cron_backup',\n\t\t`lastrun` = 0,\n\t\t`isactive` = :isactive"); Database::pexecute($stmt, array('isactive' => $enable_backup)); lastStepStatus(0); updateToDbVersion('201604270'); } if (isFroxlorVersion('0.9.35.1')) { showUpdateStep("Updating from 0.9.35.1 to 0.9.36 final"); lastStepStatus(0); updateToVersion('0.9.36'); } if (isDatabaseVersion('201604270')) { showUpdateStep("Adding new dns related tables and settings"); $enable_dns = isset($_POST['enable_dns']) ? (int) $_POST['enable_dns'] : "0"; Settings::AddNew("system.dnsenabled", $enable_dns); Database::query("DROP TABLE IF EXISTS `domain_dns_entries`;"); $sql = "CREATE TABLE `domain_dns_entries` (\n\t\t`id` int(20) NOT NULL auto_increment,\n\t\t`domain_id` int(15) NOT NULL,\n\t\t`record` varchar(255) NOT NULL,\n\t\t`type` varchar(10) NOT NULL DEFAULT 'A',\n\t\t`content` text NOT NULL,\n\t\t`ttl` int(11) NOT NULL DEFAULT '18000',\n\t\t`prio` int(11) DEFAULT NULL,\n\t\tPRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;"; Database::query($sql); lastStepStatus(0); updateToDbVersion('201605090'); } if (isDatabaseVersion('201605090')) { showUpdateStep("Adjusting SPF record setting"); $current_spf = Settings::Get('spf.spf_entry'); // @ IN TXT "v=spf1 a mx -all"
Settings::AddNew("system.apacheitksupport", '0'); lastStepStatus(0); showUpdateStep("Increase text-field size of domain-ssl table"); Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` MODIFY `ssl_cert_file` mediumtext NOT NULL"); Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` MODIFY `ssl_key_file` mediumtext NOT NULL"); Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` MODIFY `ssl_ca_file` mediumtext NOT NULL"); Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` MODIFY `ssl_cert_chainfile` mediumtext NOT NULL"); lastStepStatus(0); updateToVersion('0.9.34-dev2'); } if (isFroxlorVersion('0.9.34-dev2')) { showUpdateStep("Updating from 0.9.34-dev2 to 0.9.34-dev3", false); $do_update = true; showUpdateStep("Checking for required PHP mbstring-extension"); if (!extension_loaded('mbstring')) { $do_update = false; lastStepStatus(2, 'not installed'); } else { lastStepStatus(0); } if ($do_update) { updateToVersion('0.9.34-dev3'); } } if (isFroxlorVersion('0.9.34-dev3')) { showUpdateStep("Updating from 0.9.34-dev3 to 0.9.34-dev4", false); showUpdateStep("Adding field umask to phpconfig table"); Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `mod_fcgid_umask` varchar(15) NOT NULL DEFAULT '022' AFTER `mod_fcgid_maxrequests`"); lastStepStatus(0); updateToVersion('0.9.34-dev4'); }
$do_update = false; lastStepStatus(2, 'not installed'); } else { lastStepStatus(0); } if ($do_update) { updateToVersion('0.9.34-dev3'); } } if (isFroxlorVersion('0.9.34-dev3')) { showUpdateStep("Updating from 0.9.34-dev3 to 0.9.34-dev4", false); showUpdateStep("Adding field umask to phpconfig table"); Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `mod_fcgid_umask` varchar(15) NOT NULL DEFAULT '022' AFTER `mod_fcgid_maxrequests`"); lastStepStatus(0); updateToVersion('0.9.34-dev4'); } if (isFroxlorVersion('0.9.34-dev4')) { showUpdateStep("Updating from 0.9.34-dev4 to 0.9.34 final"); lastStepStatus(0); updateToVersion('0.9.34'); } if (isFroxlorVersion('0.9.34')) { showUpdateStep("Updating from 0.9.34 to 0.9.34.1"); lastStepStatus(0); updateToVersion('0.9.34.1'); } if (isFroxlorVersion('0.9.34.1')) { showUpdateStep("Updating from 0.9.34.1 to 0.9.34.2"); lastStepStatus(0); updateToVersion('0.9.34.2'); }
lastStepStatus(0); updateToDbVersion('201607140'); } if (isFroxlorVersion('0.9.36')) { showUpdateStep("Updating from 0.9.36 to 0.9.37-rc1", false); updateToVersion('0.9.37-rc1'); } if (isDatabaseVersion('201607140')) { showUpdateStep("Adding new setting to hide certain options in customer panel"); Settings::AddNew("panel.customer_hide_options", ""); lastStepStatus(0); updateToDbVersion('201607210'); } if (isFroxlorVersion('0.9.37-rc1')) { showUpdateStep("Updating from 0.9.37-rc1 to 0.9.37 final", false); updateToVersion('0.9.37'); } if (isDatabaseVersion('201607210')) { showUpdateStep("Adding new settings for customer shell option"); Settings::AddNew("system.allow_customer_shell", "0"); Settings::AddNew("system.available_shells", ""); lastStepStatus(0); updateToDbVersion('201608260'); } if (isDatabaseVersion('201608260')) { showUpdateStep("Adding new settings to use Let's Encrypt for froxlor"); Settings::AddNew("system.le_froxlor_enabled", "0"); Settings::AddNew("system.le_froxlor_redirect", "0"); lastStepStatus(0); updateToDbVersion('201609050'); }