Skip to content

Commit 1e3cfdd

Browse files
committed
Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
2 parents 7011347 + 846a9a1 commit 1e3cfdd

File tree

67 files changed

+209
-41
lines changed

Some content is hidden

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

67 files changed

+209
-41
lines changed

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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,12 @@
11291129
'width' => '40',
11301130
'maxlength' => '255'
11311131
),
1132+
'php_default_hide' => array(
1133+
'datatype' => 'VARCHAR',
1134+
'formtype' => 'CHECKBOX',
1135+
'default' => 'n',
1136+
'value' => array(0 => 'n', 1 => 'y')
1137+
),
11321138
'php_default_name' => array(
11331139
'datatype' => 'VARCHAR',
11341140
'formtype' => 'TEXT',

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

Lines changed: 1 addition & 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';

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

Lines changed: 1 addition & 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';

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

Lines changed: 1 addition & 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.';

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

Lines changed: 1 addition & 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';

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

Lines changed: 1 addition & 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';

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

Lines changed: 1 addition & 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'] = 'Beschreibung Standard PHP';
299300
$wb['php_default_name_error_empty'] = 'Beschreibung Standard PHP ist leer.';
300301
$wb['error_mailbox_message_size_txt'] = 'Mailboxgröße muss gleich oder größer als max. Nachrichtengröße sein.';

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

Lines changed: 1 addition & 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';

0 commit comments

Comments
 (0)