Skip to content

Commit bf9499a

Browse files
authored
Multiple fixes in UI (hestiacp#2710)
* Fix: hestiacp#2705 Do run v-change-sys-php after each save Only when it was changes: DEFAULT_PHP_VERSION return phpx.x vs x.x * Rename Application ID to Key ID to match Backblaze * Fix hestiacp#2707 Not saving rate limit for old accounts 1.5.x pre * Fix Users menu does not appear PHP8.1 create warning / errors when variable is not set propperly causing this check to be not working
1 parent 52c659e commit bf9499a

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

bin/v-change-mail-account-rate-limit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ source /etc/hestiacp/hestia.conf
2424
source $HESTIA/func/main.sh
2525
# shellcheck source=/usr/local/hestia/func/domain.sh
2626
source $HESTIA/func/domain.sh
27+
# shellcheck source=/usr/local/hestia/func/syshealth.sh
28+
source $HESTIA/func/syshealth.sh
2729
# load config file
2830
source_conf "$HESTIA/conf/hestia.conf"
2931

@@ -82,6 +84,8 @@ if [[ "$rate" = "system" ]]; then
8284
rate=''
8385
fi
8486

87+
syshealth_repair_mail_account_config
88+
8589
# Update quota
8690
update_object_value "mail/$domain" 'ACCOUNT' "$account" '$RATE_LIMIT' "$rate"
8791

web/edit/server/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,12 @@
327327
}
328328

329329
if (empty($_SESSION['error_msg'])) {
330-
if ($_POST['v_php_default_version'] != DEFAULT_PHP_VERSION) {
330+
if ('php-'.$_POST['v_php_default_version'] != DEFAULT_PHP_VERSION) {
331331
exec(HESTIA_CMD . "v-change-sys-php " . escapeshellarg($_POST['v_php_default_version']), $output, $return_var);
332332
check_return_code($return_var, $output);
333333
unset($output);
334+
//force reload
335+
$require_refresh = true;
334336
}
335337
}
336338
}

web/inc/main.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ function render_page($user, $TAB, $page)
176176

177177
// Policies controller
178178
@include_once(dirname(__DIR__) . '/inc/policies.php');
179-
180179
// Body
181180
include($__template_dir . 'pages/' . $page . '.html');
182181

@@ -269,9 +268,9 @@ function top_panel($user, $TAB)
269268
if (!isset($_SESSION['look'])) {
270269
$_SESSION['userSortOrder'] = $panel[$user]['PREF_UI_SORT'];
271270
}
272-
271+
273272
// Set home location URLs
274-
if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look']))) {
273+
if (($_SESSION['userContext'] === 'admin') && (empty($_SESSION['look']))) {
275274
// Display users list for administrators unless they are impersonating a user account
276275
$home_url = '/list/user/';
277276
} else {

web/list/log/index.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
// Main include
4+
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
5+
36
if (empty($_GET['user'])) {
47
$_GET['user'] = '';
58
}
@@ -9,9 +12,6 @@
912
$TAB = 'LOG';
1013
}
1114

12-
// Main include
13-
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
14-
1515
// Redirect non-administrators if they request another user's log
1616
if (($_SESSION['userContext'] !== 'admin') && (!empty($_GET['user']))) {
1717
header('location: /login/');
@@ -35,4 +35,7 @@
3535
}
3636

3737
// Render page
38+
if($user === 'system'){
39+
$user = "'".$_SESSION['user']."'";
40+
}
3841
render_page($user, $TAB, 'list_log');

web/list/user/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212

1313
// Do not show the users list if user is impersonating another user
14-
if (isset($_SESSION['look'])) {
14+
if (!empty($_SESSION['look'])) {
1515
header("Location: /login/");
1616
exit;
1717
}

web/templates/includes/panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<div class="l-center">
9999
<div class="l-stat">
100100
<!-- Users tab -->
101-
<?php if (($_SESSION['userContext'] === 'admin') && (!isset($_SESSION['look']))) {?>
101+
<?php if (($_SESSION['userContext'] == 'admin') && (empty($_SESSION['look']))) {?>
102102
<?php
103103
if (($_SESSION['user'] !== 'admin') && ($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes')) {
104104
$user_count = $panel[$user]['U_USERS'] - 1;

web/templates/pages/edit_server.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@
806806
</tr>
807807
<tr>
808808
<td class="vst-text">
809-
<?=_('Application ID');?>
809+
<?=_('Key ID');?>
810810
</td>
811811
</tr>
812812
<tr>

0 commit comments

Comments
 (0)