Skip to content

Commit 2d3f91b

Browse files
author
Kristan Kenney
committed
Allow users to download backups if suspended
1 parent ec3b89d commit 2d3f91b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

web/inc/policies.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
if (($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_VIEW_SUSPENDED'] === 'yes')) {
3+
if (($_SESSION['userContext'] === 'user') && ($panel[$user]['SUSPENDED'] === 'yes') && ($_SESSION['POLICY_USER_VIEW_SUSPENDED'] === 'yes')) {
44
$read_only='true';
55
}
66

web/templates/pages/list_backup.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@
9393
<div class="clearfix l-unit__stat-col--left compact-4 text-right">
9494
<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
9595
<div class="actions-panel clearfix">
96-
<? if ($read_only === 'true') {?>
96+
<? if (($_SESSION['userContext'] === 'admin') && ($_SESSION['look'] === 'admin') && ($read_only === 'true')) {?>
9797
<!-- Restrict ability to restore or delete backups when impersonating 'admin' account -->
9898
&nbsp;
9999
<? } else { ?>
100100
<div class="actions-panel__col actions-panel__download shortcut-d" key-action="href"><a href="/download/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('download')?>"><i class="fas fa-file-download status-icon lightblue status-icon dim"></i></a></div>
101+
<? if ($read_only === 'false') {?>
101102
<div class="actions-panel__col actions-panel__list shortcut-enter" key-action="href"><a href="/list/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=_('restore')?>"><i class="fas fa-undo status-icon green status-icon dim"></i></a></div>
102103
<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
103104
<a id="delete_link_<?=$i?>" class="data-controls do_delete" title="<?=_('delete')?>">
@@ -108,6 +109,7 @@
108109
</div>
109110
</a>
110111
</div>
112+
<? } ?>
111113
<? } ?>
112114
</div>
113115
</div>

0 commit comments

Comments
 (0)