Skip to content

Commit 2cc5f03

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
2 parents 8400a46 + d4e9f1b commit 2cc5f03

File tree

122 files changed

+639
-55
lines changed

Some content is hidden

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

122 files changed

+639
-55
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ stages:
88

99
syntax:lint:
1010
stage: syntax
11-
image: bobey/docker-gitlab-ci-runner-php7
11+
image: edbizarro/gitlab-ci-pipeline-php:7.2
1212
allow_failure: false
1313
only:
1414
- schedules
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- add new proxy_protocol column
2+
ALTER TABLE `web_domain`
3+
ADD COLUMN `proxy_protocol` ENUM('n','y') NOT NULL DEFAULT 'n' AFTER `log_retention`;

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,6 +2071,7 @@ CREATE TABLE `web_domain` (
20712071
`https_port` int(11) unsigned NOT NULL DEFAULT '443',
20722072
`folder_directive_snippets` text,
20732073
`log_retention` int(11) NOT NULL DEFAULT '10',
2074+
`proxy_protocol` enum('n','y') NOT NULL default 'n',
20742075
PRIMARY KEY (`domain_id`),
20752076
UNIQUE KEY `serverdomain` ( `server_id` , `ip_address`, `domain` )
20762077
) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ php_fpm_ini_path=/etc/php5/fpm/php.ini
105105
php_fpm_pool_dir=/etc/php5/fpm/pool.d
106106
php_fpm_start_port=9010
107107
php_fpm_socket_dir=/var/lib/php5-fpm
108+
php_default_hide=n
108109
php_default_name=Default
109110
set_folder_permissions_on_update=n
110111
add_web_users_to_sshusers_group=y

interface/lib/classes/auth.inc.php

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,18 @@ public function remove_group_from_user($userid, $groupid) {
141141
}
142142
}
143143

144-
public function check_module_permissions($module) {
144+
145+
/**
146+
* Check that the user has access to the given module.
147+
*
148+
* @return boolean
149+
*/
150+
public function verify_module_permissions($module) {
145151
// Check if the current user has the permissions to access this module
146152
$module = trim(preg_replace('@\s+@', '', $module));
147153
$user_modules = explode(',',$_SESSION["s"]["user"]["modules"]);
154+
$can_use_module = false;
148155
if(strpos($module, ',') !== false){
149-
$can_use_module = false;
150156
$tmp_modules = explode(',', $module);
151157
if(is_array($tmp_modules) && !empty($tmp_modules)){
152158
foreach($tmp_modules as $tmp_module){
@@ -158,17 +164,21 @@ public function check_module_permissions($module) {
158164
}
159165
}
160166
}
161-
if(!$can_use_module){
162-
// echo "LOGIN_REDIRECT:/index.php";
163-
header("Location: /index.php");
164-
exit;
165-
}
166-
} else {
167-
if(!in_array($module,$user_modules)) {
168-
// echo "LOGIN_REDIRECT:/index.php";
169-
header("Location: /index.php");
170-
exit;
171-
}
167+
}
168+
elseif(in_array($module,$user_modules)) {
169+
$can_use_module = true;
170+
}
171+
return $can_use_module;
172+
}
173+
174+
/**
175+
* Check that the user has access to the given module, redirect and exit on failure.
176+
*/
177+
public function check_module_permissions($module) {
178+
if(!$this->verify_module_permissions($module)) {
179+
// echo "LOGIN_REDIRECT:/index.php";
180+
header("Location: /index.php");
181+
exit;
172182
}
173183
}
174184

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,28 @@
820820
'default' => 'n',
821821
'value' => array(0 => 'n',1 => 'y')
822822
),
823+
'vhost_proxy_protocol_enabled' => array (
824+
'datatype' => 'VARCHAR',
825+
'formtype' => 'CHECKBOX',
826+
'default' => 'n',
827+
'value' => array(0 => 'n',1 => 'y')
828+
),
829+
'vhost_proxy_protocol_http_port' => array(
830+
'datatype' => 'VARCHAR',
831+
'formtype' => 'TEXT',
832+
'default' => '880',
833+
'value' => '',
834+
'width' => '40',
835+
'maxlength' => '255'
836+
),
837+
'vhost_proxy_protocol_https_port' => array(
838+
'datatype' => 'VARCHAR',
839+
'formtype' => 'TEXT',
840+
'default' => '8443',
841+
'value' => '',
842+
'width' => '40',
843+
'maxlength' => '255'
844+
),
823845
'vhost_conf_dir' => array(
824846
'datatype' => 'VARCHAR',
825847
'formtype' => 'TEXT',
@@ -1129,6 +1151,12 @@
11291151
'width' => '40',
11301152
'maxlength' => '255'
11311153
),
1154+
'php_default_hide' => array(
1155+
'datatype' => 'VARCHAR',
1156+
'formtype' => 'CHECKBOX',
1157+
'default' => 'n',
1158+
'value' => array(0 => 'n', 1 => 'y')
1159+
),
11321160
'php_default_name' => array(
11331161
'datatype' => 'VARCHAR',
11341162
'formtype' => 'TEXT',

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ $wb['logging_txt'] = 'Store website access and error logs';
295295
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
296296
$wb['log_retention_txt'] = 'Log retention (days)';
297297
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
298+
$wb['php_default_hide_txt'] = 'Hide Default PHP-Version in selectbox';
298299
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
299300
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
300301
$wb['error_mailbox_message_size_txt'] = 'Mailbox size must be larger or equal to message size';
@@ -303,4 +304,7 @@ $wb['content_filter_txt'] = 'Content Filter';
303304
$wb['rspamd_url_txt'] = 'Rspamd URL';
304305
$wb['rspamd_user_txt'] = 'Rspamd User';
305306
$wb['rspamd_password_txt'] = 'Rspamd Password';
307+
$wb['vhost_proxy_protocol_enabled_txt'] = 'Enable PROXY Protocol';
308+
$wb['vhost_proxy_protocol_http_port_txt'] = 'PROXY Protocol HTTP Port';
309+
$wb['vhost_proxy_protocol_https_port_txt'] = 'PROXY Protocol HTTPS Port';
306310
?>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ $wb['logging_txt'] = 'Store website access and error logs';
295295
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
296296
$wb['log_retention_txt'] = 'Log retention (days)';
297297
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
298+
$wb['php_default_hide_txt'] = 'Hide Default PHP-Version in selectbox';
298299
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
299300
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
300301
$wb['error_mailbox_message_size_txt'] = 'Mailbox size must be larger or equal to message size';
@@ -303,4 +304,7 @@ $wb['content_filter_txt'] = 'Content Filter';
303304
$wb['rspamd_url_txt'] = 'Rspamd URL';
304305
$wb['rspamd_user_txt'] = 'Rspamd User';
305306
$wb['rspamd_password_txt'] = 'Rspamd Password';
307+
$wb['vhost_proxy_protocol_enabled_txt'] = 'Enable PROXY Protocol';
308+
$wb['vhost_proxy_protocol_http_port_txt'] = 'PROXY Protocol HTTP Port';
309+
$wb['vhost_proxy_protocol_https_port_txt'] = 'PROXY Protocol HTTPS Port';
306310
?>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ $wb['logging_txt'] = 'Gravar logs de acesso e erros de sites';
296296
$wb['logging_desc_txt'] = 'Usar Ferramentas > Sicronizar para aplicar mudanças em sites existentes. Para o Apache, os logs de acesso e erros podem ser anonimizados. Para o nginx, apenas o log de acesso é anonimizado, o log de erros conterá endereços IP.';
297297
$wb['log_retention_txt'] = 'Tempo de retenção do log (dias)';
298298
$wb['log_retention_error_ispositive'] = 'O tempo de retenção do log deve ser um número > 0.';
299+
$wb['php_default_hide_txt'] = 'Hide Default PHP-Version in selectbox';
299300
$wb['php_default_name_txt'] = 'Descrição da versão padrão do php';
300301
$wb['php_default_name_error_empty'] = 'A descrição da versão padrão do php está em branco.';
301302
$wb['error_mailbox_message_size_txt'] = 'O tamanho da cota da conta de e-mail deve ser maior ou igual o tamanho da cota de mensagens.';
@@ -304,3 +305,6 @@ $wb['content_filter_txt'] = 'Filtro de conteúdo';
304305
$wb['rspamd_url_txt'] = 'URL do rspamd';
305306
$wb['rspamd_user_txt'] = 'Usuário do rspamd';
306307
$wb['rspamd_password_txt'] = 'Senha do rspamd';
308+
$wb['vhost_proxy_protocol_enabled_txt'] = 'Enable PROXY Protocol';
309+
$wb['vhost_proxy_protocol_http_port_txt'] = 'PROXY Protocol HTTP Port';
310+
$wb['vhost_proxy_protocol_https_port_txt'] = 'PROXY Protocol HTTPS Port';

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ $wb['logging_txt'] = 'Store website access and error logs';
295295
$wb['logging_desc_txt'] = 'Use Tools > Resync to apply changes to existing sites. For Apache, access and error log can be anonymized. For nginx, only the access log is anonymized, the error log will contain IP addresses.';
296296
$wb['log_retention_txt'] = 'Log retention (days)';
297297
$wb['log_retention_error_ispositive'] = 'Log retention must be a number > 0';
298+
$wb['php_default_hide_txt'] = 'Hide Default PHP-Version in selectbox';
298299
$wb['php_default_name_txt'] = 'Description Default PHP-Version';
299300
$wb['php_default_name_error_empty'] = 'Description Default PHP-Version must not be empty';
300301
$wb['error_mailbox_message_size_txt'] = 'Mailbox size must be larger or equal to message size';
@@ -303,4 +304,7 @@ $wb['content_filter_txt'] = 'Content Filter';
303304
$wb['rspamd_url_txt'] = 'Rspamd URL';
304305
$wb['rspamd_user_txt'] = 'Rspamd User';
305306
$wb['rspamd_password_txt'] = 'Rspamd Password';
307+
$wb['vhost_proxy_protocol_enabled_txt'] = 'Enable PROXY Protocol';
308+
$wb['vhost_proxy_protocol_http_port_txt'] = 'PROXY Protocol HTTP Port';
309+
$wb['vhost_proxy_protocol_https_port_txt'] = 'PROXY Protocol HTTPS Port';
306310
?>

0 commit comments

Comments
 (0)