Skip to content

Commit b4bb08d

Browse files
authored
Merge pull request hestiacp#1894 from jaapmarcus/fix/edit-server-settings
Fix of multiple small bugs in UI / PHP code
2 parents e8151f9 + e449668 commit b4bb08d

File tree

7 files changed

+50
-15
lines changed

7 files changed

+50
-15
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ All notable changes to this project will be documented in this file.
55

66
### Features
77

8+
- Include DMARC record in DNS record list #1836
9+
810
### Bugfixes
11+
912
- Improve the calculated disk size of a new backup estimated by excluding the exclude folders, mail accounts and database in backups (#1616) @Myself5
13+
- Update phpMyAdmin version to 1.5.1 (See https://www.phpmyadmin.net/news/2021/6/4/phpmyadmin-511-released/)
14+
- Fixed a bug after rebuilding mail with Exim4 and suspended domains (#1886)
15+
- Fixed "Allowed IP addresses for API" field with strange behaviour #1866
16+
- Fixed an issue where the "Saved confirmation" was not set due to a redirect #1879
17+
- Increased minimal memory requirements for ClamD / ClamAV. #1840
18+
- Restore of backup did not rebuild the "Forced SSL" and "HSTS" config on new account #1862
1019

1120
## [1.4.2] - Service release
1221

bin/v-restore-user

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ if [ "$web" != 'no' ] && [ ! -z "$WEB_SYSTEM" ]; then
317317
str="$str CUSTOM_DOCROOT='$CUSTOM_DOCROOT' CUSTOM_PHPROOT='$CUSTOM_PHPROOT'"
318318
str="$str REDIRECT='$REDIRECT' REDIRECT_CODE='$REDIRECT_CODE'"
319319
str="$str FASTCGI_CACHE='$FASTCGI_CACHE' FASTCGI_DURATION='$FASTCGI_DURATION'"
320-
str="$str TPL='$TPL' SSL='$SSL' SSL_HOME='$SSL_HOME'"
321-
str="$str LETSENCRYPT='$LETSENCRYPT' FTP_USER='$FTP_USER'"
320+
str="$str TPL='$TPL' SSL='$SSL' SSL_HOME='$SSL_HOME' SSL_HSTS='$SSL_HSTS'"
321+
str="$str SSL_FORCE='$SSL_FORCE' LETSENCRYPT='$LETSENCRYPT' FTP_USER='$FTP_USER'"
322322
str="$str FTP_MD5='$FTP_MD5' FTP_PATH='$FTP_PATH'"
323323
str="$str BACKEND='$BACKEND' PROXY='$PROXY'"
324324
str="$str PROXY_EXT='$PROXY_EXT' STATS='$STATS'"

install/hst-install-debian.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ set_default_value 'dovecot' 'yes'
258258
if [ $memory -lt 1500000 ]; then
259259
set_default_value 'clamd' 'no'
260260
set_default_value 'spamd' 'no'
261+
elif [ $memory -lt 300000 ]; then
262+
set_default_value 'clamd' 'no'
263+
set_default_value 'spamd' 'yes'
261264
else
262265
set_default_value 'clamd' 'yes'
263266
set_default_value 'spamd' 'yes'

install/hst-install-ubuntu.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ set_default_value 'dovecot' 'yes'
239239
if [ $memory -lt 1500000 ]; then
240240
set_default_value 'clamd' 'no'
241241
set_default_value 'spamd' 'no'
242+
elif [ $memory -lt 300000 ]; then
243+
set_default_value 'clamd' 'no'
244+
set_default_value 'spamd' 'yes'
242245
else
243246
set_default_value 'clamd' 'yes'
244247
set_default_value 'spamd' 'yes'

web/edit/server/index.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181

182182
// Check POST request
183183
if (!empty($_POST['save'])) {
184-
184+
$require_refresh = false;
185185
// Check token
186186
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
187187
header('location: /login/');
@@ -813,8 +813,7 @@
813813
unset($output);
814814
if ($_POST['v_policy_user_change_theme']) {
815815
unset ($_SESSION['userTheme']);
816-
$refresh = $_SERVER['REQUEST_URI'];
817-
header("Location: $refresh");
816+
$require_refresh = true;
818817
}
819818
if (empty($_SESSION['error_msg'])) $v_policy_user_change_theme = $_POST['v_policy_user_change_theme'];
820819
}
@@ -943,7 +942,12 @@
943942
if (empty($_SESSION['error_msg'])) {
944943
$_SESSION['ok_msg'] = _('Changes has been saved.');
945944
}
946-
945+
if ($require_refresh == true){
946+
$refresh = $_SERVER['REQUEST_URI'];
947+
$_SESSION['ok_msg'] = _('Changes has been saved.');
948+
header("Location: $refresh");
949+
die();
950+
}
947951
}
948952

949953
// Check system configuration

web/templates/pages/edit_server.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -981,13 +981,11 @@
981981
</tr>
982982
<tr>
983983
<td>
984-
<textarea size="20" class="vst-textinput short" name="v_api_allowed_ip">
985-
<?php
986-
foreach(explode(',',$_SESSION['API_ALLOWED_IP']) as $ip ){
987-
echo $ip."\n";
984+
<textarea size="20" class="vst-textinput short" name="v_api_allowed_ip"><?php
985+
foreach(explode(',',$_SESSION['API_ALLOWED_IP']) as $ip ){
986+
echo trim($ip)."\n";
988987
}
989-
?>
990-
</textarea>
988+
?></textarea>
991989
<br><br>
992990
</td>
993991
</tr>

web/templates/pages/list_mail_dns.html

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,20 @@
3636
<div class="l-unit__col l-unit__col--right">
3737
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="mail.<?=htmlspecialchars($_GET['domain']);?>" /></b> </div>
3838
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>A</b></div>
39-
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>10</b></div>
39+
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>0</b></div>
4040
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
4141
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?=array_key_first($ips);?>" /></b></div>
4242
</div>
4343
</div>
44+
<div class="l-unit animated fadeIn">
45+
<div class="l-unit__col l-unit__col--right">
46+
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="mail.<?=htmlspecialchars($_GET['domain']);?>" /></b> </div>
47+
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>MX</b></div>
48+
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>10</b></div>
49+
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
50+
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" value="<?=htmlspecialchars($_GET['domain']);?>." /></b></div>
51+
</div>
52+
</div>
4453
<?php if($_SESSION['WEBMAIL_SYSTEM']){?>
4554
<div class="l-unit animated fadeIn">
4655
<div class="l-unit__col l-unit__col--right">
@@ -58,17 +67,26 @@
5867
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>TXT</b></div>
5968
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>&nbsp;</b></div>
6069
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
61-
<div class="clearfix l-unit__stat-col--left wide-3 "><b><input type="text" class="vst-input" value="<?=htmlspecialchars('"v=spf1 a mx ip4:'.array_key_first($ips).'; -all"');?>" /></b></div>
70+
<div class="clearfix l-unit__stat-col--left wide-3 "><b><input type="text" class="vst-input" value="<?=htmlspecialchars('v=spf1 a mx ip4:'.array_key_first($ips).'; -all');?>" /></b></div>
6271
</div>
6372
</div>
73+
<div class="l-unit animated fadeIn">
74+
<div class="l-unit__col l-unit__col--right">
75+
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="_dmarc" /></b> </div>
76+
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>TXT</b></div>
77+
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>&nbsp;</b></div>
78+
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>14400</b></div>
79+
<div class="clearfix l-unit__stat-col--left wide-3 "><b><input type="text" class="vst-input" value="<?=htmlspecialchars('v=DMARC1; p=quarantine; pct=100');?>" /></b></div>
80+
</div>
81+
</div>
6482
<?php foreach($dkim as $key => $value){ ?>
6583
<div class="l-unit animated fadeIn">
6684
<div class="l-unit__col l-unit__col--right">
6785
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="vst-input" style="width:200px !important;" value="<?=htmlspecialchars($key);?>" /></b></div>
6886
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>TXT</b></div>
6987
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>&nbsp;</b></div>
7088
<div class="clearfix l-unit__stat-col--left text-center step-top-small"><b>3600</b></div>
71-
<div class="clearfix l-unit__stat-col--left wide-3 "><b><input type="text" class="vst-input" value="<?=htmlspecialchars(str_replace("'",'"',$dkim[$key]['TXT']));?>" </b></div>
89+
<div class="clearfix l-unit__stat-col--left wide-3 "><b><input type="text" class="vst-input" value="<?=htmlspecialchars(str_replace(array('"',"'"),'',$dkim[$key]['TXT']));?>" </b></div>
7290
</div>
7391
</div>
7492
<?php } ?>

0 commit comments

Comments
 (0)