From 26d9aa570c0b555c8be62b0185777945cfa93c8a Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 7 Nov 2013 18:49:16 +0100 Subject: [PATCH] remove unused code and database-tables; set version to 0.9.31-dev1 Signed-off-by: Michael Kaufmann (d00p) --- install/froxlor.sql | 21 +- .../updates/froxlor/0.9/update_0.9.inc.php | 13 ++ lib/classes/domains/class.docrootsettings.php | 198 ------------------ lib/tables.inc.php | 5 +- 4 files changed, 15 insertions(+), 222 deletions(-) delete mode 100644 lib/classes/domains/class.docrootsettings.php diff --git a/install/froxlor.sql b/install/froxlor.sql index d2a26a4d..2d1a56ad 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -539,7 +539,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'phpconfigs_hidestdsubdomain', '0'), ('panel', 'allow_theme_change_admin', '1'), ('panel', 'allow_theme_change_customer', '1'), - ('panel', 'version', '0.9.30'); + ('panel', 'version', '0.9.31-dev1'); DROP TABLE IF EXISTS `panel_tasks`; @@ -897,25 +897,6 @@ CREATE TABLE IF NOT EXISTS `domain_redirect_codes` ( ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci; - -DROP TABLE IF EXISTS `ipsandports_docrootsettings`; -CREATE TABLE IF NOT EXISTS `ipsandports_docrootsettings` ( - `id` int(5) NOT NULL auto_increment, - `fid` int(11) NOT NULL, - `docrootsettings` text NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci; - - -DROP TABLE IF EXISTS `domain_docrootsettings`; -CREATE TABLE IF NOT EXISTS `domain_docrootsettings` ( - `id` int(5) NOT NULL auto_increment, - `fid` int(11) NOT NULL, - `docrootsettings` text NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci; - - DROP TABLE IF EXISTS `domain_ssl_settings`; CREATE TABLE IF NOT EXISTS `domain_ssl_settings` ( `id` int(5) NOT NULL auto_increment, 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 b88a8d3c..feb5b6f5 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2410,3 +2410,16 @@ if (isFroxlorVersion('0.9.30-rc1')) { updateToVersion('0.9.30'); } + +if (isFroxlorVersion('0.9.30')) { + + showUpdateStep("Updating from 0.9.30 to 0.9.31-dev1", true); + lastStepStatus(0); + + showUpdateStep("Removing unsused tables"); + Database::query("DROP TABLE IF EXISTS `ipsandports_docrootsettings`;"); + Database::query("DROP TABLE IF EXISTS `domain_docrootsettings`;"); + lastStepStatus(0); + + updateToVersion('0.9.31-dev1'); +} diff --git a/lib/classes/domains/class.docrootsettings.php b/lib/classes/domains/class.docrootsettings.php deleted file mode 100644 index b566e127..00000000 --- a/lib/classes/domains/class.docrootsettings.php +++ /dev/null @@ -1,198 +0,0 @@ - - * @author Froxlor team (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Classes - * - * @link http://www.nutime.de/ - * @since 0.9.17-svn2 - * - */ - -class docrootsettings -{ - /** - * Database handler - * @var object - */ - private $_db = false; - - /** - * Settings array - * @var array - */ - private $_settings = array(); - - /** - * main constructor - */ - public function __construct($db, $settings) - { - $this->_db = $db; - $this->_settings = $settings; - } - - /** - * this function lets you add docroot-settings for a given domain (by ID) - * - * @param int $domainid id of the domain to add the settings for - * @param string $ssettings docrootsettings to add for the domain - * - * @return boolean - */ - public function addDomainDocrootsettings($domainid = 0, $ssettings = '') - { - return $this->_addDocrootSetting(TABLE_PANEL_DOMDOCROOTSETTINGS, $domainid, $ssettings); - } - - /** - * this function lets you update docroot-settings for a given domain (by ID) - * - * @param int $domainid id of the domain to update the settings from - * @param string $ssettings docrootsettings to update for the domain - * - * @return boolean - */ - public function updateDomainDocrootsettings($domainid = 0, $ssettings = '') - { - return $this->_updateDocrootSetting(TABLE_PANEL_DOMDOCROOTSETTINGS, $domainid, $ssettings); - } - - /** - * this function lets you add docroot-settings for a given ip/port combo (by ID) - * - * @param int $ipandportid id of the domain to add the settings for - * @param string $ssettings docrootsettings to add for the domain - * - * @return boolean - */ - public function addIpsAndPortsDocrootsettings($ipandportid = 0, $ssettings = '') - { - return $this->_addDocrootSetting(TABLE_PANEL_IPDOCROOTSETTINGS, $ipandportid, $ssettings); - } - - /** - * this function lets you update docroot-settings for a given ip/port combo (by ID) - * - * @param int $ipandportid id of the domain to update the settings from - * @param string $ssettings docrootsettings to update for the domain - * - * @return boolean - */ - public function updateIpsAndPortsDocrootsettings($ipandportid = 0, $ssettings = '') - { - return $this->_updateDocrootSetting(TABLE_PANEL_IPDOCROOTSETTINGS, $ipandportid, $ssettings); - } - - /** - * returns the docroot-setting - * for a given domain (by ID) - * - * @param int $domainid the id of the domain - * - * @return string the settings or empty if not set - */ - public function getDomainDocrootsettings($domainid = 0) - { - return $this->_getDocrootSettingById(TABLE_PANEL_DOMDOCROOTSETTINGS, $domainid); - } - - /** - * returns the docroot-setting - * for a given ip/port combination (by ID) - * - * @param int $ipandportid the id of the ip/port combo - * - * @return string the settings or empty if not set - */ - public function getIpsAndPortsDocrootsettings($ipandportid = 0) - { - return $this->_getDocrootSettingById(TABLE_PANEL_IPDOCROOTSETTINGS, $ipandportid); - } - - /** - * this function is called by addDomainDocrootsettings() and - * addIpsAndPortsDocrootsettings() to add docroot settings for an object - * - * @param string $table table to add the settings to - * @param int $fid foreign id / object id - * @param string $ssettings docroot-settings - * - * @return boolean - */ - private function _addDocrootSetting($table, $fid, $ssettings) - { - $query = "INSERT INTO `".$table."` SET - `fid` = '".(int)$fid."', - `docrootsettings` = '".$db->escape($ssettings)."';"; - $this->_db->query($query); - return true; - } - - /** - * this function is called by updateDomainDocrootsettings() and - * updateIpsAndPortsDocrootsettings() to update docroot settings for an object - * - * if new value is an empty string, entry is being removed - * - * @param string $table table to update the settings from - * @param int $fid foreign id / object id - * @param string $ssettings docroot-settings - * - * @return boolean - */ - private function _updateDocrootSetting($table, $fid, $ssettings) - { - // check if this object has an entry for docrootsettings - if($this->_getDocrootSettingById($table, $fid) != '') - { - if($ssettings != '') - { - // update if new value has been set - $query = "UPDATE `".$table."` SET - `docrootsettings` = '".$db->escape($ssettings)."' - WHERE `fid` = '".(int)$fid."';"; - } - else - { - // remove if new value is empty - $query = "DELETE FROM `".$table."` WHERE `fid` = '".(int)$fid."';"; - } - // run query - $this->_db->query($query); - return true; - } - // this object has no entry for docrootsettings yet - return false; - } - - /** - * read the docrootsetting field of given table - * for given id - * - * @param string $table table where to read from - * @param int $id id of the object - * - * @return string string the settings or empty if not set - */ - private function _getDocrootSettingById($table = null, $id = 0) - { - $query = "SELECT `docrootsettings` FROM `".$table."` WHERE `fid`='".(int)$id."';"; - $result = $this->_db->query_first($query); - if($result !== false && isset($result['docrootsettings'])) - { - return $result['docrootsettings']; - } - return ''; - } -} diff --git a/lib/tables.inc.php b/lib/tables.inc.php index db51be4d..46f30f6c 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -52,13 +52,10 @@ define('TABLE_APS_TEMP_SETTINGS', 'aps_temp_settings'); define('TABLE_PANEL_CRONRUNS', 'cronjobs_run'); define('TABLE_PANEL_REDIRECTCODES', 'redirect_codes'); define('TABLE_PANEL_DOMAINREDIRECTS', 'domain_redirect_codes'); -define('TABLE_PANEL_IPDOCROOTSETTINGS', 'ipsandports_docrootsettings'); -define('TABLE_PANEL_DOMDOCROOTSETTINGS', 'domain_docrootsettings'); define('TABLE_PANEL_DOMAIN_SSL_SETTINGS', 'domain_ssl_settings'); define('TABLE_DOMAINTOIP', 'panel_domaintoip'); // APS constants - define('TASK_INSTALL', 1); define('TASK_REMOVE', 2); define('TASK_RECONFIGURE', 3); @@ -74,6 +71,6 @@ define('PACKAGE_LOCKED', 1); define('PACKAGE_ENABLED', 2); // VERSION INFO -$version = '0.9.30'; +$version = '0.9.31-dev1'; $dbversion = '2'; $branding = '';