From d068477a935d4782225fdbfaeb2468b15e4524e9 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 15 Feb 2018 07:54:21 +0100 Subject: [PATCH] set version to 0.10.0 Signed-off-by: Michael Kaufmann (d00p) --- install/froxlor.sql | 5 ++-- .../updates/froxlor/0.9/update_0.10.inc.php | 28 +++++++++++++++++++ .../updates/froxlor/0.9/update_0.9.inc.php | 26 +++++++++++++++++ install/updatesql.php | 1 + lib/tables.inc.php | 1 + lib/version.inc.php | 4 +-- 6 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 install/updates/froxlor/0.9/update_0.10.inc.php diff --git a/install/froxlor.sql b/install/froxlor.sql index 5a262c55..6a8534a8 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -656,6 +656,7 @@ opcache.interned_strings_buffer'), ('system', 'nssextrausers', '0'), ('system', 'disable_le_selfcheck', '0'), ('system', 'ssl_protocols', 'TLSv1,TLSv1.2'), + ('api', 'enabled', '0'), ('panel', 'decimal_places', '4'), ('panel', 'adminmail', 'admin@SERVERNAME'), ('panel', 'phpmyadmin_url', ''), @@ -687,8 +688,8 @@ opcache.interned_strings_buffer'), ('panel', 'password_special_char_required', '0'), ('panel', 'password_special_char', '!?<>ยง$%+#=@'), ('panel', 'customer_hide_options', ''), - ('panel', 'version', '0.9.39.5'), - ('panel', 'db_version', '201802130'); + ('panel', 'version', '0.10.0'), + ('panel', 'db_version', '201802150'); DROP TABLE IF EXISTS `panel_tasks`; diff --git a/install/updates/froxlor/0.9/update_0.10.inc.php b/install/updates/froxlor/0.9/update_0.10.inc.php new file mode 100644 index 00000000..7e796501 --- /dev/null +++ b/install/updates/froxlor/0.9/update_0.10.inc.php @@ -0,0 +1,28 @@ + (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 (isFroxlorVersion('0.9.39.5')) { + + showUpdateStep("Updating from 0.9.39.5 to 0.10.0", false); + updateToVersion('0.10.0'); +} diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 0abab0fe..2656d31d 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -3939,3 +3939,29 @@ if (isFroxlorVersion('0.9.39.4')) { showUpdateStep("Updating from 0.9.39.4 to 0.9.39.5", false); updateToVersion('0.9.39.5'); } + +if (isDatabaseVersion('201802130')) { + + 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); + + updateToDbVersion('201802150'); +} diff --git a/install/updatesql.php b/install/updatesql.php index 4cc7417f..55d954f4 100644 --- a/install/updatesql.php +++ b/install/updatesql.php @@ -55,6 +55,7 @@ if(!isFroxlor()) { if (isFroxlor()) { include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php')); + include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.10/update_0.10.inc.php')); // Check Froxlor - database integrity (only happens after all updates are done, so we know the db-layout is okay) showUpdateStep("Checking database integrity"); diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 207612f0..2a6dc924 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -53,5 +53,6 @@ define('TABLE_DOMAINTOIP', 'panel_domaintoip'); define('TABLE_DOMAIN_DNS', 'domain_dns_entries'); define('TABLE_PANEL_FPMDAEMONS', 'panel_fpmdaemons'); define('TABLE_PANEL_PLANS', 'panel_plans'); +define('TABLE_API_KEYS', 'api_keys'); require dirname(__FILE__).'/version.inc.php'; diff --git a/lib/version.inc.php b/lib/version.inc.php index 49935fb7..8870fe02 100644 --- a/lib/version.inc.php +++ b/lib/version.inc.php @@ -16,10 +16,10 @@ */ // Main version variable -$version = '0.9.39.5'; +$version = '0.10.0'; // Database version (YYYYMMDDC where C is a daily counter) -$dbversion = '201802130'; +$dbversion = '201802150'; // Distribution branding-tag (used for Debian etc.) $branding = '';