Skip to content

Commit 363ccfe

Browse files
author
Marius Cramer
committed
Merge remote-tracking branch 'origin/stable-3.0.5'
Conflicts: interface/lib/plugins/sites_web_vhost_subdomain_plugin.inc.php interface/web/mail/lib/lang/de_mail_get.lng interface/web/sites/lib/lang/de_cron.lng interface/web/sites/lib/lang/en_cron.lng interface/web/sites/web_vhost_subdomain_edit.php
2 parents add2800 + a246ffd commit 363ccfe

24 files changed

+75
-43
lines changed

install/lib/installer_base.lib.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,6 +2136,13 @@ public function install_ispconfig() {
21362136

21372137
//* Remove Domain module as its functions are available in the client module now
21382138
if(@is_dir('/usr/local/ispconfig/interface/web/domain')) exec('rm -rf /usr/local/ispconfig/interface/web/domain');
2139+
2140+
//* Disable rkhunter run and update in debian cronjob as ispconfig is running and updating rkhunter
2141+
if(is_file('/etc/default/rkhunter')) {
2142+
replaceLine('/etc/default/rkhunter', 'CRON_DAILY_RUN="yes"', 'CRON_DAILY_RUN="no"', 1, 0);
2143+
replaceLine('/etc/default/rkhunter', 'CRON_DB_UPDATE="yes"', 'CRON_DB_UPDATE="no"', 1, 0);
2144+
}
2145+
21392146

21402147

21412148
}

install/lib/update.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929

3030
//* Installer patch stub class
3131
class installer_patch_update {
32-
protected function onBeforeSQL() {
32+
public function onBeforeSQL() {
3333
}
3434

35-
protected function onAfterSQL() {
35+
public function onAfterSQL() {
3636
}
3737

3838
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALTER TABLE `client_template` ADD `limit_backup` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y' AFTER `limit_webdav_user`;
2+
ALTER TABLE `client` ADD `limit_backup` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y' AFTER `limit_webdav_user`;
3+
ALTER TABLE `web_domain` CHANGE `php_fpm_use_socket` `php_fpm_use_socket` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y';
4+
ALTER TABLE `mail_domain` ADD `dkim_selector` VARCHAR(63) NOT NULL DEFAULT 'default' AFTER `dkim`;

install/sql/ispconfig3.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ CREATE TABLE `client` (
204204
`limit_shell_user` int(11) NOT NULL DEFAULT '0',
205205
`ssh_chroot` varchar(255) NOT NULL DEFAULT 'no,jailkit,ssh-chroot',
206206
`limit_webdav_user` int(11) NOT NULL DEFAULT '0',
207+
`limit_backup` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y',
207208
`limit_aps` int(11) NOT NULL DEFAULT '-1',
208209
`default_dnsserver` int(11) unsigned NOT NULL DEFAULT '1',
209210
`db_servers` blob NOT NULL,
@@ -313,6 +314,7 @@ CREATE TABLE `client_template` (
313314
`limit_shell_user` int(11) NOT NULL default '0',
314315
`ssh_chroot` varchar(255) NOT NULL DEFAULT 'no',
315316
`limit_webdav_user` int(11) NOT NULL default '0',
317+
`limit_backup` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y',
316318
`limit_aps` int(11) NOT NULL DEFAULT '-1',
317319
`limit_dns_zone` int(11) NOT NULL default '-1',
318320
`limit_dns_slave_zone` int(11) NOT NULL default '-1',
@@ -740,6 +742,7 @@ CREATE TABLE `mail_domain` (
740742
`server_id` int(11) unsigned NOT NULL default '0',
741743
`domain` varchar(255) NOT NULL default '',
742744
`dkim` ENUM( 'n', 'y' ) NOT NULL default 'n',
745+
`dkim_selector` varchar(63) NOT NULL DEFAULT 'default',
743746
`dkim_private` mediumtext NULL,
744747
`dkim_public` mediumtext NULL,
745748
`active` enum('n','y') NOT NULL,
@@ -1852,7 +1855,7 @@ CREATE TABLE `web_domain` (
18521855
`allow_override` varchar(255) NOT NULL default 'All',
18531856
`apache_directives` mediumtext,
18541857
`nginx_directives` mediumtext,
1855-
`php_fpm_use_socket` ENUM('n','y') NOT NULL DEFAULT 'n',
1858+
`php_fpm_use_socket` ENUM('n','y') NOT NULL DEFAULT 'y',
18561859
`pm` enum('static','dynamic','ondemand') NOT NULL DEFAULT 'dynamic',
18571860
`pm_max_children` int(11) NOT NULL DEFAULT '10',
18581861
`pm_start_servers` int(11) NOT NULL DEFAULT '2',

interface/lib/plugins/sites_web_vhost_domain_plugin.inc.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,21 @@ function sites_web_vhost_domain_edit($event_name, $page_form) {
228228
$app->db->query($sql);
229229
}
230230
} else {
231-
$parent_domain = $app->db->queryOneRecord("SELECT * FROM `web_domain` WHERE `domain_id` = '" . $app->functions->intval($page_form->dataRecord['parent_domain_id']) . "'");
232-
233-
// Set the values for document_root, system_user and system_group
234-
$system_user = $app->db->quote($parent_domain['system_user']);
235-
$system_group = $app->db->quote($parent_domain['system_group']);
236-
$document_root = $app->db->quote($parent_domain['document_root']);
237-
$php_open_basedir = str_replace("[website_path]/web", $document_root.'/'.$page_form->dataRecord['web_folder'], $web_config["php_open_basedir"]);
238-
$php_open_basedir = str_replace("[website_domain]/web", $page_form->dataRecord['domain'].'/'.$page_form->dataRecord['web_folder'], $php_open_basedir);
239-
$php_open_basedir = str_replace("[website_path]", $document_root, $php_open_basedir);
240-
$php_open_basedir = $app->db->quote(str_replace("[website_domain]", $page_form->dataRecord['domain'], $php_open_basedir));
241-
$htaccess_allow_override = $app->db->quote($parent_domain['allow_override']);
242-
$sql = "UPDATE web_domain SET sys_groupid = ".$app->functions->intval($parent_domain['sys_groupid']).",system_user = '$system_user', system_group = '$system_group', document_root = '$document_root', allow_override = '$htaccess_allow_override', php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$page_form->id;
243-
$app->db->query($sql);
231+
if(isset($page_form->dataRecord["parent_domain_id"]) && $page_form->dataRecord["parent_domain_id"] != $page_form->oldDataRecord["parent_domain_id"]) {
232+
$parent_domain = $app->db->queryOneRecord("SELECT * FROM `web_domain` WHERE `domain_id` = '" . $app->functions->intval($page_form->dataRecord['parent_domain_id']) . "'");
233+
234+
// Set the values for document_root, system_user and system_group
235+
$system_user = $app->db->quote($parent_domain['system_user']);
236+
$system_group = $app->db->quote($parent_domain['system_group']);
237+
$document_root = $app->db->quote($parent_domain['document_root']);
238+
$php_open_basedir = str_replace("[website_path]/web", $document_root.'/'.$page_form->dataRecord['web_folder'], $web_config["php_open_basedir"]);
239+
$php_open_basedir = str_replace("[website_domain]/web", $page_form->dataRecord['domain'].'/'.$page_form->dataRecord['web_folder'], $php_open_basedir);
240+
$php_open_basedir = str_replace("[website_path]", $document_root, $php_open_basedir);
241+
$php_open_basedir = $app->db->quote(str_replace("[website_domain]", $page_form->dataRecord['domain'], $php_open_basedir));
242+
$htaccess_allow_override = $app->db->quote($parent_domain['allow_override']);
243+
$sql = "UPDATE web_domain SET sys_groupid = ".$app->functions->intval($parent_domain['sys_groupid']).",system_user = '$system_user', system_group = '$system_group', document_root = '$document_root', allow_override = '$htaccess_allow_override', php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$page_form->id;
244+
$app->db->query($sql);
245+
}
244246
}
245247
}
246248

interface/web/client/client_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function onShowEnd() {
223223

224224
if($app->auth->is_admin()) {
225225
// Fill the client select field
226-
$sql = "SELECT client.client_id, sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 AND client.limit_client > 0 ORDER BY sys_group.name";
226+
$sql = "SELECT client.client_id, sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 AND client.limit_client > 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
227227
$clients = $app->db->queryAllRecords($sql);
228228
$client_select = "<option value='0'>- ".$app->tform->lng('none_txt')." -</option>";
229229
//$tmp_data_record = $app->tform->getDataRecord($this->id);

interface/web/client/domain_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function onShowEnd() {
8181
if($_SESSION["s"]["user"]["typ"] == 'admin') {
8282
// Getting Clients of the user
8383
//$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
84-
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
84+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
8585
$clients = $app->db->queryAllRecords($sql);
8686
$client_select = '';
8787
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
@@ -100,7 +100,7 @@ function onShowEnd() {
100100
$client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
101101

102102
// Fill the client select field
103-
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name";
103+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY client.company_name, client.contact_name, sys_group.name";
104104
//die($sql);
105105
$records = $app->db->queryAllRecords($sql);
106106
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$app->functions->intval($client['client_id']));

interface/web/dns/dns_import.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
$app->tpl->setVar("server_id", $server_id_option);
8888

8989
// load the list of clients
90-
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
90+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
9191
$clients = $app->db->queryAllRecords($sql);
9292
$client_select = '';
9393
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
@@ -109,7 +109,7 @@
109109

110110

111111
// load the list of clients
112-
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".intval($client['client_id']);
112+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".intval($client['client_id'])." ORDER BY client.company_name, client.contact_name, sys_group.name";
113113
$clients = $app->db->queryAllRecords($sql);
114114
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".intval($client['client_id']));
115115
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>';

interface/web/dns/dns_slave_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function onShowEnd() {
7272
// If user is admin, we will allow him to select to whom this record belongs
7373
if($_SESSION["s"]["user"]["typ"] == 'admin') {
7474
// Getting Domains of the user
75-
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
75+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
7676
$clients = $app->db->queryAllRecords($sql);
7777
$client_select = '';
7878
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
@@ -91,7 +91,7 @@ function onShowEnd() {
9191
$client = $app->db->queryOneRecord("SELECT client.client_id, sys_group.name, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
9292

9393
// Fill the client select field
94-
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name";
94+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY client.company_name, client.contact_name, sys_group.name";
9595
$clients = $app->db->queryAllRecords($sql);
9696
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
9797
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>';

interface/web/dns/dns_soa_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function onShowEnd() {
8282
// If user is admin, we will allow him to select to whom this record belongs
8383
if($_SESSION["s"]["user"]["typ"] == 'admin') {
8484
// Getting Domains of the user
85-
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
85+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name";
8686
$clients = $app->db->queryAllRecords($sql);
8787
$client_select = '';
8888
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
@@ -101,7 +101,7 @@ function onShowEnd() {
101101
$client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
102102

103103
// Fill the client select field
104-
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name";
104+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY client.company_name, client.contact_name, sys_group.name";
105105
$clients = $app->db->queryAllRecords($sql);
106106
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
107107
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>';

0 commit comments

Comments
 (0)