Skip to content

Commit d5f0028

Browse files
authored
Disable /list/log/auth when in Demo mode (hestiacp#2214)
1 parent 65bf9c1 commit d5f0028

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file.
2626
- Update translations
2727
- Fix Roundcube permissions
2828
- Add webp to list of media formats that can be cached by the browser
29+
- Disable /list/log/auth when in Demo mode
2930
- Fix #1139 By force rebuilding webmail config files
3031

3132
### Dependencies

bin/v-list-user-auth-log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ check_args '1' "$#" 'USER [FORMAT]'
115115
is_format_valid 'user'
116116
is_object_valid 'user' 'USER' "$user"
117117

118+
check_hestia_demo_mode
118119

119120
#----------------------------------------------------------#
120121
# Action #

web/templates/pages/list_log.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
<a href="/edit/user/?user=<?=$user;?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
1414
<?php } ?>
1515
<?php } ?>
16-
<?php if (($_SESSION['userContext'] === 'admin') && (htmlentities($_GET['user']) !== 'admin')) { ?>
16+
<?php if ($_SESSION['DEMO_MODE'] != "yes"){
17+
if (($_SESSION['userContext'] === 'admin') && (htmlentities($_GET['user']) !== 'admin')) { ?>
1718
<?php if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && (htmlentities($_GET['user']) !== 'admin')) { ?>
1819
<?php if (htmlentities($_GET['user']) !== 'system') {?>
1920
<a href="/list/log/auth/?user=<?=htmlentities($_GET['user']); ?>&token=<?=$_SESSION['token']?>" id="btn-back" class="ui-button cancel" dir="ltr" title="<?=_('Login history');?>"><i class="fas fa-binoculars status-icon green"></i><?=_('Login history');?></a>
@@ -24,7 +25,8 @@
2425
<?php } ?>
2526
<?php if ($_SESSION['userContext'] === 'user') {?>
2627
<a href="/list/log/auth/" id="btn-back" class="ui-button cancel" dir="ltr" title="<?=_('Login history');?>"><i class="fas fa-binoculars status-icon green"></i><?=_('Login history');?></a>
27-
<?php } ?>
28+
<?php }
29+
} ?>
2830
</div>
2931
<div class="l-unit-toolbar__buttonstrip float-right">
3032
<a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-redo status-icon green"></i><?=_('Refresh');?></a>

0 commit comments

Comments
 (0)