Skip to content

Commit dc92614

Browse files
authored
Merge branch 'staging/features' into refactor/import-languages
2 parents 8f8fc24 + b1a1f30 commit dc92614

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ All notable changes to this project will be documented in this file.
4141
- Fixed an issue with Restore Failed on Domains with Mail Setups using SSL (#1069)
4242
- Fixed an issue with PHPMyAdmin button (#1078)
4343
- Changed WordPress name in Webapp installer (#1074)
44+
- Add a free disk space validation during backup routine (#1115)
45+
4446

4547
## [1.2.3] - Service Release
4648
### Features

bin/v-backup-user

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ start_time=$(date '+%s')
5555
subj="$user → backup failed"
5656
email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
5757

58+
# Validate available disk space (take usage * 2, due to the backup handling)
59+
let u_disk=$(grep "U_DISK=" $HESTIA/data/users/$user/user.conf |cut -f 2 -d \')*2
60+
let v_disk=$(($(stat -f --format="%a*%S" $BACKUP)))/1024/1024
61+
62+
if [ "$u_disk" -gt "$v_disk" ]; then
63+
echo "not enough diskspace available to perform the backup." |$SENDMAIL -s "$subj" $email $notify
64+
check_result $E_LIMIT "not enough diskspace available to perform the backup."
65+
fi
66+
5867
if [ -z "$BACKUP_TEMP" ]; then
5968
BACKUP_TEMP=$BACKUP
6069
fi

install/upgrade/versions/1.3.0.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if [ "$FTP_SYSTEM" == "proftpd" ]; then
3434
if [ -e /etc/proftpd/proftpd.conf ]; then
3535
rm /etc/proftpd/proftpd.conf
3636
fi
37-
if [ -e /etc/proftpd/tlss.conf ]; then
37+
if [ -e /etc/proftpd/tls.conf ]; then
3838
rm /etc/proftpd/tls.conf
3939
fi
4040

@@ -43,7 +43,8 @@ if [ "$FTP_SYSTEM" == "proftpd" ]; then
4343

4444
fi
4545

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

web/login/index.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function authenticate_user(){
9898
if ($data[$_POST['user']]['TWOFA'] != '') {
9999
if (empty($_POST['twofa'])){
100100
return false;
101-
}else{
101+
} else {
102102
$v_twofa = $_POST['twofa'];
103103
exec(HESTIA_CMD ."v-check-user-2fa ".$v_user." ".$v_twofa, $output, $return_var);
104104
unset($output);
@@ -148,6 +148,13 @@ function authenticate_user(){
148148
}
149149
}
150150
}
151+
} else {
152+
unset($_POST);
153+
unset($_GET);
154+
unset($_SESSION);
155+
session_destroy();
156+
session_start();
157+
return false;
151158
}
152159
}
153160

@@ -190,4 +197,4 @@ function authenticate_user(){
190197
} else {
191198
require_once('../templates/login.html');
192199
}
193-
?>
200+
?>

0 commit comments

Comments
 (0)