Revert "Merge pull request #318 from Churro/froxlorMerge_33ab67a"

This reverts commit 4f2ee129fd, reversing
changes made to f284d67843.
This commit is contained in:
Michael Kaufmann (d00p)
2016-03-03 23:38:02 +01:00
parent 130d3e7b16
commit f9d949f90c
19 changed files with 35 additions and 733 deletions

View File

@@ -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
@@ -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';

View File

@@ -62,7 +62,6 @@ if ($page == 'overview') {
}
}
$query .= " ORDER BY domain ASC";
$domainresult_stmt = Database::prepare($query);
Database::pexecute($domainresult_stmt, $query_params);

View File

@@ -1,233 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2016 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 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'] . '<br/>';
}
}
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'] = '<b>'.$row['description'].'</b>';
}
$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');
}
}
}

View File

@@ -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',
@@ -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;

View File

@@ -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',

View File

@@ -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',

View File

@@ -1,43 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2016 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 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
)
)
)
)
)
);

View File

@@ -1,45 +0,0 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2016 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 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']
)
)
)
)
)
);

View File

@@ -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');

View File

@@ -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 <strong>http</strong> or <strong>https</strong> 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 <br>location / { ... }<br> location @rewrites { ... }<br> location ~ ^(.+?\.php)(/.*)?$ { ... }<br> 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';

View File

@@ -1611,22 +1611,4 @@ $lng['domains']['termination_date'] = 'K&uuml;ndigungsdatum';
$lng['domains']['termination_date_overview'] = 'gek&uuml;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 <strong>http</strong> bzw. mit <strong>https</strong> 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 <br>location / { ... }<br> location @rewrites { ... }<br> location ~ ^(.+?\.php)(/.*)?$ { ... }<br> nicht in die Konfigurationsdatei geschrieben.';
$lng['question']['vhostsetting_reallydelete'] = 'Wollen Sie diese VHost-Vorlage wirklich löschen?';
$lng['admin']['server_templates'] = 'Vorlagen';

View File

@@ -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'],

View 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'],

View File

@@ -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,22 +855,19 @@ 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 .= "\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";
$webroot_text .= "\t\t".'autoindex on;'."\n";
$this->vhost_root_autoindex = false;
}
$webroot_text .= "\t" . '}' . "\n\n";
$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;
}

View File

@@ -24,8 +24,6 @@ class nginx_phpfpm extends nginx
$php = new phpinterface($domain);
$phpconfig = $php->getPhpConfig((int)$domain['phpsettingid']);
// 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";
@@ -42,7 +40,6 @@ class nginx_phpfpm extends nginx
$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);

View File

@@ -1,40 +0,0 @@
$header
<article>
<header>
<h2>
<img src="templates/{$theme}/assets/img/icons/phpsettings_big.png" alt="" />&nbsp;
{$lng['menue']['vhostsettings']['maintitle']}
</h2>
</header>
<section>
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'vhostsettings', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['vhostsettings']['addnew']}</a>
</div>
<table class="full hl">
<thead>
<tr>
<th>{$lng['admin']['phpsettings']['description']}</th>
<th>{$lng['admin']['phpsettings']['activedomains']}</th>
<th>{$lng['panel']['options']}</th>
</tr>
</thead>
<tbody>
$tablecontent
</tbody>
</table>
<if 15 < $count>
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'vhostsettings', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['vhostsettings']['addnew']}</a>
</div>
</if>
</section>
</article>
$footer

View File

@@ -1,76 +0,0 @@
$header
<article>
<header>
<h2>
<img src="templates/{$theme}/assets/img/icons/phpsettings_add_big.png" alt="{$title}" />&nbsp;
{$title}
</h2>
</header>
<section>
<form action="{$linker->getLink(array('section' => 'vhostsettings'))}" method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="s" value="$s" />
<input type="hidden" name="page" value="$page" />
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="send" value="send" />
<table class="full">
{$vhostconfig_add_form}
</table>
</form>
</section>
</article>
<br />
<article>
<header>
<h3>
{$lng['admin']['templates']['template_replace_vars']}
</h3>
</header>
<section>
<table class="full">
<thead>
<tr>
<th>{$lng['panel']['variable']}</th>
<th>{$lng['panel']['description']}</th>
</tr>
</thead>
<tbody>
<tr>
<td><em>{CUSTOMER}</em></td>
<td>{$lng['admin']['phpconfig']['customer']}</td>
</tr>
<tr>
<td><em>{DOCROOT}</em></td>
<td>{$lng['admin']['vhostconfig']['docroot']}</td>
</tr>
<tr>
<td><em>{DOMAIN}</em></td>
<td>{$lng['admin']['phpconfig']['domain']}</td>
</tr>
<tr>
<td><em>{IP}</em></td>
<td>{$lng['admin']['vhostconfig']['ip']}</td>
</tr>
<tr>
<td><em>{PORT}</em></td>
<td>{$lng['admin']['vhostconfig']['port']}</td>
</tr>
<tr>
<td><em>{SCHEME}</em></td>
<td>{$lng['admin']['vhostconfig']['scheme']}</td>
</tr>
<tr>
<td><em>{SOCKET}</em></td>
<td>{$lng['admin']['vhostconfig']['socket_dir']}</td>
</tr>
</tbody>
</table>
</section>
</article>
$footer

View File

@@ -1,77 +0,0 @@
$header
<article>
<header>
<h2>
<img src="templates/{$theme}/assets/img/icons/phpsettings_edit_big.png" alt="{$title}" />&nbsp;
{$title}
</h2>
</header>
<section>
<form action="{$linker->getLink(array('section' => 'vhostsettings'))}" method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="s" value="$s"/>
<input type="hidden" name="page" value="$page"/>
<input type="hidden" name="action" value="edit"/>
<input type="hidden" name="id" value="$id"/>
<input type="hidden" name="send" value="send" />
<table class="full">
{$vhostconfig_edit_form}
</table>
</form>
</section>
</article>
<br />
<article>
<header>
<h3>
{$lng['admin']['templates']['template_replace_vars']}
</h3>
</header>
<section>
<table class="full">
<thead>
<tr>
<th>{$lng['panel']['variable']}</th>
<th>{$lng['panel']['description']}</th>
</tr>
</thead>
<tbody>
<tr>
<td><em>{CUSTOMER}</em></td>
<td>{$lng['admin']['phpconfig']['customer']}</td>
</tr>
<tr>
<td><em>{DOCROOT}</em></td>
<td>{$lng['admin']['vhostconfig']['docroot']}</td>
</tr>
<tr>
<td><em>{DOMAIN}</em></td>
<td>{$lng['admin']['phpconfig']['domain']}</td>
</tr>
<tr>
<td><em>{IP}</em></td>
<td>{$lng['admin']['vhostconfig']['ip']}</td>
</tr>
<tr>
<td><em>{PORT}</em></td>
<td>{$lng['admin']['vhostconfig']['port']}</td>
</tr>
<tr>
<td><em>{SCHEME}</em></td>
<td>{$lng['admin']['vhostconfig']['scheme']}</td>
</tr>
<tr>
<td><em>{SOCKET}</em></td>
<td>{$lng['admin']['vhostconfig']['socket_dir']}</td>
</tr>
</tbody>
</table>
</section>
</article>
$footer

View File

@@ -1,12 +0,0 @@
<tr class="top">
<td><strong>{$row['description']}</strong></td>
<td>{$domains}</td>
<td>
<a href="{$linker->getLink(array('section' => 'vhostsettings', 'page' => $page, 'action' => 'edit', 'id' => $row['id']))}">
<img src="templates/{$theme}/assets/img/icons/edit.png" alt="{$lng['panel']['edit']}" title="{$lng['panel']['edit']}" />
</a>
&nbsp;<a href="{$linker->getLink(array('section' => 'vhostsettings', 'page' => $page, 'action' => 'delete', 'id' => $row['id']))}">
<img src="templates/{$theme}/assets/img/icons/delete.png" alt="{$lng['panel']['delete']}" title="{$lng['panel']['delete']}" />
</a>
</td>
</tr>