Skip to content

Commit 0f9c6cb

Browse files
authored
Fix multiple small UI issues (hestiacp#2289)
* hestiacp#2286 Allow admin loginas suspended user * hestiacp#2282 Edit user delete button broken * hestiacp#2278 Show alias in list web * Fix php error in /edit/server when no extra php version where installed
1 parent 6302c15 commit 0f9c6cb

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

web/edit/server/index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@
247247
if (empty($_SESSION['error_msg'])) {
248248
if (!empty($v_php_versions)) {
249249
$post_php = $_POST['v_php_versions'];
250+
if(empty($post_php)){
251+
$post_php = array();
252+
}
250253

251254
array_map(function ($php_version) use ($post_php) {
252255
if (array_key_exists($php_version->tpl, $post_php)) {

web/inc/main.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,11 @@ function top_panel($user, $TAB)
201201

202202
// Log out active sessions for suspended users
203203
if (($panel[$user]['SUSPENDED'] === 'yes') && ($_SESSION['POLICY_USER_VIEW_SUSPENDED'] !== 'yes')) {
204+
if(empty($_SESSION['look'])){
204205
$_SESSION['error_msg'] = 'You have been logged out. Please log in again.';
205206
destroy_sessions();
206207
header('Location: /login/');
208+
}
207209
}
208210

209211
// Reset user permissions if changed while logged in

web/templates/pages/edit_user.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<?php } ?>
1919
</div>
2020
<div class="l-unit-toolbar__buttonstrip float-right">
21+
<div class="actions-panel clearfix">
2122
<?php if (($_SESSION['user'] == $v_username) || (isset($_SESSION['look']))) {?>
2223
<!-- Do not show delete button for currently logged in user-->
2324
<?} else {?>
@@ -34,6 +35,7 @@
3435
</div>
3536
<?php } ?>
3637
<a href="#" class="ui-button" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i> <?=_('Save');?></a>
38+
</div>
3739
</div>
3840
</div>
3941
</div>

web/templates/pages/list_web.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,16 @@
177177
<b>
178178
<?php if ($read_only === 'true') {?>
179179
<?=$key?>
180-
<?php } else { ?>
181-
<a href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Domain');?>: <?=$key?>"><?=$key?></a>
180+
<?php } else {
181+
$aliases = explode(',', $data[$key]['ALIAS']);
182+
$alias_new = array();
183+
foreach($aliases as $alias){
184+
if($alias != 'www.'.$key){
185+
$alias_new[] = trim($alias);
186+
}
187+
}
188+
?>
189+
<a href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('Editing Domain');?>: <?=$key?>"><?=$key?><?php if( !empty($alias_new) && !empty($data[$key]['ALIAS']) ){ echo " <span class=\"hint\">(".implode(',',$alias_new).")"; } ?></a>
182190
<?php } ?>
183191
</b>
184192
</div>

0 commit comments

Comments
 (0)