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

Added confirmation dialog when deleting logs

Robert Zollner 6 лет назад
Родитель
Сommit
2800572341
3 измененных файлов с 12 добавлено и 1 удалено
  1. 1 0
      CHANGELOG.md
  2. 1 0
      web/inc/i18n/en.php
  3. 10 1
      web/templates/admin/list_log.html

+ 1 - 0
CHANGELOG.md

@@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.
 - SecImprove: Cli arguments were glob expanded when written to log file
 - Fixed: Removing web domains would let sftp accounts still configured in sshd
 - SecImprove: File operations in user home folder will be executed as the real user
+- Added a confirmation dialog when deleting user logs (/list/log/)
 
 ## [1.0.5] - 2019-08-06 - Hotfix
 ### Bugfixes

+ 1 - 0
web/inc/i18n/en.php

@@ -486,6 +486,7 @@ $LANG['en'] = array(
     'DELETE_PACKAGE_CONFIRMATION'  => 'Are you sure you want to delete package %s?',
     'DELETE_IP_CONFIRMATION'  => 'Are you sure you want to delete IP address %s?',
     'DELETE_RULE_CONFIRMATION' => 'Are you sure you want to delete rule #%s?',
+    'DELETE_LOGS_CONFIRMATION'  => 'Are you sure you want to delete the logs?',
     'SUSPEND_RULE_CONFIRMATION' => 'Are you sure you want to suspend rule  #%s?',
     'UNSUSPEND_RULE_CONFIRMATION' => 'Are you sure you want to unsuspend rule #%s?',
     'Are you sure you want to stop service' => 'Are you sure you want to stop service %s?',

+ 10 - 1
web/templates/admin/list_log.html

@@ -2,7 +2,16 @@
   <div class="l-sort clearfix noselect">
     <div class="l-unit-toolbar__buttonstrip">
       <a href="javascript:location.reload();" class="ui-button cancel" title="<?=__('Refresh')?>"><i class="fas fa-redo status-icon green"></i> <?=__('Refresh')?></a>
-      <a href="/delete/log/?token=<?=$_SESSION['token']?>" class="ui-button cancel" title="<?=__('Delete')?>"><i class="fas fa-times-circle status-icon red"></i> <?=__('Delete')?></a>
+      <div class="actions-panel display-inline-block" key-action="js">
+        <a class="data-controls do_delete ui-button cancel" title="<?=__('Delete')?>">
+          <i class="do_delete fas fa-times-circle status-icon red"></i>
+          <?=__('Delete')?>
+          <input type="hidden" name="delete_url" value="/delete/log/?token=<?=$_SESSION['token']?>" />
+            <div class="confirmation-text-delete hidden" title="<?=__('Confirmation')?>">
+              <p class="confirmation"><?=__('DELETE_LOGS_CONFIRMATION')?></p>
+            </div>
+        </a>
+      </div>
     </div>
     <div class="l-sort-toolbar clearfix">
     </div>