From f9d949f90c9ee8d7913848a65f59e2ed74b3c146 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 3 Mar 2016 23:38:02 +0100 Subject: [PATCH] Revert "Merge pull request #318 from Churro/froxlorMerge_33ab67a" This reverts commit 4f2ee129fd5102241d0332ec21874d059483d4f9, reversing changes made to f284d67843165fa54bb595f6b74ede01f756b7f4. --- admin_domains.php | 47 +--- admin_phpsettings.php | 1 - admin_vhostsettings.php | 233 ------------------ install/froxlor.sql | 11 +- .../admin/domains/formfield.domains_add.php | 16 -- .../admin/domains/formfield.domains_edit.php | 18 +- .../vhostconfig/formfield.vhostconfig_add.php | 43 ---- .../formfield.vhostconfig_edit.php | 45 ---- lib/tables.inc.php | 1 - lng/english.lng.php | 18 -- lng/german.lng.php | 18 -- .../jobs/cron_tasks.inc.http.10.apache.php | 13 - .../jobs/cron_tasks.inc.http.20.lighttpd.php | 19 +- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 43 +--- .../cron_tasks.inc.http.35.nginx_phpfpm.php | 37 ++- .../Sparkle/admin/vhostconfig/overview.tpl | 40 --- .../admin/vhostconfig/overview_add.tpl | 76 ------ .../admin/vhostconfig/overview_edit.tpl | 77 ------ .../admin/vhostconfig/overview_overview.tpl | 12 - 19 files changed, 35 insertions(+), 733 deletions(-) delete mode 100644 admin_vhostsettings.php delete mode 100644 lib/formfields/admin/vhostconfig/formfield.vhostconfig_add.php delete mode 100644 lib/formfields/admin/vhostconfig/formfield.vhostconfig_edit.php delete mode 100644 templates/Sparkle/admin/vhostconfig/overview.tpl delete mode 100644 templates/Sparkle/admin/vhostconfig/overview_add.tpl delete mode 100644 templates/Sparkle/admin/vhostconfig/overview_edit.tpl delete mode 100644 templates/Sparkle/admin/vhostconfig/overview_overview.tpl diff --git a/admin_domains.php b/admin_domains.php index 95e628d6..bb84849b 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -97,7 +97,7 @@ if ($page == 'domains' } $row['ipandport'] = substr($row['ipandport'], 0, -1); $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); - + if($row['termination_date'] != "") { $cdate = strtotime($row['termination_date'] . " 23:59:59"); @@ -432,8 +432,6 @@ if ($page == 'domains' $specialsettings = ''; } - $vhostsettingid = 0; - $vhost_usedefaultlocation = 1; if ($userinfo['caneditphpsettings'] == '1' || $userinfo['change_serversettings'] == '1' ) { @@ -444,8 +442,6 @@ if ($page == 'domains' || (int)Settings::Get('phpfpm.enabled') == 1 ) { $phpsettingid = (int)$_POST['phpsettingid']; - $vhostsettingid = (int)$_POST['vhostsettingid']; - $vhost_usedefaultlocation = isset($_POST['vhost_usedefaultlocation']) ? (int)$_POST['vhost_usedefaultlocation'] : 1; $phpsettingid_check_stmt = Database::prepare(" SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :phpsettingid" @@ -742,8 +738,6 @@ if ($page == 'domains' 'ssl_ipandport' => serialize($ssl_ipandports), 'openbasedir' => $openbasedir, 'phpsettingid' => $phpsettingid, - 'vhostsettingid' => $vhostsettingid, - 'vhost_usedefaultlocation' => $vhost_usedefaultlocation, 'mod_fcgid_starter' => $mod_fcgid_starter, 'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests, 'specialsettings' => $specialsettings, @@ -797,8 +791,6 @@ if ($page == 'domains' 'registration_date' => $registration_date, 'termination_date' => $termination_date, 'phpsettingid' => $phpsettingid, - 'vhostsettingid' => $vhostsettingid, - 'vhost_usedefaultlocation' => $vhost_usedefaultlocation, 'mod_fcgid_starter' => $mod_fcgid_starter, 'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests, 'ismainbutsubto' => $issubof, @@ -832,8 +824,6 @@ if ($page == 'domains' `registration_date` = :registration_date, `termination_date` = :termination_date, `phpsettingid` = :phpsettingid, - `vhostsettingid` = :vhostsettingid, - `vhost_usedefaultlocation` = :vhost_usedefaultlocation, `mod_fcgid_starter` = :mod_fcgid_starter, `mod_fcgid_maxrequests` = :mod_fcgid_maxrequests, `ismainbutsubto` = :ismainbutsubto, @@ -1015,15 +1005,6 @@ if ($page == 'domains' } } - // vhost configs - $vhostconfigs = ''; - $configsvhost = Database::query("SELECT * FROM `" . TABLE_PANEL_VHOSTCONFIGS . "` ORDER BY description ASC"); - - $vhostconfigs.= makeoption($lng['admin']['vhostsettings']['novhostsettings'], 0); - while ($row = $configsvhost->fetch(PDO::FETCH_ASSOC)) { - $vhostconfigs.= makeoption($row['description'], $row['id'], '', true, true); - } - // create serveralias options $serveraliasoptions = ""; $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_wildcard'], '0', '0', true, true); @@ -1279,8 +1260,6 @@ if ($page == 'domains' } $speciallogverified = (isset($_POST['speciallogverified']) ? (int)$_POST['speciallogverified'] : 0); - $vhostsettingid = $result['vhostsettingid']; - $vhost_usedefaultlocation = $result['vhost_usedefaultlocation']; if ($userinfo['caneditphpsettings'] == '1' || $userinfo['change_serversettings'] == '1' @@ -1292,8 +1271,6 @@ if ($page == 'domains' || (int)Settings::Get('phpfpm.enabled') == 1 ) { $phpsettingid = (int)$_POST['phpsettingid']; - $vhostsettingid = (int)$_POST['vhostsettingid']; - $vhost_usedefaultlocation = isset($_POST['vhost_usedefaultlocation']) ? (int)$_POST['vhost_usedefaultlocation'] : $vhost_usedefaultlocation; $phpsettingid_check_stmt = Database::prepare(" SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :phpid "); @@ -1529,8 +1506,6 @@ if ($page == 'domains' 'ssl_redirect' => $ssl_redirect, 'openbasedir' => $openbasedir, 'phpsettingid' => $phpsettingid, - 'vhost_usedefaultlocation' => $vhost_usedefaultlocation, - 'vhostsettingid' => $vhostsettingid, 'mod_fcgid_starter' => $mod_fcgid_starter, 'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests, 'specialsettings' => $specialsettings, @@ -1569,8 +1544,6 @@ if ($page == 'domains' || $iswildcarddomain != $result['iswildcarddomain'] || $openbasedir != $result['openbasedir'] || $phpsettingid != $result['phpsettingid'] - || $vhostsettingid != $result['vhostsettingid'] - || $vhost_usedefaultlocation != $result['vhost_usedefaultlocation'] || $mod_fcgid_starter != $result['mod_fcgid_starter'] || $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests'] || $specialsettings != $result['specialsettings'] @@ -1709,8 +1682,6 @@ if ($page == 'domains' $update_data['openbasedir'] = $openbasedir; $update_data['speciallogfile'] = $speciallogfile; $update_data['phpsettingid'] = $phpsettingid; - $update_data['vhostsettingid'] = $vhostsettingid; - $update_data['vhost_usedefaultlocation'] = $vhost_usedefaultlocation; $update_data['mod_fcgid_starter'] = $mod_fcgid_starter; $update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests; $update_data['specialsettings'] = $specialsettings; @@ -1739,8 +1710,6 @@ if ($page == 'domains' `openbasedir` = :openbasedir, `speciallogfile` = :speciallogfile, `phpsettingid` = :phpsettingid, - `vhostsettingid` = :vhostsettingid, - `vhost_usedefaultlocation` = :vhost_usedefaultlocation, `mod_fcgid_starter` = :mod_fcgid_starter, `mod_fcgid_maxrequests` = :mod_fcgid_maxrequests, `specialsettings` = :specialsettings, @@ -1756,8 +1725,6 @@ if ($page == 'domains' $_update_data['adminid'] = $adminid; $_update_data['openbasedir'] = $openbasedir; $_update_data['phpsettingid'] = $phpsettingid; - $_update_data['vhost_usedefaultlocation'] = $vhost_usedefaultlocation; - $_update_data['vhostsettingid'] = $vhostsettingid; $_update_data['mod_fcgid_starter'] = $mod_fcgid_starter; $_update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests; $_update_data['parentdomainid'] = $id; @@ -1775,8 +1742,6 @@ if ($page == 'domains' `customerid` = :customerid, `adminid` = :adminid, `openbasedir` = :openbasedir, - `vhostsettingid` = :vhostsettingid, - `vhost_usedefaultlocation` = :vhost_usedefaultlocation, `phpsettingid` = :phpsettingid, `mod_fcgid_starter` = :mod_fcgid_starter, `mod_fcgid_maxrequests` = :mod_fcgid_maxrequests @@ -1989,7 +1954,7 @@ if ($page == 'domains' // Fudge the result for ssl_redirect to hide the Let's Encrypt steps $result['temporary_ssl_redirect'] = $result['ssl_redirect']; $result['ssl_redirect'] = ($result['ssl_redirect'] == 0 ? 0 : 1); - + $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_wildcard'], '0', $_value, true, true); $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_www'], '1', $_value, true, true); $serveraliasoptions .= makeoption($lng['domains']['serveraliasoption_none'], '2', $_value, true, true); @@ -2008,14 +1973,6 @@ if ($page == 'domains' $phpconfigs.= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true); } - // vhost configs - $vhostconfigs = ''; - $vhostconfigs_result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_VHOSTCONFIGS . "` ORDER BY description ASC"); - $vhostconfigs .= makeoption($lng['admin']['vhostsettings']['novhostsettings'], 0); - while ($vhostconfig_row = $vhostconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) { - $vhostconfigs .= makeoption($vhostconfig_row['description'], $vhostconfig_row['id'], $result['vhostsettingid'], true, true); - } - $result = htmlentities_array($result); $domain_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/domains/formfield.domains_edit.php'; diff --git a/admin_phpsettings.php b/admin_phpsettings.php index 9d87fa12..4f7f9824 100644 --- a/admin_phpsettings.php +++ b/admin_phpsettings.php @@ -62,7 +62,6 @@ if ($page == 'overview') { } } - $query .= " ORDER BY domain ASC"; $domainresult_stmt = Database::prepare($query); Database::pexecute($domainresult_stmt, $query_params); diff --git a/admin_vhostsettings.php b/admin_vhostsettings.php deleted file mode 100644 index 329c1ab1..00000000 --- a/admin_vhostsettings.php +++ /dev/null @@ -1,233 +0,0 @@ - (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Panel - * - * @since 0.9.35 - * - */ - -define('AREA', 'admin'); -require './lib/init.php'; - -$id = 0; -if (isset($_POST['id'])) { - $id = intval($_POST['id']); -} elseif (isset($_GET['id'])) { - $id = intval($_GET['id']); -} - -if ($page == 'overview') { - if ($action == '') { - $tablecontent = ''; - $count = 0; - $result = Database::query("SELECT * FROM `" . TABLE_PANEL_VHOSTCONFIGS . "` ORDER BY description ASC"); - - while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - - $domainresult = false; - $query_params = array('id' => $row['id']); - - $query = "SELECT * FROM `".TABLE_PANEL_DOMAINS."` - WHERE `vhostsettingid` = :id - AND `parentdomainid` = '0'"; - - if ((int)$userinfo['domains_see_all'] == 0) { - $query .= " AND `adminid` = :adminid"; - $query_params['adminid'] = $userinfo['adminid']; - } - - if ((int)Settings::Get('panel.phpconfigs_hidestdsubdomain') == 1) { - $ssdids_res = Database::query(" - SELECT DISTINCT `standardsubdomain` FROM `".TABLE_PANEL_CUSTOMERS."` - WHERE `standardsubdomain` > 0 ORDER BY `standardsubdomain` ASC;" - ); - $ssdids = array(); - while ($ssd = $ssdids_res->fetch(PDO::FETCH_ASSOC)) { - $ssdids[] = $ssd['standardsubdomain']; - } - if (count($ssdids) > 0) { - $query .= " AND `id` NOT IN (".implode(', ', $ssdids).")"; - } - } - - $query .= " ORDER BY domain ASC"; - $domainresult_stmt = Database::prepare($query); - Database::pexecute($domainresult_stmt, $query_params); - - $domains = ''; - if (Database::num_rows() > 0) { - while ($row2 = $domainresult_stmt->fetch(PDO::FETCH_ASSOC)) { - $domains.= $row2['domain'] . '
'; - } - } - - if ($domains == '') { - $domains = $lng['admin']['phpsettings']['notused']; - } - - // check whether this is our default config - if ((Settings::Get('system.mod_fcgid') == '1' - && Settings::Get('system.mod_fcgid_defaultini') == $row['id']) - || (Settings::Get('phpfpm.enabled') == '1' - && Settings::Get('phpfpm.defaultini') == $row['id']) - ) { - $row['description'] = ''.$row['description'].''; - } - - $count++; - eval("\$tablecontent.=\"" . getTemplate("vhostconfig/overview_overview") . "\";"); - } - - eval("echo \"" . getTemplate("vhostconfig/overview") . "\";"); - } - - if ($action == 'add') { - - if ((int)$userinfo['change_serversettings'] == 1) { - - if (isset($_POST['send']) - && $_POST['send'] == 'send' - ) { - $description = validate($_POST['description'], 'description'); - $vhostsettings = validate(trim(str_replace("\r\n", "\n", $_POST['vhostsettings'])), 'vhostsettings', '/^[^\0]*$/'); - - if (strlen($description) == 0 - || strlen($description) > 50 - ) { - standard_error('descriptioninvalid'); - } - - $ins_stmt = Database::prepare(" - INSERT INTO `" . TABLE_PANEL_VHOSTCONFIGS . "` SET - `description` = :desc, - `vhostsettings` = :vhostsettings" - ); - $ins_data = array( - 'desc' => $description, - 'vhostsettings' => $vhostsettings - ); - Database::pexecute($ins_stmt, $ins_data); - - inserttask('1'); - $log->logAction(ADM_ACTION, LOG_INFO, "vhost config setting with description '" . $description . "' has been created by '" . $userinfo['loginname'] . "'"); - redirectTo($filename, array('page' => $page, 's' => $s)); - - } else { - - $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_VHOSTCONFIGS . "` WHERE `id` = 1"); - $result = $result_stmt->fetch(PDO::FETCH_ASSOC); - - $vhostconfig_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/vhostconfig/formfield.vhostconfig_add.php'; - $vhostconfig_add_form = htmlform::genHTMLForm($vhostconfig_add_data); - - $title = $vhostconfig_add_data['vhostconfig_add']['title']; - $image = $vhostconfig_add_data['vhostconfig_add']['image']; - - eval("echo \"" . getTemplate("vhostconfig/overview_add") . "\";"); - } - - } else { - standard_error('nopermissionsorinvalidid'); - } - } - - if ($action == 'delete') { - - $result_stmt = Database::prepare(" - SELECT * FROM `" . TABLE_PANEL_VHOSTCONFIGS . "` WHERE `id` = :id" - ); - $result = Database::pexecute_first($result_stmt, array('id' => $id)); - - if ($result['id'] != 0 - && $result['id'] == $id - && (int)$userinfo['change_serversettings'] == 1 - ) { - - if (isset($_POST['send']) - && $_POST['send'] == 'send' - ) { - $del_stmt = Database::prepare(" - DELETE FROM `" . TABLE_PANEL_VHOSTCONFIGS . "` WHERE `id` = :id" - ); - Database::pexecute($del_stmt, array('id' => $id)); - - inserttask('1'); - $log->logAction(ADM_ACTION, LOG_INFO, "vhost config setting with id #" . (int)$id . " has been deleted by '" . $userinfo['loginname'] . "'"); - redirectTo($filename, array('page' => $page, 's' => $s)); - - } else { - ask_yesno('vhostsetting_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['description']); - } - } else { - standard_error('nopermissionsorinvalidid'); - } - } - - if ($action == 'edit') { - - $result_stmt = Database::prepare(" - SELECT * FROM `" . TABLE_PANEL_VHOSTCONFIGS . "` WHERE `id` = :id" - ); - $result = Database::pexecute_first($result_stmt, array('id' => $id)); - - if ($result['id'] != 0 - && $result['id'] == $id - && (int)$userinfo['change_serversettings'] == 1 - ) { - - if (isset($_POST['send']) - && $_POST['send'] == 'send' - ) { - $description = validate($_POST['description'], 'description'); - $vhostsettings = validate(trim(str_replace("\r\n", "\n", $_POST['vhostsettings'])), 'vhostsettings', '/^[^\0]*$/'); - - if (strlen($description) == 0 - || strlen($description) > 50 - ) { - standard_error('descriptioninvalid'); - } - - $upd_stmt = Database::prepare(" - UPDATE `" . TABLE_PANEL_VHOSTCONFIGS . "` SET - `description` = :desc, - `vhostsettings` = :vhostsettings - WHERE `id` = :id" - ); - $upd_data = array( - 'desc' => $description, - 'vhostsettings' => $vhostsettings, - 'id' => $id - ); - Database::pexecute($upd_stmt, $upd_data); - - inserttask('1'); - $log->logAction(ADM_ACTION, LOG_INFO, "vhost setting with description '" . $description . "' has been changed by '" . $userinfo['loginname'] . "'"); - redirectTo($filename, array('page' => $page, 's' => $s)); - - } else { - - $vhostconfig_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/vhostconfig/formfield.vhostconfig_edit.php'; - $vhostconfig_edit_form = htmlform::genHTMLForm($vhostconfig_edit_data); - - $title = $vhostconfig_edit_data['vhostconfig_edit']['title']; - $image = $vhostconfig_edit_data['vhostconfig_edit']['image']; - - eval("echo \"" . getTemplate("vhostconfig/overview_edit") . "\";"); - } - - } else { - standard_error('nopermissionsorinvalidid'); - } - } -} diff --git a/install/froxlor.sql b/install/froxlor.sql index 022ff8b9..9f84c0f6 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -240,8 +240,6 @@ CREATE TABLE `panel_domains` ( `openbasedir_path` tinyint(1) NOT NULL default '0', `speciallogfile` tinyint(1) NOT NULL default '0', `ssl_redirect` tinyint(4) NOT NULL default '0', - `vhost_usedefaultlocation` tinyint(1) NOT NULL default '1', - `vhostsettingid` tinyint(11) NOT NULL default '0', `specialsettings` text, `deactivated` tinyint(1) NOT NULL default '0', `bindserial` varchar(10) NOT NULL default '2000010100', @@ -785,7 +783,7 @@ CREATE TABLE IF NOT EXISTS `ftp_quotalimits` ( -INSERT INTO `ftp_quotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES +INSERT INTO `ftp_quotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES ('froxlor', 'user', 'false', 'hard', 0, 0, 0, 0, 0, 0); @@ -853,10 +851,3 @@ CREATE TABLE IF NOT EXISTS `panel_domaintoip` ( PRIMARY KEY (`id_domain`,`id_ipandports`) ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci; -DROP TABLE IF EXISTS `panel_vhostconfigs`; -CREATE TABLE IF NOT EXISTS `panel_vhostconfigs` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(50) NOT NULL, - `vhostsettings` text NOT NULL, - PRIMARY KEY (`id`) -) DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; diff --git a/lib/formfields/admin/domains/formfield.domains_add.php b/lib/formfields/admin/domains/formfield.domains_add.php index 39a2de97..94876c1b 100644 --- a/lib/formfields/admin/domains/formfield.domains_add.php +++ b/lib/formfields/admin/domains/formfield.domains_add.php @@ -150,22 +150,6 @@ return array( ), 'value' => array() ), - 'vhost_usedefaultlocation' => array( - 'visible' => (Settings::Get('system.webserver') == 'nginx' ? true : false), - 'label' => $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['title'], - 'desc' => $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'], - 'type' => 'checkbox', - 'values' => array( - array ('label' => $lng['panel']['yes'], 'value' => '1') - ), - 'value' => array('1') - ), - 'vhostsettingid' => array( - 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), - 'label' => $lng['admin']['vhostsettings']['vhostsettings'], - 'type' => 'select', - 'select_var' => $vhostconfigs - ), 'specialsettings' => array( 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'style' => 'align-top', diff --git a/lib/formfields/admin/domains/formfield.domains_edit.php b/lib/formfields/admin/domains/formfield.domains_edit.php index e72bf5f8..14d16fce 100644 --- a/lib/formfields/admin/domains/formfield.domains_edit.php +++ b/lib/formfields/admin/domains/formfield.domains_edit.php @@ -84,7 +84,7 @@ return array( 'value' => $result['registration_date'], 'size' => 10 ), - 'termination_date' => array( + 'termination_date' => array( 'label' => $lng['domains']['termination_date'], 'desc' => $lng['panel']['dateformat'], 'type' => 'text', @@ -162,22 +162,6 @@ return array( ), 'value' => array($result['speciallogfile']) ), - 'vhost_usedefaultlocation' => array( - 'visible' => (Settings::Get('system.webserver') == 'nginx' ? true : false), - 'label' => $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['title'], - 'desc' => $lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'], - 'type' => 'checkbox', - 'values' => array( - array ('label' => $lng['panel']['yes'], 'value' => '1') - ), - 'value' => array($result['vhost_usedefaultlocation']) - ), - 'vhostsettingid' => array( - 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), - 'label' => $lng['admin']['vhostsettings']['vhostsettings'], - 'type' => 'select', - 'select_var' => $vhostconfigs - ), 'specialsettings' => array( 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'style' => 'align-top', diff --git a/lib/formfields/admin/vhostconfig/formfield.vhostconfig_add.php b/lib/formfields/admin/vhostconfig/formfield.vhostconfig_add.php deleted file mode 100644 index 7e9139ae..00000000 --- a/lib/formfields/admin/vhostconfig/formfield.vhostconfig_add.php +++ /dev/null @@ -1,43 +0,0 @@ - (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Formfields - * - */ - -return array( - 'vhostconfig_add' => array( - 'title' => $lng['admin']['vhostsettings']['addsettings'], - 'image' => 'icons/vhostsettings_add.png', - 'sections' => array( - 'section_a' => array( - 'title' => $lng['admin']['vhostsettings']['addnew'], - 'image' => 'icons/vhostsettings_add.png', - 'fields' => array( - 'description' => array( - 'label' => $lng['admin']['phpsettings']['description'], - 'type' => 'text', - 'maxlength' => 50 - ), - 'vhostsettings' => array( - 'style' => 'align-top', - 'label' => $lng['admin']['vhostsettings']['vhostsettings'], - 'type' => 'textarea', - 'cols' => 100, - 'rows' => 30 - ) - ) - ) - ) - ) -); diff --git a/lib/formfields/admin/vhostconfig/formfield.vhostconfig_edit.php b/lib/formfields/admin/vhostconfig/formfield.vhostconfig_edit.php deleted file mode 100644 index d780ab6d..00000000 --- a/lib/formfields/admin/vhostconfig/formfield.vhostconfig_edit.php +++ /dev/null @@ -1,45 +0,0 @@ - (2010-) - * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt - * @package Formfields - * - */ - -return array( - 'vhostconfig_edit' => array( - 'title' => $lng['admin']['vhostsettings']['editsettings'], - 'image' => 'icons/vhostsettings_edit.png', - 'sections' => array( - 'section_a' => array( - 'title' => $lng['admin']['vhostsettings']['editsettings'], - 'image' => 'icons/vhostsettings_edit.png', - 'fields' => array( - 'description' => array( - 'label' => $lng['admin']['phpsettings']['description'], - 'type' => 'text', - 'maxlength' => 50, - 'value' => $result['description'] - ), - 'vhostsettings' => array( - 'style' => 'align-top', - 'label' => $lng['admin']['vhostsettings']['vhostsettings'], - 'type' => 'textarea', - 'cols' => 100, - 'rows' => 30, - 'value' => $result['vhostsettings'] - ) - ) - ) - ) - ) -); diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 11e8ea61..65fafc0a 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -45,7 +45,6 @@ define('TABLE_PANEL_TICKETS', 'panel_tickets'); define('TABLE_PANEL_TICKET_CATS', 'panel_ticket_categories'); define('TABLE_PANEL_LOG', 'panel_syslog'); define('TABLE_PANEL_PHPCONFIGS', 'panel_phpconfigs'); -define('TABLE_PANEL_VHOSTCONFIGS', 'panel_vhostconfigs'); define('TABLE_PANEL_CRONRUNS', 'cronjobs_run'); define('TABLE_PANEL_REDIRECTCODES', 'redirect_codes'); define('TABLE_PANEL_DOMAINREDIRECTS', 'domain_redirect_codes'); diff --git a/lng/english.lng.php b/lng/english.lng.php index 914dacfd..09762b4f 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1971,22 +1971,4 @@ $lng['domains']['termination_date'] = 'Date of termination'; $lng['domains']['termination_date_overview'] = 'canceled until '; $lng['panel']['set'] = 'Apply'; - -// Added for Vhost templates -$lng['menue']['vhostsettings']['maintitle'] = 'VHost Configurations'; -$lng['admin']['vhostsettings']['title'] = 'VHost Configuration'; -$lng['admin']['vhostsettings']['addnew'] = 'Add new configuration'; -$lng['admin']['vhostsettings']['addsettings'] = 'Create a VHost configuration'; -$lng['admin']['vhostsettings']['editsettings'] = 'Edit a VHost configuration'; -$lng['admin']['vhostsettings']['vhostsettings'] = 'Predefined VHost configuration'; -$lng['admin']['vhostsettings']['novhostsettings'] = 'No predefined VHost configuration'; -$lng['admin']['vhostconfig']['socket_dir'] = 'Will be replaced with the corresponding Unix socket path, e.g. /var/run/domain-php-fpm.socket.'; -$lng['admin']['vhostconfig']['docroot'] = 'Will be replaced with the DocumentRoot.'; -$lng['admin']['vhostconfig']['ip'] = 'Will be replaced with the IP address of the Vhost.'; -$lng['admin']['vhostconfig']['port'] = 'Will be replaced with the port number of the Vhost.'; -$lng['admin']['vhostconfig']['scheme'] = 'Will be set to http or https in case SSL / TLS is activated for the Vhost.'; -$lng['admin']['vhostconfig']['vhost_usedefaultlocation']['title'] = 'Use the standard Vhost location directives'; -$lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'] = 'If deactivated, the standard Vhost location directives, such as
location / { ... }
location @rewrites { ... }
location ~ ^(.+?\.php)(/.*)?$ { ... }
are excluded from the Vhost configuration file.'; -$lng['question']['vhostsetting_reallydelete'] = 'Do you really want to delete the Vhost template?'; - $lng['admin']['server_templates'] = 'Templates'; diff --git a/lng/german.lng.php b/lng/german.lng.php index 0ae1e072..0f0b8e4f 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1611,22 +1611,4 @@ $lng['domains']['termination_date'] = 'Kündigungsdatum'; $lng['domains']['termination_date_overview'] = 'gekündigt zum '; $lng['panel']['set'] = 'Setzen'; - -// Added for Vhost templates -$lng['menue']['vhostsettings']['maintitle'] = 'VHost-Konfigurationen'; -$lng['admin']['vhostsettings']['title'] = 'VHost-Konfiguration'; -$lng['admin']['vhostsettings']['addnew'] = 'Neue Konfiguration erstellen'; -$lng['admin']['vhostsettings']['addsettings'] = 'VHost-Konfiguration erstellen'; -$lng['admin']['vhostsettings']['editsettings'] = 'VHost-Konfiguration bearbeiten'; -$lng['admin']['vhostsettings']['vhostsettings'] = 'Vordefinierte VHost-Konfiguration'; -$lng['admin']['vhostsettings']['novhostsettings'] = 'Keine VHost-Konfiguration'; -$lng['admin']['vhostconfig']['socket_dir'] = 'Wird mit dem jeweiligen Unix Socket Pfad ersetzt (z.B. /var/run/domain-php-fpm.socket).'; -$lng['admin']['vhostconfig']['docroot'] = 'Wird mit dem DocumentRoot ersetzt.'; -$lng['admin']['vhostconfig']['ip'] = 'Wird mit der IP-Adresse des Vhosts ersetzt.'; -$lng['admin']['vhostconfig']['port'] = 'Wird mit dem Port des Vhosts ersetzt.'; -$lng['admin']['vhostconfig']['scheme'] = 'Wird mit http bzw. mit https ersetzt, sofern der Vhost SSL/TLS aktiviert hat.'; -$lng['admin']['vhostconfig']['vhost_usedefaultlocation']['title'] = 'Standard VHost location-Direktiven verwenden'; -$lng['admin']['vhostconfig']['vhost_usedefaultlocation']['desc'] = 'Wenn deaktiviert, werden Standard VHost-Direktiven wie
location / { ... }
location @rewrites { ... }
location ~ ^(.+?\.php)(/.*)?$ { ... }
nicht in die Konfigurationsdatei geschrieben.'; -$lng['question']['vhostsetting_reallydelete'] = 'Wollen Sie diese VHost-Vorlage wirklich löschen?'; - $lng['admin']['server_templates'] = 'Vorlagen'; diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index 7b2a5e09..bc1e5b13 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -866,19 +866,6 @@ class apache extends HttpConfigBase { } $vhost_content .= $this->getLogfiles($domain); - // check if vhost config template is set and if so, merge it - if ($domain['vhostsettingid'] != 0) { - $vhostsettings_stmt = Database::prepare("SELECT `description`, `vhostsettings` FROM " . TABLE_PANEL_VHOSTCONFIGS . " WHERE `id` = :id LIMIT 1;"); - $vhostconfig = Database::pexecute_first($vhostsettings_stmt, array('id' => $domain['vhostsettingid'])); - - $vhost_content .= $this->processSpecialConfigTemplate( - $vhostconfig['vhostsettings'], - $domain, - $domain['ip'], - $domain['port'], - $ssl_vhost) . "\n"; - } - if ($domain['specialsettings'] != '') { $vhost_content .= $this->processSpecialConfigTemplate( $domain['specialsettings'], diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index 89c1521b..c91bd78c 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -164,7 +164,7 @@ class lighttpd extends HttpConfigBase { } if ($row_ipsandports['ssl_cert_file'] != '') { - + // check for existence, #1485 if (!file_exists($row_ipsandports['ssl_cert_file'])) { $this->logger->logAction(CRON_ACTION, LOG_ERR, $ip.':'.$port . ' :: certificate file "'.$row_ipsandports['ssl_cert_file'].'" does not exist! Cannot create ssl-directives'); @@ -175,7 +175,7 @@ class lighttpd extends HttpConfigBase { $this->lighttpd_data[$vhost_filename].= 'ssl.cipher-list = "' . Settings::Get('system.ssl_cipher_list') . '"' . "\n"; $this->lighttpd_data[$vhost_filename].= 'ssl.honor-cipher-order = "enable"' . "\n"; $this->lighttpd_data[$vhost_filename].= 'ssl.pemfile = "' . makeCorrectFile($row_ipsandports['ssl_cert_file']) . '"' . "\n"; - + if ($row_ipsandports['ssl_ca_file'] != '') { // check for existence, #1485 if (!file_exists($row_ipsandports['ssl_ca_file'])) { @@ -455,19 +455,6 @@ class lighttpd extends HttpConfigBase { $vhost_content.= $this->getSslSettings($domain, $ssl_vhost); - // check if vhost config template is set and if so, merge it - if ($domain['vhostsettingid'] != 0) { - $vhostsettings_stmt = Database::prepare("SELECT `description`, `vhostsettings` FROM " . TABLE_PANEL_VHOSTCONFIGS . " WHERE `id` = :id LIMIT 1;"); - $vhostconfig = Database::pexecute_first($vhostsettings_stmt, array('id' => $domain['vhostsettingid'])); - - $vhost_content .= $this->processSpecialConfigTemplate( - $vhostconfig['vhostsettings'], - $domain, - $domain['ip'], - $domain['port'], - $ssl_vhost) . "\n"; - } - if ($domain['specialsettings'] != "") { $vhost_content.= $this->processSpecialConfigTemplate( $domain['specialsettings'], @@ -521,7 +508,7 @@ class lighttpd extends HttpConfigBase { } if ($domain['ssl_cert_file'] != '') { - + $ssl_settings.= 'ssl.engine = "enable"' . "\n"; $ssl_settings.= 'ssl.use-sslv2 = "disable"' . "\n"; $ssl_settings.= 'ssl.cipher-list = "' . Settings::Get('system.ssl_cipher_list') . '"' . "\n"; diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 2f5a39f3..babc15ea 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -444,24 +444,6 @@ class nginx extends HttpConfigBase { $vhost_content.= isset($this->needed_htpasswds[$domain['id']]) ? $this->needed_htpasswds[$domain['id']] . "\n" : ''; - // check if vhost config template is set and if so, merge it - if ($domain['vhostsettingid'] != 0) { - $vhostsettings_stmt = Database::prepare("SELECT `description`, `vhostsettings` FROM " . TABLE_PANEL_VHOSTCONFIGS . " WHERE `id` = :id LIMIT 1;"); - $vhostconfig = Database::pexecute_first($vhostsettings_stmt, array('id' => $domain['vhostsettingid'])); - - // replace {SOCKET} var with unix socket - $php = new phpinterface($domain); - $vhostconfig['vhostsettings'] = str_replace("{SOCKET}", $php->getInterface()->getSocketFile(), $vhostconfig['vhostsettings']); - - $vhost_content = $this->mergeVhostCustom($vhost_content, $this->processSpecialConfigTemplate( - $vhostconfig['vhostsettings'], - $domain, - $domain['ip'], - $domain['port'], - $ssl_vhost - )); - } - if ($domain['specialsettings'] != "") { $vhost_content = $this->mergeVhostCustom($vhost_content, $this->processSpecialConfigTemplate( $domain['specialsettings'], @@ -873,23 +855,20 @@ class nginx extends HttpConfigBase { $this->_deactivated = false; } - // write directives only when vhost_usedefaultlocation is activated in panel domain settings - if ($domain['vhost_usedefaultlocation'] == '1') { - $webroot_text .= "\t" . 'index index.php index.html index.htm;'."\n"; - $webroot_text .= "\n\t" . 'location / {' . "\n"; - $webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;' . "\n"; + $webroot_text .= "\t" . 'index index.php index.html index.htm;'."\n"; + $webroot_text .= "\n\t".'location / {'."\n"; + $webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;'."\n"; - if ($this->vhost_root_autoindex) { - $webroot_text .= "\t\t" . 'autoindex on;' . "\n"; - $this->vhost_root_autoindex = false; - } - - $webroot_text .= "\t" . '}' . "\n\n"; - $webroot_text .= "\tlocation @rewrites {\n"; - $webroot_text .= "\t\trewrite ^ /index.php last;\n"; - $webroot_text .= "\t}\n\n"; + if ($this->vhost_root_autoindex) { + $webroot_text .= "\t\t".'autoindex on;'."\n"; + $this->vhost_root_autoindex = false; } + $webroot_text .= "\t".'}'."\n\n"; + $webroot_text .= "\tlocation @rewrites {\n"; + $webroot_text .= "\t\trewrite ^ /index.php last;\n"; + $webroot_text .= "\t}\n\n"; + return $webroot_text; } diff --git a/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php b/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php index 63bd746f..f47ccd82 100644 --- a/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php +++ b/scripts/jobs/cron_tasks.inc.http.35.nginx_phpfpm.php @@ -23,27 +23,24 @@ class nginx_phpfpm extends nginx if ($domain['phpenabled'] == '1') { $php = new phpinterface($domain); $phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']); + + $php_options_text = "\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n"; + $php_options_text .= "\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n"; + $php_options_text .= "\t" . '}' . "\n\n"; - // write directives only when vhost_usedefaultlocation is activated in panel domain settings - if ($domain['vhost_usedefaultlocation'] == '1') { - $php_options_text = "\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n"; - $php_options_text .= "\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n"; - $php_options_text .= "\t" . '}' . "\n\n"; - - $php_options_text .= "\t" . 'location @php {' . "\n"; - $php_options_text .= "\t\t" . 'try_files $1 = 404;' . "\n\n"; - $php_options_text .= "\t\t" . 'include ' . Settings::Get('nginx.fastcgiparams') . ";\n"; - $php_options_text .= "\t\t" . 'fastcgi_split_path_info ^(.+\.php)(/.+)\$;' . "\n"; - $php_options_text .= "\t\t" . 'fastcgi_param SCRIPT_FILENAME $document_root$1;' . "\n"; - $php_options_text .= "\t\t" . 'fastcgi_param PATH_INFO $2;' . "\n"; - if ($domain['ssl'] == '1' && $ssl_vhost) { - $php_options_text .= "\t\t" . 'fastcgi_param HTTPS on;' . "\n"; - } - $php_options_text .= "\t\t" . 'fastcgi_pass unix:' . $php->getInterface()->getSocketFile() . ";\n"; - $php_options_text .= "\t\t" . 'fastcgi_index index.php;' . "\n"; - $php_options_text .= "\t}\n\n"; + $php_options_text .= "\t" . 'location @php {' . "\n"; + $php_options_text .= "\t\t" . 'try_files $1 = 404;' . "\n\n"; + $php_options_text .= "\t\t" . 'include ' . Settings::Get('nginx.fastcgiparams') . ";\n"; + $php_options_text .= "\t\t" . 'fastcgi_split_path_info ^(.+\.php)(/.+)\$;' . "\n"; + $php_options_text .= "\t\t" . 'fastcgi_param SCRIPT_FILENAME $document_root$1;' . "\n"; + $php_options_text .= "\t\t" . 'fastcgi_param PATH_INFO $2;' . "\n"; + if ($domain['ssl'] == '1' && $ssl_vhost) { + $php_options_text .= "\t\t" . 'fastcgi_param HTTPS on;' . "\n"; } - + $php_options_text .= "\t\t" . 'fastcgi_pass unix:' . $php->getInterface()->getSocketFile() . ";\n"; + $php_options_text .= "\t\t" . 'fastcgi_index index.php;' . "\n"; + $php_options_text .= "\t}\n\n"; + // create starter-file | config-file $php->getInterface()->createConfig($phpconfig); @@ -57,7 +54,7 @@ class nginx_phpfpm extends nginx return $php_options_text; } - + public function createOwnVhostStarter() { if (Settings::Get('phpfpm.enabled') == '1' diff --git a/templates/Sparkle/admin/vhostconfig/overview.tpl b/templates/Sparkle/admin/vhostconfig/overview.tpl deleted file mode 100644 index 4c3066cc..00000000 --- a/templates/Sparkle/admin/vhostconfig/overview.tpl +++ /dev/null @@ -1,40 +0,0 @@ -$header -
-
-

-   - {$lng['menue']['vhostsettings']['maintitle']} -

-
- -
- - - - - - - - - - - - - $tablecontent - -
{$lng['admin']['phpsettings']['description']}{$lng['admin']['phpsettings']['activedomains']}{$lng['panel']['options']}
- - - - - -
- -
-$footer diff --git a/templates/Sparkle/admin/vhostconfig/overview_add.tpl b/templates/Sparkle/admin/vhostconfig/overview_add.tpl deleted file mode 100644 index f665501f..00000000 --- a/templates/Sparkle/admin/vhostconfig/overview_add.tpl +++ /dev/null @@ -1,76 +0,0 @@ -$header -
-
-

- {$title}  - {$title} -

-
- -
- -
- - - - - - - {$vhostconfig_add_form} -
-
-
-
-
-
-
-

- {$lng['admin']['templates']['template_replace_vars']} -

-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$lng['panel']['variable']}{$lng['panel']['description']}
{CUSTOMER}{$lng['admin']['phpconfig']['customer']}
{DOCROOT}{$lng['admin']['vhostconfig']['docroot']}
{DOMAIN}{$lng['admin']['phpconfig']['domain']}
{IP}{$lng['admin']['vhostconfig']['ip']}
{PORT}{$lng['admin']['vhostconfig']['port']}
{SCHEME}{$lng['admin']['vhostconfig']['scheme']}
{SOCKET}{$lng['admin']['vhostconfig']['socket_dir']}
- -
- -
-$footer diff --git a/templates/Sparkle/admin/vhostconfig/overview_edit.tpl b/templates/Sparkle/admin/vhostconfig/overview_edit.tpl deleted file mode 100644 index e61f1106..00000000 --- a/templates/Sparkle/admin/vhostconfig/overview_edit.tpl +++ /dev/null @@ -1,77 +0,0 @@ -$header -
-
-

- {$title}  - {$title} -

-
- -
- -
- - - - - - - - {$vhostconfig_edit_form} -
-
-
-
-
-
-
-

- {$lng['admin']['templates']['template_replace_vars']} -

-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$lng['panel']['variable']}{$lng['panel']['description']}
{CUSTOMER}{$lng['admin']['phpconfig']['customer']}
{DOCROOT}{$lng['admin']['vhostconfig']['docroot']}
{DOMAIN}{$lng['admin']['phpconfig']['domain']}
{IP}{$lng['admin']['vhostconfig']['ip']}
{PORT}{$lng['admin']['vhostconfig']['port']}
{SCHEME}{$lng['admin']['vhostconfig']['scheme']}
{SOCKET}{$lng['admin']['vhostconfig']['socket_dir']}
- -
- -
-$footer diff --git a/templates/Sparkle/admin/vhostconfig/overview_overview.tpl b/templates/Sparkle/admin/vhostconfig/overview_overview.tpl deleted file mode 100644 index b65545bf..00000000 --- a/templates/Sparkle/admin/vhostconfig/overview_overview.tpl +++ /dev/null @@ -1,12 +0,0 @@ - - {$row['description']} - {$domains} - - - {$lng['panel']['edit']} - -   - {$lng['panel']['delete']} - - -