Skip to content

Commit 33ab748

Browse files
committed
Merge branch 'stable-3.1' of https://git.ispconfig.org/ispconfig/ispconfig3 into stable-3.1
2 parents 07cef89 + 09767f8 commit 33ab748

File tree

73 files changed

+714
-623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+714
-623
lines changed

install/sql/incremental/upd_dev_collection.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ ALTER TABLE `web_domain` DROP COLUMN `enable_spdy`;
4545
-- was missing in incremental, inserted for fixing older installations
4646
ALTER TABLE `web_domain` ADD `folder_directive_snippets` TEXT NULL AFTER `https_port`;
4747

48+
4849
ALTER TABLE `web_domain` ADD `server_php_id` INT(11) UNSIGNED NOT NULL DEFAULT 0;
4950

5051
UPDATE `web_domain` as w LEFT JOIN sys_group as g ON (g.groupid = w.sys_groupid) INNER JOIN `server_php` as p ON (w.fastcgi_php_version = CONCAT(p.name, ':', p.php_fastcgi_binary, ':', p.php_fastcgi_ini_dir) AND p.server_id IN (0, w.server_id) AND p.client_id IN (0, g.client_id)) SET w.server_php_id = p.server_php_id, w.fastcgi_php_version = '' WHERE 1;
@@ -70,3 +71,8 @@ ALTER TABLE `dns_soa` ADD `dnssec_algo` SET('NSEC3RSASHA1','ECDSAP256SHA256') NU
7071
UPDATE `dns_soa` SET `dnssec_algo` = 'NSEC3RSASHA1' WHERE `dnssec_algo` IS NULL AND dnssec_initialized = 'Y';
7172
UPDATE `dns_soa` SET `dnssec_algo` = 'ECDSAP256SHA256' WHERE `dnssec_algo` IS NULL AND dnssec_initialized = 'N';
7273
ALTER TABLE `dns_soa` CHANGE `dnssec_algo` `dnssec_algo` SET('NSEC3RSASHA1','ECDSAP256SHA256') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'ECDSAP256SHA256';
74+
75+
-- Fix issue #5635
76+
ALTER TABLE `client_template` CHANGE `ssh_chroot` `ssh_chroot` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
77+
ALTER TABLE `client_template` CHANGE `web_php_options` `web_php_options` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
78+

install/sql/ispconfig3.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ CREATE TABLE `client_template` (
330330
`limit_web_ip` text,
331331
`limit_web_domain` int(11) NOT NULL default '-1',
332332
`limit_web_quota` int(11) NOT NULL default '-1',
333-
`web_php_options` varchar(255) NOT NULL DEFAULT 'no',
333+
`web_php_options` varchar(255) NOT NULL DEFAULT '',
334334
`limit_cgi` enum('n','y') NOT NULL DEFAULT 'n',
335335
`limit_ssi` enum('n','y') NOT NULL DEFAULT 'n',
336336
`limit_perl` enum('n','y') NOT NULL DEFAULT 'n',
@@ -345,7 +345,7 @@ CREATE TABLE `client_template` (
345345
`limit_web_aliasdomain` int(11) NOT NULL default '-1',
346346
`limit_ftp_user` int(11) NOT NULL default '-1',
347347
`limit_shell_user` int(11) NOT NULL default '0',
348-
`ssh_chroot` varchar(255) NOT NULL DEFAULT 'no',
348+
`ssh_chroot` varchar(255) NOT NULL DEFAULT '',
349349
`limit_webdav_user` int(11) NOT NULL default '0',
350350
`limit_backup` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y',
351351
`limit_directive_snippets` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n',

install/tpl/apache_apps.vhost.master

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
<tmpl_var name="ssl_comment">SSLStaplingReturnResponderErrors Off
5959
</tmpl_if>
6060

61-
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
62-
<IfModule mod_ssl.c>
63-
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
64-
</IfModule>
65-
</tmpl_if>
66-
6761
<IfModule mod_headers.c>
6862
RequestHeader unset Proxy early
6963
</IfModule>
@@ -127,6 +121,4 @@
127121
RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P]
128122
{/tmpl_if}
129123

130-
131-
132124
</VirtualHost>

install/tpl/apache_ispconfig.conf.master

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,28 @@ NameVirtualHost *:443
146146
NameVirtualHost {tmpl_var name="ip_address"}:{tmpl_var name="port"}
147147
</tmpl_loop>
148148

149+
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
150+
<IfModule mod_ssl.c>
151+
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
152+
</IfModule>
153+
</tmpl_if>
154+
155+
<Directory /var/www/php-cgi-scripts>
156+
AllowOverride None
157+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
158+
Require all denied
159+
<tmpl_else>
160+
Order Deny,Allow
161+
Deny from all
162+
</tmpl_if>
163+
</Directory>
164+
165+
<Directory /var/www/php-fcgi-scripts>
166+
AllowOverride None
167+
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
168+
Require all denied
169+
<tmpl_else>
170+
Order Deny,Allow
171+
Deny from all
172+
</tmpl_if>
173+
</Directory>

install/tpl/apache_ispconfig.vhost.master

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,3 @@ NameVirtualHost *:<tmpl_var name="vhost_port">
111111
<tmpl_var name="ssl_comment">SSLStaplingReturnResponderErrors Off
112112
</tmpl_if>
113113
</VirtualHost>
114-
115-
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
116-
<IfModule mod_ssl.c>
117-
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
118-
</IfModule>
119-
</tmpl_if>
120-
121-
<Directory /var/www/php-cgi-scripts>
122-
AllowOverride None
123-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
124-
Require all denied
125-
<tmpl_else>
126-
Order Deny,Allow
127-
Deny from all
128-
</tmpl_if>
129-
</Directory>
130-
131-
<Directory /var/www/php-fcgi-scripts>
132-
AllowOverride None
133-
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
134-
Require all denied
135-
<tmpl_else>
136-
Order Deny,Allow
137-
Deny from all
138-
</tmpl_if>
139-
</Directory>

install/tpl/system.ini.master

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ custom_login_link=
5252
dashboard_atom_url_admin=https://www.ispconfig.org/atom
5353
dashboard_atom_url_reseller=https://www.ispconfig.org/atom
5454
dashboard_atom_url_client=https://www.ispconfig.org/atom
55-
monitor_key=
5655
tab_change_discard=n
5756
tab_change_warning=n
5857
use_loadindicator=y

interface/lib/classes/tform_base.inc.php

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,11 @@ function getDatasourceData($field, $record) {
336336
}
337337

338338
//* If the parameter 'valuelimit' is set
339-
function applyValueLimit($limit, $values, $current_value = '') {
339+
function applyValueLimit($formtype, $limit, $values, $current_value = '') {
340340

341341
global $app;
342342

343-
// we mas have multiple limits, therefore we explode by ; first
343+
// we may have multiple limits, therefore we explode by ; first
344344
// Example: "system:sites:web_php_options;client:web_php_options"
345345
$limits = explode(';',$limit);
346346

@@ -399,18 +399,31 @@ function applyValueLimit($limit, $values, $current_value = '') {
399399
$tmp_key = $limit_parts[2];
400400
$allowed = $allowed = explode(',',$tmp_conf[$tmp_key]);
401401
}
402+
403+
if($formtype == 'CHECKBOX') {
404+
if(strstr($limit,'force_')) {
405+
// Force the checkbox field to be ticked and enabled
406+
if($allowed[0] == $values[1]) {
407+
$values = 'on';
408+
}
409+
} else {
410+
// Force the checkbox field to be unchecked and disabled
411+
if($allowed[0] == $values[0]) {
412+
$values = 'off';
413+
}
414+
}
415+
} else {
416+
// add the current value to the allowed array
417+
$allowed[] = $current_value;
402418

403-
// add the current value to the allowed array
404-
$allowed[] = $current_value;
405-
406-
// remove all values that are not allowed
407-
$values_new = array();
408-
foreach($values as $key => $val) {
409-
if(in_array($key, $allowed)) $values_new[$key] = $val;
419+
// remove all values that are not allowed
420+
$values_new = array();
421+
foreach($values as $key => $val) {
422+
if(in_array($key, $allowed)) $values_new[$key] = $val;
423+
}
424+
$values = $values_new;
410425
}
411426

412-
$values = $values_new;
413-
414427
}
415428

416429
return $values;
@@ -479,7 +492,7 @@ function getHTML($record, $tab, $action = 'NEW') {
479492

480493
// If a limitation for the values is set
481494
if(isset($field['valuelimit']) && is_array($field["value"])) {
482-
$field["value"] = $this->applyValueLimit($field['valuelimit'], $field["value"], $val);
495+
$field["value"] = $this->applyValueLimit($field['formtype'], $field['valuelimit'], $field["value"], $val);
483496
}
484497

485498
switch ($field['formtype']) {
@@ -521,8 +534,14 @@ function getHTML($record, $tab, $action = 'NEW') {
521534
break;
522535

523536
case 'CHECKBOX':
524-
$checked = ($val == $field['value'][1])?' CHECKED':'';
525-
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" $checked />\r\n";
537+
if($field["value"] == 'off') {
538+
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" disabled=\"disabled\" />\r\n";
539+
} elseif ($field["value"] == 'on') {
540+
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" disabled=\"disabled\" CHECKED />\r\n";
541+
} else {
542+
$checked = ($val == $field['value'][1])?' CHECKED':'';
543+
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" $checked />\r\n";
544+
}
526545
break;
527546

528547
case 'CHECKBOXARRAY':
@@ -614,7 +633,7 @@ function getHTML($record, $tab, $action = 'NEW') {
614633

615634
// If a limitation for the values is set
616635
if(isset($field['valuelimit']) && is_array($field["value"])) {
617-
$field["value"] = $this->applyValueLimit($field['valuelimit'], $field["value"], $field['default']);
636+
$field["value"] = $this->applyValueLimit($field['formtype'], $field['valuelimit'], $field["value"], $field['default']);
618637
}
619638

620639
switch ($field['formtype']) {
@@ -651,9 +670,15 @@ function getHTML($record, $tab, $action = 'NEW') {
651670
break;
652671

653672
case 'CHECKBOX':
654-
// $checked = (empty($field["default"]))?'':' CHECKED';
655-
$checked = ($field["default"] == $field['value'][1])?' CHECKED':'';
656-
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" $checked />\r\n";
673+
if($field["value"] == 'off') {
674+
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" disabled=\"disabled\" />\r\n";
675+
} elseif ($field["value"] == 'on') {
676+
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" disabled=\"disabled\" CHECKED />\r\n";
677+
} else {
678+
// $checked = (empty($field["default"]))?'':' CHECKED';
679+
$checked = ($field["default"] == $field['value'][1])?' CHECKED':'';
680+
$new_record[$key] = "<input name=\"".$key."\" id=\"".$key."\" value=\"".$field['value'][1]."\" type=\"checkbox\" $checked />\r\n";
681+
}
657682
break;
658683

659684
case 'CHECKBOXARRAY':

interface/lib/plugins/mail_user_filter_plugin.inc.php

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,13 @@ private function mail_user_filter_get_rule($page_form) {
137137
$content = '';
138138
$content .= '### BEGIN FILTER_ID:'.$page_form->id."\n";
139139

140-
//$content .= 'require ["fileinto", "regex", "vacation"];'."\n";
141-
140+
if($page_form->dataRecord["source"] == 'Header') {
141+
$parts = explode(':',trim($page_form->dataRecord["searchterm"]));
142+
$page_form->dataRecord["source"] = trim(array_shift($parts));
143+
$page_form->dataRecord["searchterm"] = trim(implode(':',$parts));
144+
unset($parts);
145+
}
146+
142147
if($page_form->dataRecord["op"] == 'domain') {
143148
$content .= 'if address :domain :is "'.strtolower($page_form->dataRecord["source"]).'" "'.$page_form->dataRecord["searchterm"].'" {'."\n";
144149
} elseif ($page_form->dataRecord["op"] == 'localpart') {
@@ -152,33 +157,50 @@ private function mail_user_filter_get_rule($page_form) {
152157
$content .= 'if size :over '.intval($page_form->dataRecord["searchterm"]).$unit.' {'."\n";
153158
} else {
154159

155-
if($page_form->dataRecord["source"] == 'Header') {
156-
$parts = explode(':',trim($page_form->dataRecord["searchterm"]));
157-
$page_form->dataRecord["source"] = trim($parts[0]);
158-
unset($parts[0]);
159-
$page_form->dataRecord["searchterm"] = trim(implode(':',$parts));
160-
unset($parts);
161-
}
160+
$content .= 'if header :regex "'.strtolower($page_form->dataRecord["source"]).'" ["';
161+
162+
# special chars in sieve regex must be escaped with double-backslash
163+
if($page_form->dataRecord["op"] == 'regex') {
164+
# if providing a regex, special chars must already be quoted as intended;
165+
# we will simply try to check for an obviously unquoted double-quote and handle that.
166+
$patterns = array( '/([^\\\\]{2})"/', '/([^\\\\])\\\\"/' );
167+
$replace = array( '${1}\\\\\\\\"', '${1}\\\\\\\\"' );
168+
$searchterm = preg_replace( $patterns, $replace, $page_form->dataRecord["searchterm"] );
169+
} else {
170+
$sieve_regex_escape = array(
171+
'\\' => '\\\\\\',
172+
'+' => '\\\\+',
173+
'*' => '\\\\*',
174+
'?' => '\\\\?',
175+
'[' => '\\\\[',
176+
'^' => '\\\\^',
177+
']' => '\\\\]',
178+
'$' => '\\\\$',
179+
'(' => '\\\\(',
180+
')' => '\\\\)',
181+
'{' => '\\\\{',
182+
'}' => '\\\\}',
183+
'|' => '\\\\|',
184+
'.' => '\\\\.',
185+
# these (from preg_quote) should not be needed
186+
#'=' => '\\\\=',
187+
#'!' => '\\\\!',
188+
#'<' => '\\\\<',
189+
#'>' => '\\\\>',
190+
#':' => '\\\\:',
191+
#'-' => '\\\\-',
192+
#'#' => '\\\\#',
193+
);
194+
$searchterm = strtr( $page_form->dataRecord["searchterm"], $sieve_regex_escape );
162195

163-
$content .= 'if header :regex ["'.strtolower($page_form->dataRecord["source"]).'"] ["';
164-
165-
$searchterm = preg_quote($page_form->dataRecord["searchterm"]);
166-
$searchterm = str_replace(
167-
array(
168-
'"',
169-
'\\[',
170-
'\\]'
171-
),
172-
array(
173-
'\\"',
174-
'\\\\[',
175-
'\\\\]'
176-
), $searchterm);
196+
}
177197

178198
if($page_form->dataRecord["op"] == 'contains') {
179199
$content .= ".*".$searchterm;
180200
} elseif ($page_form->dataRecord["op"] == 'is') {
181201
$content .= "^".$searchterm."$";
202+
} elseif ($page_form->dataRecord["op"] == 'regex') {
203+
$content .= $searchterm;
182204
} elseif ($page_form->dataRecord["op"] == 'begins') {
183205
$content .= "^".$searchterm."";
184206
} elseif ($page_form->dataRecord["op"] == 'ends') {

interface/web/admin/form/system_config.tform.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -595,12 +595,6 @@
595595
'default' => 'http://www.ispconfig.org/atom',
596596
'value' => ''
597597
),
598-
'monitor_key' => array (
599-
'datatype' => 'VARCHAR',
600-
'formtype' => 'TEXT',
601-
'default' => '',
602-
'value' => ''
603-
),
604598
'tab_change_discard' => array (
605599
'datatype' => 'VARCHAR',
606600
'formtype' => 'CHECKBOX',

interface/web/admin/lib/lang/ar_system_config.lng

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ $wb['enable_custom_login_txt'] = 'Allow custom login name';
2727
$wb['mailmailinglist_link_txt'] = 'Link to mailing list in Mailing list list';
2828
$wb['mailmailinglist_url_txt'] = 'Mailing list URL';
2929
$wb['admin_mail_txt'] = 'Administrators e-mail';
30-
$wb['monitor_key_txt'] = 'Monitor keyword';
3130
$wb['admin_name_txt'] = 'Administrators name';
3231
$wb['maintenance_mode_txt'] = 'Maintenance Mode';
3332
$wb['maintenance_mode_exclude_ips_txt'] = 'Exclude IP\'s from maintenance';

0 commit comments

Comments
 (0)