| 1 |
<?php |
| 2 |
|
| 3 |
// Do not allow the file to be called directly. |
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
// Determine the log table that should be shown. |
| 9 |
$logtype = ( isset( $_GET['logtype'] ) && $_GET['logtype'] == 'activity' ? 'activity' : 'firewall' ); |
| 10 |
$url = $_SERVER['REQUEST_URI']; |
| 11 |
if ( strpos( $url, 'logtype' ) === false ) { |
| 12 |
$url .= '&logtype=' . $logtype; |
| 13 |
} |
| 14 |
?> |
| 15 |
<div class="patchstack-font"> |
| 16 |
<h2 class="patchstack-logs-nav"> |
| 17 |
<a href="<?php echo esc_url( str_replace( 'activity', 'firewall', $url ) ); ?>" class="nav-tab patchstack-nav-tab <?php echo $logtype == 'firewall' ? 'nav-tab-active patchstack-nav-tab-active' : ''; ?>"><?php echo __( 'Firewall Log', 'patchstack' ); ?></a> |
| 18 |
<a href="<?php echo esc_url( str_replace( 'firewall', 'activity', $url ) ); ?>" class="nav-tab patchstack-nav-tab <?php echo $logtype == 'activity' ? 'nav-tab-active patchstack-nav-tab-active' : ''; ?>"><?php echo __( 'Activity Log', 'patchstack' ); ?></a> |
| 19 |
</h2> |
| 20 |
<div class="patchstack-content-inner-table"> |
| 21 |
<div class="patchstack-font"> |
| 22 |
<h4>This will display the basic logs of the last 2 weeks.<br />If you would like to see the in-depth logs history of up to 90 days ago, login into your account at the <a href="https://app.patchstack.com" target="_blank">Patchstack App</a></h4> |
| 23 |
<?php if ( $logtype == 'firewall' ) { ?> |
| 24 |
<table class="table table-lg table-hover table-firewall-log"> |
| 25 |
<thead> |
| 26 |
<tr> |
| 27 |
<th>REASON</th> |
| 28 |
<th>URL REQUESTED</th> |
| 29 |
<th>METHOD</th> |
| 30 |
<th>ORIGIN</th> |
| 31 |
<th>DATE</th> |
| 32 |
</tr> |
| 33 |
</thead> |
| 34 |
<tbody> |
| 35 |
</tbody> |
| 36 |
</table> |
| 37 |
<?php } elseif ( $logtype == 'activity' ) { ?> |
| 38 |
<table class="table table-lg table-hover table-user-log dt-table"> |
| 39 |
<thead> |
| 40 |
<tr> |
| 41 |
<th>Username</th> |
| 42 |
<th>Action</th> |
| 43 |
<th>Object</th> |
| 44 |
<th>Object name</th> |
| 45 |
<th>IP</th> |
| 46 |
<th>Date</th> |
| 47 |
</tr> |
| 48 |
</thead> |
| 49 |
<tbody> |
| 50 |
</tbody> |
| 51 |
</table> |
| 52 |
<?php } ?> |
| 53 |
</div> |
| 54 |
</div> |
| 55 |
</div> |
| 56 |
|