Skip to content

Commit 9c39c5b

Browse files
authored
Merge pull request hestiacp#1151 from hestiacp/fix/2020-09_password_with_quotes
Password with Quotes and 2FA
2 parents 06a1ff4 + 97d3b6e commit 9c39c5b

File tree

276 files changed

+144246
-34513
lines changed

Some content is hidden

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

276 files changed

+144246
-34513
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ All notable changes to this project will be documented in this file.
1212
- Support for removing backup remote location (#1083)
1313
- Add support Proftpd TLS Support
1414
- Add the possibility to assign user "Administrators" rights on login. Replaces "root" login. Notifications are only send towards the "admin" account email
15+
- Updated translations system with the use of Gettext following languages are current supported
16+
- English
17+
- German
18+
- French
19+
- Italian
20+
- Spanish
21+
- Chinese
22+
- Greek
23+
- Russian
24+
- Ukrainian
25+
- Dutch
1526

16-
## Buggfixes
27+
## Bugfixes
1728
- Removed root login (root / root password )
1829
- Update apache2.conf replace Include with IncludeOptional (#1072)
1930
- Add ca-certificates, software-properties-common to the dependencies (#1073 + [Forum](https://forum.hestiacp.com/t/hestiscp-fails-on-new-debian-9-vps/1623/8) ) @daniel-eder

bin/v-change-sys-language

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ source $HESTIA/conf/hestia.conf
1919

2020

2121
is_language_valid() {
22-
if [ ! -e "$HESTIA/web/inc/i18n/$language.php" ]; then
22+
if [ ! -d "$HESTIA/web/locale/$language" ]; then
2323
echo "Error: language file $language doesn't exist"
2424
log_event "$E_NOTEXIST $ARGUMENTS"
2525
exit $E_NOTEXIST

bin/v-change-user-language

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ is_language_valid() {
2424
log_event "$E_INVALID" "$ARGUMENTS"
2525
exit $E_INVALID
2626
fi
27-
if [ ! -e "$HESTIA/web/inc/i18n/$1.php" ]; then
27+
if [ ! -d "$HESTIA/web/locale/$1" ]; then
2828
echo "Error: language $1 doesn't exist"
2929
log_event "$E_NOTEXIST" "$ARGUMENTS"
3030
exit $E_NOTEXIST

bin/v-list-sys-languages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ csv_list() {
6262
#----------------------------------------------------------#
6363

6464
# Defining language list
65-
languages=$(ls $HESTIA/web/inc/i18n/ |cut -f 1 -d .)
65+
languages=$(ls -d $HESTIA/web/locale/*/ |awk -F'/' '{print $(NF-1)}')
6666

6767
# Listing data
6868
case $format in

install/upgrade/versions/1.3.0.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ if [ "$FTP_SYSTEM" == "proftpd" ]; then
4242
cp -f $HESTIA_INSTALL_DIR/proftpd/tls.conf /etc/proftpd/
4343

4444
fi
45+
46+
# Remove old lanugage files.
47+
if [ -e $HESTIA/web/inc/i18n/en.php ]; then
48+
echo "[!] Clean up old language files"
49+
rm -fr $HESTIA/web/inc/i18n
50+
fi

src/deb/nginx/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Source: hestia-nginx
22
Package: hestia-nginx
33
Priority: optional
4-
Version: 1.19.1
4+
Version: 1.19.1~alpha
55
Section: admin
66
Maintainer: HestiaCP <info@hestiacp.com>
77
Homepage: https://www.hestiacp.com

src/deb/php/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Source: hestia-php
22
Package: hestia-php
33
Priority: optional
4-
Version: 7.4.8
4+
Version: 7.4.8~alpha
55
Section: admin
66
Maintainer: HestaCP <info@hestiacp.com>
77
Homepage: https://www.hestiacp.com

src/hst_autocompile.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ fi
8686

8787
BUILD_ARCH='amd64'
8888
HESTIA_V="${BUILD_VER}_${BUILD_ARCH}"
89-
NGINX_V=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/deb/nginx/control |grep "Version:" |cut -d' ' -f2)
89+
NGINX_V=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/deb/nginx/control |grep "Version:" |cut -d' ' -f2 |cut -d"~" -f1)
9090
OPENSSL_V='1.1.1g'
9191
PCRE_V='8.44'
9292
ZLIB_V='1.2.11'
93-
PHP_V=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/deb/php/control |grep "Version:" |cut -d' ' -f2)
93+
PHP_V=$(curl -s https://raw.githubusercontent.com/hestiacp/hestiacp/$branch/src/deb/php/control |grep "Version:" |cut -d' ' -f2 |cut -d"~" -f1)
9494

9595
# Create build directories
9696
rm -rf $BUILD_DIR
@@ -339,6 +339,7 @@ if [ "$PHP_B" = true ] ; then
339339
--with-fpm-group=admin \
340340
--with-libdir=lib/x86_64-linux-gnu \
341341
--with-mysqli \
342+
--with-gettext \
342343
--with-curl \
343344
--with-zip \
344345
--with-gmp \

web/add/cron/index.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
}
1717

1818
// Check empty fields
19-
if ((!isset($_POST['v_min'])) || ($_POST['v_min'] == '')) $errors[] = __('minute');
20-
if ((!isset($_POST['v_hour'])) || ($_POST['v_hour'] == '')) $errors[] = __('hour');
21-
if ((!isset($_POST['v_day'])) || ($_POST['v_day'] == '')) $errors[] = __('day');
22-
if ((!isset($_POST['v_month'])) || ($_POST['v_month'] == '')) $errors[] = __('month');
23-
if ((!isset($_POST['v_wday'])) || ($_POST['v_wday'] == '')) $errors[] = __('day of week');
24-
if ((!isset($_POST['v_cmd'])) || ($_POST['v_cmd'] == '')) $errors[] = __('cmd');
19+
if ((!isset($_POST['v_min'])) || ($_POST['v_min'] == '')) $errors[] = _('minute');
20+
if ((!isset($_POST['v_hour'])) || ($_POST['v_hour'] == '')) $errors[] = _('hour');
21+
if ((!isset($_POST['v_day'])) || ($_POST['v_day'] == '')) $errors[] = _('day');
22+
if ((!isset($_POST['v_month'])) || ($_POST['v_month'] == '')) $errors[] = _('month');
23+
if ((!isset($_POST['v_wday'])) || ($_POST['v_wday'] == '')) $errors[] = _('day of week');
24+
if ((!isset($_POST['v_cmd'])) || ($_POST['v_cmd'] == '')) $errors[] = _('cmd');
2525
if (!empty($errors[0])) {
2626
foreach ($errors as $i => $error) {
2727
if ( $i == 0 ) {
@@ -30,7 +30,7 @@
3030
$error_msg = $error_msg.", ".$error;
3131
}
3232
}
33-
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
33+
$_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'),$error_msg);
3434
}
3535

3636
// Protect input
@@ -50,7 +50,7 @@
5050

5151
// Flush field values on success
5252
if (empty($_SESSION['error_msg'])) {
53-
$_SESSION['ok_msg'] = __('CRON_CREATED_OK');
53+
$_SESSION['ok_msg'] = _('CRON_CREATED_OK');
5454
unset($v_min);
5555
unset($v_hour);
5656
unset($v_day);

web/add/db/index.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
}
1717

1818
// Check empty fields
19-
if (empty($_POST['v_database'])) $errors[] = __('database');
20-
if (empty($_POST['v_dbuser'])) $errors[] = __('username');
21-
if (empty($_POST['v_password'])) $errors[] = __('password');
22-
if (empty($_POST['v_type'])) $errors[] = __('type');
23-
if (empty($_POST['v_host'])) $errors[] = __('host');
24-
if (empty($_POST['v_charset'])) $errors[] = __('charset');
19+
if (empty($_POST['v_database'])) $errors[] = _('database');
20+
if (empty($_POST['v_dbuser'])) $errors[] = _('username');
21+
if (empty($_POST['v_password'])) $errors[] = _('password');
22+
if (empty($_POST['v_type'])) $errors[] = _('type');
23+
if (empty($_POST['v_host'])) $errors[] = _('host');
24+
if (empty($_POST['v_charset'])) $errors[] = _('charset');
2525
if (!empty($errors[0])) {
2626
foreach ($errors as $i => $error) {
2727
if ( $i == 0 ) {
@@ -30,19 +30,19 @@
3030
$error_msg = $error_msg.", ".$error;
3131
}
3232
}
33-
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
33+
$_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'),$error_msg);
3434
}
3535

3636
// Validate email
3737
if ((!empty($_POST['v_db_email'])) && (empty($_SESSION['error_msg']))) {
3838
if (!filter_var($_POST['v_db_email'], FILTER_VALIDATE_EMAIL)) {
39-
$_SESSION['error_msg'] = __('Please enter valid email address.');
39+
$_SESSION['error_msg'] = _('Please enter valid email address.');
4040
}
41-
}
41+
}
4242

4343
// Check password length
4444
if (empty($_SESSION['error_msg'])) {
45-
if (!validate_password($_POST['v_password'])) { $_SESSION['error_msg'] = __('Password does not match the minimum requirements');}
45+
if (!validate_password($_POST['v_password'])) { $_SESSION['error_msg'] = _('Password does not match the minimum requirements');}
4646
}
4747

4848
// Protect input
@@ -87,17 +87,17 @@
8787
// Email login credentials
8888
if ((!empty($v_db_email)) && (empty($_SESSION['error_msg']))) {
8989
$to = $v_db_email;
90-
$subject = __("Database Credentials");
90+
$subject = _("Database Credentials");
9191
$hostname = exec('hostname');
92-
$from = __('MAIL_FROM',$hostname);
93-
$mailtext = __('DATABASE_READY',$user."_".$_POST['v_database'],$user."_".$_POST['v_dbuser'],$_POST['v_password'],$db_admin_link);
92+
$from = sprintf(_('MAIL_FROM'),$hostname);
93+
$mailtext = sprintf(_('DATABASE_READY'),$user."_".$_POST['v_database'],$user."_".$_POST['v_dbuser'],$_POST['v_password'],$db_admin_link);
9494
send_email($to, $subject, $mailtext, $from);
9595
}
9696

9797
// Flush field values on success
9898
if (empty($_SESSION['error_msg'])) {
99-
$_SESSION['ok_msg'] = __('DATABASE_CREATED_OK',htmlentities($user)."_".htmlentities($_POST['v_database']),htmlentities($user)."_".htmlentities($_POST['v_database']));
100-
$_SESSION['ok_msg'] .= " / <a href=".$db_admin_link." target='_blank'>" . __('open %s',$db_admin) . "</a>";
99+
$_SESSION['ok_msg'] = sprintf(_('DATABASE_CREATED_OK'),htmlentities($user)."_".htmlentities($_POST['v_database']),htmlentities($user)."_".htmlentities($_POST['v_database']));
100+
$_SESSION['ok_msg'] .= " / <a href=".$db_admin_link." target='_blank'>" . sprintf(_('open %s'),$db_admin) . "</a>";
101101
unset($v_database);
102102
unset($v_dbuser);
103103
unset($v_password);

0 commit comments

Comments
 (0)