Просмотр исходного кода

Disable /list/log/auth when in Demo mode (#2214)

Jaap Marcus 4 лет назад
Родитель
Сommit
d5f0028293
3 измененных файлов с 6 добавлено и 2 удалено
  1. 1 0
      CHANGELOG.md
  2. 1 0
      bin/v-list-user-auth-log
  3. 4 2
      web/templates/pages/list_log.html

+ 1 - 0
CHANGELOG.md

@@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file.
 - Update translations
 - Fix Roundcube permissions
 - Add webp to list of media formats that can be cached by the browser 
+- Disable  /list/log/auth when in Demo mode
 - Fix #1139 By force rebuilding webmail config files
 
 ### Dependencies

+ 1 - 0
bin/v-list-user-auth-log

@@ -115,6 +115,7 @@ check_args '1' "$#" 'USER [FORMAT]'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+check_hestia_demo_mode 
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 4 - 2
web/templates/pages/list_log.html

@@ -13,7 +13,8 @@
 					<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>
 				<?php } ?>
 			<?php } ?>
-			<?php if (($_SESSION['userContext'] === 'admin') && (htmlentities($_GET['user']) !== 'admin')) { ?>
+			<?php if ($_SESSION['DEMO_MODE'] != "yes"){
+			if (($_SESSION['userContext'] === 'admin') && (htmlentities($_GET['user']) !== 'admin')) { ?>
 				<?php if (($_SESSION['userContext'] === 'admin') && (isset($_GET['user'])) && (htmlentities($_GET['user']) !== 'admin')) { ?>
 					<?php if (htmlentities($_GET['user']) !== 'system') {?>
 						<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 @@
 			<?php } ?>
 			<?php if ($_SESSION['userContext'] === 'user') {?>
 				<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>
-			<?php } ?>
+			<?php } 
+			} ?>
 		</div>
 		<div class="l-unit-toolbar__buttonstrip float-right">
 			<a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-redo status-icon green"></i><?=_('Refresh');?></a>