Skip to content

Commit 033cac3

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' into 'stable-3.1'
# Conflicts: # install/sql/incremental/upd_dev_collection.sql
2 parents 59f5fa8 + f09c9af commit 033cac3

File tree

104 files changed

+317
-301
lines changed

Some content is hidden

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

104 files changed

+317
-301
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -953,24 +953,13 @@ public function install_ispconfig()
953953
//* copy the ISPConfig security part
954954
$command = 'cp -rf ../security '.$install_dir;
955955
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
956-
957-
//* Apply changed security_settings.ini values to new security_settings.ini file
958-
if(is_file('/usr/local/ispconfig/security/security_settings.ini~')) {
959-
$security_settings_old = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini~'));
960-
$security_settings_new = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini'));
961-
if(is_array($security_settings_new) && is_array($security_settings_old)) {
962-
foreach($security_settings_new as $section => $sval) {
963-
if(is_array($sval)) {
964-
foreach($sval as $key => $val) {
965-
if(isset($security_settings_old[$section]) && isset($security_settings_old[$section][$key])) {
966-
$security_settings_new[$section][$key] = $security_settings_old[$section][$key];
967-
}
968-
}
969-
}
970-
}
971-
file_put_contents('/usr/local/ispconfig/security/security_settings.ini',array_to_ini($security_settings_new));
972-
}
956+
957+
$configfile = 'security_settings.ini';
958+
if(is_file($install_dir.'/security/'.$configfile)) {
959+
copy($install_dir.'/security/'.$configfile, $install_dir.'/security/'.$configfile.'~');
973960
}
961+
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
962+
wf($install_dir.'/security/'.$configfile, $content);
974963

975964
//* Create a symlink, so ISPConfig is accessible via web
976965
// Replaced by a separate vhost definition for port 8080

install/lib/install.lib.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,15 @@ function get_distname() {
345345
$distid = 'centos72';
346346
}
347347
swriteln("Operating System: CentOS $var\n");
348-
} elseif(stristr($content, 'CentOS Linux release 8')) {
349-
$distname = 'CentOS';
350-
$distver = 'Unknown';
351-
$distbaseid = 'fedora';
348+
} elseif(stristr($content, 'CentOS Linux release 8')) {
349+
$distname = 'CentOS';
350+
$distver = 'Unknown';
351+
$distbaseid = 'fedora';
352352
$distid = 'centos80';
353-
$var=explode(" ", $content);
354-
$var=explode(".", $var[3]);
355-
$var=$var[0].".".$var[1];
356-
swriteln("Operating System: CentOS $var\n");
353+
$var=explode(" ", $content);
354+
$var=explode(".", $var[3]);
355+
$var=$var[0].".".$var[1];
356+
swriteln("Operating System: CentOS $var\n");
357357
} else {
358358
$distname = 'Redhat';
359359
$distver = 'Unknown';

install/sql/incremental/upd_dev_collection.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@ ALTER TABLE `dns_rr` CHANGE `type` `type` ENUM('A','AAAA','ALIAS','CNAME','DNAME
3939
-- change cc and sender_cc column type
4040
ALTER TABLE `mail_user` CHANGE `cc` `cc` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
4141

42+
-- remove SPDY option
43+
ALTER TABLE `web_domain` DROP COLUMN `enable_spdy`;
44+
4245
-- was missing in incremental, inserted for fixing older installations
4346
ALTER TABLE `web_domain` ADD `folder_directive_snippets` TEXT NULL AFTER `https_port`;

install/sql/ispconfig3.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2070,7 +2070,6 @@ CREATE TABLE `web_domain` (
20702070
`traffic_quota_lock` enum('n','y') NOT NULL default 'n',
20712071
`fastcgi_php_version` varchar(255) DEFAULT NULL,
20722072
`proxy_directives` mediumtext,
2073-
`enable_spdy` ENUM('y','n') NULL DEFAULT 'n',
20742073
`last_quota_notification` date NULL default NULL,
20752074
`rewrite_rules` mediumtext,
20762075
`added_date` date NULL DEFAULT NULL,

install/tpl/apache_apps.vhost.master

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,14 @@
1010
<VirtualHost {tmpl_var name='apps_vhost_ip'}:{tmpl_var name='apps_vhost_port'}>
1111
ServerAdmin webmaster@localhost
1212
{tmpl_var name='apps_vhost_servername'}
13-
13+
1414
<FilesMatch "\.ph(p3?|tml)$">
1515
SetHandler None
1616
</FilesMatch>
17-
17+
1818
<IfModule mod_headers.c>
1919
RequestHeader unset Proxy early
2020
</IfModule>
21-
22-
{tmpl_if name="enable_spdy" op="==" value="y"}
23-
<IfModule spdy_module>
24-
SpdyEnabled on
25-
</IfModule>
26-
{/tmpl_if}
2721

2822
<IfModule mod_php5.c>
2923
DocumentRoot {tmpl_var name='apps_vhost_dir'}
@@ -39,7 +33,7 @@
3933
</tmpl_if>
4034
</Directory>
4135
</IfModule>
42-
36+
4337
<IfModule mod_php7.c>
4438
DocumentRoot {tmpl_var name='apps_vhost_dir'}
4539
AddType application/x-httpd-php .php
@@ -54,7 +48,7 @@
5448
</tmpl_if>
5549
</Directory>
5650
</IfModule>
57-
51+
5852
<IfModule mod_fcgid.c>
5953
DocumentRoot {tmpl_var name='apps_vhost_dir'}
6054
SuexecUserGroup ispapps ispapps
@@ -87,5 +81,3 @@
8781

8882

8983
</VirtualHost>
90-
91-

install/tpl/server.ini.master

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ php_ini_path_apache=/etc/php5/apache2/php.ini
9494
php_ini_path_cgi=/etc/php5/cgi/php.ini
9595
check_apache_config=y
9696
enable_sni=y
97-
enable_spdy=n
9897
skip_le_check=n
9998
enable_ip_wildcard=y
10099
overtraffic_notify_admin=y

interface/lib/classes/system.inc.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ public function has_service($userid, $service) {
3939

4040
if(!preg_match('/^[a-z]+$/', $service)) $app->error('Invalid service '.$service);
4141

42+
// Check the servers table to see which kinds of servers we actually have enabled.
43+
// simple query cache
44+
if($this->server_count === null) {
45+
$this->server_count = $app->db->queryOneRecord("SELECT SUM(mail_server) as mail, SUM(web_server) AS web, SUM(dns_server) AS dns, SUM(file_server) AS file,
46+
SUM(db_server) AS db, SUM(vserver_server) AS vserver, SUM(proxy_server) AS proxy, SUM(firewall_server) AS firewall, SUM(xmpp_server) AS xmpp
47+
FROM `server` WHERE mirror_server_id = 0");
48+
}
49+
// Check if we have the service enabled.
50+
if ($this->server_count[$service] == 0) {
51+
return FALSE;
52+
}
53+
4254
if(isset($_SESSION['s']['user']) && $_SESSION['s']['user']['typ'] == 'admin') return true; //* We do not check admin-users
4355

4456
// simple query cache

interface/lib/classes/tform_base.inc.php

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ function loadFormDef($file, $module = '') {
152152
$wb = $app->functions->array_merge($wb_global, $wb);
153153
}
154154
if(isset($wb_global)) unset($wb_global);
155-
155+
156156
$this->wordbook = $wb;
157-
157+
158158
$app->plugin->raiseEvent($_SESSION['s']['module']['name'].':'.$app->tform->formDef['name'] . ':on_after_formdef', $this);
159159

160160
$this->dateformat = $app->lng('conf_format_dateshort');
@@ -323,7 +323,7 @@ function table_auth_sql($matches){
323323
return $this->getAuthSQL('r', $matches[1]);
324324
}
325325
*/
326-
326+
327327
/**
328328
* Get the key => value array of a form filled from a datasource definitiom
329329
*
@@ -339,12 +339,12 @@ function getDatasourceData($field, $record) {
339339
function applyValueLimit($limit, $values, $current_value = '') {
340340

341341
global $app;
342-
342+
343343
// we mas have multiple limits, therefore we explode by ; first
344344
// Example: "system:sites:web_php_options;client:web_php_options"
345345
$limits = explode(';',$limit);
346-
347-
346+
347+
348348
foreach($limits as $limit) {
349349

350350
$limit_parts = explode(':', $limit);
@@ -399,7 +399,7 @@ function applyValueLimit($limit, $values, $current_value = '') {
399399
$tmp_key = $limit_parts[2];
400400
$allowed = $allowed = explode(',',$tmp_conf[$tmp_key]);
401401
}
402-
402+
403403
// add the current value to the allowed array
404404
$allowed[] = $current_value;
405405

@@ -438,7 +438,7 @@ function getHTML($record, $tab, $action = 'NEW') {
438438
$csrf_token = $app->auth->csrf_token_get($this->formDef['name']);
439439
$_csrf_id = $csrf_token['csrf_id'];
440440
$_csrf_value = $csrf_token['csrf_key'];
441-
441+
442442
$this->formDef['tabs'][$tab]['fields']['_csrf_id'] = array(
443443
'datatype' => 'VARCHAR',
444444
'formtype' => 'TEXT',
@@ -454,7 +454,7 @@ function getHTML($record, $tab, $action = 'NEW') {
454454
$record['_csrf_id'] = $_csrf_id;
455455
$record['_csrf_key'] = $_csrf_value;
456456
/* CSRF PROTECTION */
457-
457+
458458
$new_record = array();
459459
if($action == 'EDIT') {
460460
$record = $this->decode($record, $tab);
@@ -589,7 +589,7 @@ function getHTML($record, $tab, $action = 'NEW') {
589589

590590
$new_record[$key] = $this->_getDateHTML($key, $dt_value);
591591
break;
592-
592+
593593
default:
594594
if(isset($record[$key])) {
595595
$new_record[$key] = $app->functions->htmlentities($record[$key]);
@@ -701,7 +701,7 @@ function getHTML($record, $tab, $action = 'NEW') {
701701

702702
$new_record[$key] = $this->_getDateTimeHTML($key, $dt_value, $display_seconds);
703703
break;
704-
704+
705705
case 'DATE':
706706
$dt_value = (isset($field['default'])) ? $field['default'] : 0;
707707

@@ -750,7 +750,7 @@ protected function _encode($record, $tab, $dbencode = true, $api = false) {
750750
unset($_POST);
751751
unset($record);
752752
}
753-
753+
754754
if(isset($_SESSION['_csrf_timeout']) && is_array($_SESSION['_csrf_timeout'])) {
755755
$to_unset = array();
756756
foreach($_SESSION['_csrf_timeout'] as $_csrf_id => $timeout) {
@@ -767,7 +767,7 @@ protected function _encode($record, $tab, $dbencode = true, $api = false) {
767767
}
768768
/* CSRF PROTECTION */
769769
}
770-
770+
771771
$new_record = array();
772772
if(is_array($record)) {
773773
foreach($fields as $key => $field) {
@@ -1065,6 +1065,29 @@ function validateField($field_name, $field_value, $validators) {
10651065
}
10661066
unset($error);
10671067
break;
1068+
case 'ISEMAILADDRESS':
1069+
$error = false;
1070+
if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n';
1071+
if($validator['allowempty'] == 'y' && $field_value == '') {
1072+
//* Do nothing
1073+
} else {
1074+
if(function_exists('filter_var')) {
1075+
if(filter_var($field_value, FILTER_VALIDATE_EMAIL) === false) {
1076+
$error = true;
1077+
}
1078+
if ($error) {
1079+
$errmsg = $validator['errmsg'];
1080+
if(isset($this->wordbook[$errmsg])) {
1081+
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
1082+
} else {
1083+
$this->errorMessage .= $errmsg."<br />\r\n";
1084+
}
1085+
}
1086+
1087+
} else $this->errorMessage .= "function filter_var missing <br />\r\n";
1088+
}
1089+
unset($error);
1090+
break;
10681091
case 'ISINT':
10691092
if(function_exists('filter_var') && $field_value < PHP_INT_MAX) {
10701093
//if($field_value != '' && filter_var($field_value, FILTER_VALIDATE_INT, array("options" => array('min_range'=>0))) === false) {
@@ -1198,7 +1221,7 @@ function validateField($field_name, $field_value, $validators) {
11981221
}
11991222
}
12001223
break;
1201-
1224+
12021225
case 'ISDATETIME':
12031226
/* Checks a datetime value against the date format of the current language */
12041227
if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n';
@@ -1216,7 +1239,7 @@ function validateField($field_name, $field_value, $validators) {
12161239
}
12171240
}
12181241
break;
1219-
1242+
12201243
case 'RANGE':
12211244
//* Checks if the value is within the given range or above / below a value
12221245
//* Range examples: < 10 = ":10", between 2 and 10 = "2:10", above 5 = "5:".
@@ -1281,7 +1304,7 @@ protected function _getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $
12811304
$sql_update = '';
12821305

12831306
$record = $this->encode($record, $tab, true);
1284-
1307+
12851308
if(($this->primary_id_override > 0)) {
12861309
$sql_insert_key .= '`'.$this->formDef["db_table_idx"].'`, ';
12871310
$sql_insert_val .= $this->primary_id_override.", ";

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,15 +1317,6 @@
13171317
'width' => '40',
13181318
'maxlength' => '255'
13191319
),
1320-
'enable_spdy' => array (
1321-
'datatype' => 'VARCHAR',
1322-
'formtype' => 'CHECKBOX',
1323-
'default' => 'y',
1324-
'value' => array (
1325-
0 => 'n',
1326-
1 => 'y'
1327-
)
1328-
),
13291320
'apps_vhost_enabled' => array (
13301321
'datatype' => 'VARCHAR',
13311322
'formtype' => 'CHECKBOX',

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ $wb['dkim_strength_txt'] = 'DKIM strength';
274274
$wb['php_ini_check_minutes_txt'] = 'Check php.ini every X minutes for changes';
275275
$wb['php_ini_check_minutes_error_empty'] = 'Please specify a value how often php.ini should be checked for changes.';
276276
$wb['php_ini_check_minutes_info_txt'] = '0 = no check';
277-
$wb['enable_spdy_txt'] = 'Makes SPDY/HTTP2 available';
278277
$wb['web_settings_txt'] = 'Web Server';
279278
$wb['xmpp_server_txt'] = 'XMPP Server';
280279
$wb['xmpp_use_ipv6_txt'] = 'Use IPv6';

0 commit comments

Comments
 (0)