Skip to content

Commit 103443c

Browse files
committed
Merge remote-tracking branch 'origin/develop' into 2558-two-factor-authentication
2 parents c7f61ad + 88edc27 commit 103443c

File tree

200 files changed

+2356
-2151
lines changed

Some content is hidden

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

200 files changed

+2356
-2151
lines changed

install/lib/compatibility.inc.php

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2021, Jesse Norell <jesse@kci.net>
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
/* random_bytes can be dropped when php 5.6 support is dropped */
32+
if (! function_exists('random_bytes')) {
33+
function random_bytes($length) {
34+
return openssl_random_pseudo_bytes($length);
35+
}
36+
}
37+
38+
/* random_int can be dropped when php 5.6 support is dropped */
39+
if (! function_exists('random_int')) {
40+
function random_int($min=null, $max=null) {
41+
if (null === $min) {
42+
$min = PHP_INT_MIN;
43+
}
44+
45+
if (null === $max) {
46+
$min = PHP_INT_MAX;
47+
}
48+
49+
if (!is_int($min) || !is_int($max)) {
50+
trigger_error('random_int: $min and $max must be integer values', E_USER_NOTICE);
51+
$min = (int)$min;
52+
$max = (int)$max;
53+
}
54+
55+
if ($min > $max) {
56+
trigger_error('random_int: $max can\'t be lesser than $min', E_USER_WARNING);
57+
return null;
58+
}
59+
60+
$range = $counter = $max - $min;
61+
$bits = 1;
62+
63+
while ($counter >>= 1) {
64+
++$bits;
65+
}
66+
67+
$bytes = (int)max(ceil($bits/8), 1);
68+
$bitmask = pow(2, $bits) - 1;
69+
70+
if ($bitmask >= PHP_INT_MAX) {
71+
$bitmask = PHP_INT_MAX;
72+
}
73+
74+
do {
75+
$result = hexdec(bin2hex(random_bytes($bytes))) & $bitmask;
76+
} while ($result > $range);
77+
78+
return $result + $min;
79+
}
80+
}

install/lib/install.lib.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
*/
3030
error_reporting(E_ALL|E_STRICT);
3131

32+
if(version_compare(phpversion(), '7.0', '<')) {
33+
require_once 'compatibility.inc.php';
34+
}
3235

3336
$FILE = realpath('../install.php');
3437

install/lib/installer_base.lib.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ public function check_prerequisites() {
249249
$msg = '';
250250

251251
if(version_compare(phpversion(), '5.4', '<')) $msg .= "PHP Version 5.4 or newer is required. The currently used PHP version is ".phpversion().".\n";
252+
if(version_compare(phpversion(), '8.0', '>=')) $msg .= "PHP Version 8 is not supported yet. Change PHP version back to the default version of the OS. The currently used PHP version is ".phpversion().".\n";
252253
if(!function_exists('curl_init')) $msg .= "PHP Curl Module is missing.\n";
253254
if(!function_exists('mysqli_connect')) $msg .= "PHP MySQLi Module is nmissing.\n";
254255
if(!function_exists('mb_detect_encoding')) $msg .= "PHP Multibyte Module (MB) is missing.\n";
@@ -2875,7 +2876,7 @@ public function make_acme_vhost($server = 'apache') {
28752876
if(@is_link($vhost_conf_enabled_dir.'/' . $use_symlink)) {
28762877
unlink($vhost_conf_enabled_dir.'/' . $use_symlink);
28772878
}
2878-
if(!@is_link($vhost_conf_enabled_dir.'/' . $use_symlink)) {
2879+
if(!@is_file($vhost_conf_enabled_dir.'/' . $use_symlink)) {
28792880
symlink($vhost_conf_dir.'/' . $use_name, $vhost_conf_enabled_dir.'/' . $use_symlink);
28802881
}
28812882
}

install/tpl/apache_ispconfig.vhost.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ NameVirtualHost *:<tmpl_var name="vhost_port">
114114
</tmpl_if>
115115

116116
# Redirect http to https
117-
ErrorDocument 400 "<script>document.location.href='https://'+location.hostname+':'+location.port';</script><h1>Error 400 - trying to redirect</h1>"
117+
ErrorDocument 400 "<script>document.location.href='https://'+location.hostname+':'+location.port;</script><h1>Error 400 - trying to redirect</h1>"
118118

119119
</VirtualHost>

interface/lib/app.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31-
require_once 'compatibility.inc.php';
31+
if(version_compare(phpversion(), '7.0', '<')) {
32+
require_once 'compatibility.inc.php';
33+
}
3234

3335
//* Enable gzip compression for the interface
3436
ob_start('ob_gzhandler');

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ $wb['active_txt'] = 'Attivo';
77
$wb['directive_snippets_name_empty'] = 'Indicare un nome per lo snippet.';
88
$wb['directive_snippets_name_error_unique'] = 'Esiste già una direttiva snippet con questo nome.';
99
$wb['variables_txt'] = 'Variabili';
10-
$wb['customer_viewable_txt'] = 'Customer viewable';
11-
$wb['required_php_snippets_txt'] = 'Required PHP Snippet';
12-
$wb['update_sites_txt'] = 'Update sites using this snippet';
13-
$wb['error_hide_snippet_active_sites'] = 'You cannot hide this snippet from customers as it is currently used by existing websites.';
14-
$wb['error_disable_snippet_active_sites'] = 'You cannot disable this snippet as it is currently used by existing websites.';
15-
$wb['error_delete_snippet_active_sites'] = 'You cannot delete this snippet as it is currently used by existing websites.';
10+
$wb['customer_viewable_txt'] = 'Cliente visibile';
11+
$wb['required_php_snippets_txt'] = 'Richiedi Snippet PHP';
12+
$wb['update_sites_txt'] = 'Aggiorna i siti usando questo snippet';
13+
$wb['error_hide_snippet_active_sites'] = 'Non puoi nascondere questo snippet poichè e già usato dai siti web esistenti.';
14+
$wb['error_disable_snippet_active_sites'] = 'Non puoi disabilitare questo snippet poichè e già usato dai siti web esistenti.';
15+
$wb['error_delete_snippet_active_sites'] = 'Non puoi cancellare questo snippet poichè e già usato dai siti web esistenti.';
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
2-
$wb['list_head_txt'] = 'Directtive Snippets';
2+
$wb['list_head_txt'] = 'Direttive Snippets';
33
$wb['active_txt'] = 'Attivo';
44
$wb['name_txt'] = 'Nome del Snippet';
55
$wb['type_txt'] = 'Tipo';
6-
$wb['add_new_record_txt'] = 'Aggiungi Direttive Snippet';
7-
$wb['customer_viewable_txt'] = 'Customer viewable';
6+
$wb['add_new_record_txt'] = 'Aggiungi Direttive Snippet';
7+
$wb['customer_viewable_txt'] = 'Cliente visibile';
88
?>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ $wb['list_head_txt'] = 'Gruppi utenti sistema';
33
$wb['description_txt'] = 'Descrizione';
44
$wb['name_txt'] = 'Gruppo';
55
$wb['add_new_record_txt'] = 'Aggiungi nuovo gruppo';
6-
$wb['warning_txt'] = '<b>ATTENZIONE:</b> Non editare o modificare alcuna impostazione utente da qui. Utilizzare invece le impostazioni del modulo nella sezione Clienti- e Rivenditori. Modificare o cambiare Utenti o Gruppi in questa sezione può causare perdita di dati!';
6+
$wb['warning_txt'] = '<b>ATTENZIONE:</b> Non editare o modificare alcuna impostazione utente da qui. Utilizzare invece le impostazioni del modulo nella sezione Clienti e Rivenditori. Modificare o cambiare Utenti o Gruppi in questa sezione può causare perdita di dati!';
77
?>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22
$wb['server_id_txt'] = 'Server';
3-
$wb['multiport_txt'] = 'Multi Port';
4-
$wb['singleport_txt'] = 'Single Port';
5-
$wb['protocol_txt'] = 'Protocol';
6-
$wb['table_txt'] = 'Table';
7-
$wb['target_txt'] = 'Target';
8-
$wb['state_txt'] = 'State';
9-
$wb['destination_ip_txt'] = 'Destination Address';
10-
$wb['source_ip_txt'] = 'Source Address';
3+
$wb['multiport_txt'] = 'Multi Porta';
4+
$wb['singleport_txt'] = 'Singola Porta';
5+
$wb['protocol_txt'] = 'Protocollo';
6+
$wb['table_txt'] = 'Tavola';
7+
$wb['target_txt'] = 'Obiettivo';
8+
$wb['state_txt'] = 'Stato';
9+
$wb['destination_ip_txt'] = 'Indirizzo Destinazione';
10+
$wb['source_ip_txt'] = 'Indirizzo Sorgente';
1111
$wb['active_txt'] = 'Attivo';
12-
$wb['iptables_error_unique'] = 'There is already a firewall record for this server.';
12+
$wb['iptables_error_unique'] = 'Esiste già una regola del firewall per questo server.';
1313
?>

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
$wb['list_head_txt'] = 'IPTables';
33
$wb['add_new_rule_txt'] = 'Aggiungi Regola IPTables';
44
$wb['server_id_txt'] = 'Server';
5-
$wb['multiport_txt'] = 'Multi Port';
6-
$wb['singleport_txt'] = 'Single Port';
7-
$wb['protocol_txt'] = 'Protocol';
8-
$wb['table_txt'] = 'Table';
9-
$wb['target_txt'] = 'Target';
10-
$wb['state_txt'] = 'State';
11-
$wb['destination_ip_txt'] = 'Destination Address';
12-
$wb['source_ip_txt'] = 'Source Address';
5+
$wb['multiport_txt'] = 'Multi Porta';
6+
$wb['singleport_txt'] = 'Singola Porta';
7+
$wb['protocol_txt'] = 'Protocollo';
8+
$wb['table_txt'] = 'Tavola';
9+
$wb['target_txt'] = 'Obiettivo';
10+
$wb['state_txt'] = 'Stato';
11+
$wb['destination_ip_txt'] = 'Indirizzo Destinazione';
12+
$wb['source_ip_txt'] = 'Indirizzo Sorgente';
1313
$wb['active_txt'] = 'Attivo';
1414
$wb['iptables_error_unique'] = 'Esiste già una regola firewall per questo server.';
1515
?>

0 commit comments

Comments
 (0)