| 1 |
<?php |
| 2 |
/** |
| 3 |
* Login Lockdown |
| 4 |
* https://wploginlockdown.com/ |
| 5 |
* (c) WebFactory Ltd, 2022 - 2023, www.webfactoryltd.com |
| 6 |
*/ |
| 7 |
|
| 8 |
class LoginLockdown_Tab_Activity extends LoginLockdown |
| 9 |
{ |
| 10 |
static function display() |
| 11 |
{ |
| 12 |
$tabs[] = array('id' => 'tab_log_locks', 'class' => 'tab-content', 'label' => __('Lockdowns', 'login-lockdown'), 'callback' => array(__CLASS__, 'tab_locks')); |
| 13 |
$tabs[] = array('id' => 'tab_log_full', 'class' => 'tab-content', 'label' => __('Failed Logins', 'login-lockdown'), 'callback' => array(__CLASS__, 'tab_full')); |
| 14 |
|
| 15 |
echo '<div id="tabs_log" class="ui-tabs loginlockdown-tabs-2nd-level">'; |
| 16 |
echo '<ul>'; |
| 17 |
foreach ($tabs as $tab) { |
| 18 |
echo '<li><a href="#' . esc_attr($tab['id']) . '">' . esc_html($tab['label']) . '</a></li>'; |
| 19 |
} |
| 20 |
echo '</ul>'; |
| 21 |
|
| 22 |
foreach ($tabs as $tab) { |
| 23 |
if (is_callable($tab['callback'])) { |
| 24 |
echo '<div style="display: none;" id="' . esc_html($tab['id']) . '" class="' . esc_html($tab['class']) . '">'; |
| 25 |
call_user_func($tab['callback']); |
| 26 |
echo'</div>'; |
| 27 |
} |
| 28 |
} // foreach |
| 29 |
|
| 30 |
echo '</div>'; // second level of tabs |
| 31 |
} // display |
| 32 |
|
| 33 |
static function tab_locks() |
| 34 |
{ |
| 35 |
echo '<div class="loginlockdown-stats-main loginlockdown-chart-locks" style="display:none;"><canvas id="loginlockdown-locks-chart" style="height: 160px; width: 100%;"></canvas></div>'; |
| 36 |
echo '<div class="loginlockdown-stats-main loginlockdown-stats-locks" style="display:none;">'; |
| 37 |
echo '<img src="' . esc_url(LOGINLOCKDOWN_PLUGIN_URL) . '/images/advanced_stats.png" alt="Login Lockdown" title="Login Lockdown Advanced Stats" />'; |
| 38 |
echo'</div>'; |
| 39 |
echo '<div class="tab-content">'; |
| 40 |
echo '<div id="loginlockdown-locks-log-table-wrapper"> |
| 41 |
<table cellpadding="0" cellspacing="0" border="0" class="display" id="loginlockdown-locks-log-table"> |
| 42 |
<thead> |
| 43 |
<tr> |
| 44 |
<th></th> |
| 45 |
<th align="left" style="width:160px;">Date & Time</th> |
| 46 |
<th align="left">Reason</th> |
| 47 |
<th style="width:180px;">Location</th> |
| 48 |
<th style="width:180px;">IP</th> |
| 49 |
<th style="width:180px;">User Agent</th> |
| 50 |
<th style="width:80px;"></th> |
| 51 |
</tr> |
| 52 |
</thead> |
| 53 |
<tbody></tbody> |
| 54 |
<tfoot> |
| 55 |
<tr> |
| 56 |
<th></th> |
| 57 |
<th>Date & Time</th> |
| 58 |
<th>Reason</th> |
| 59 |
<th>Location</th> |
| 60 |
<th>IP</th> |
| 61 |
<th>User Agent</th> |
| 62 |
<th></th> |
| 63 |
</tr> |
| 64 |
</tfoot> |
| 65 |
</table> |
| 66 |
</div> |
| 67 |
<div data-log="locks" class="tooltip empty_log tooltipstered" data-msg-success="Lockdowns Log Emptied" data-btn-confirm="Yes, empty the log" data-title="Are you sure you want to empty the Lockdowns Log?" data-wait-msg="Emptying. Please wait." data-name=""><i class="loginlockdown-icon loginlockdown-trash"></i> Empty Lockdowns Log</div>'; |
| 68 |
echo '</div>'; |
| 69 |
} |
| 70 |
|
| 71 |
static function tab_full() |
| 72 |
{ |
| 73 |
echo '<div class="loginlockdown-stats-main loginlockdown-chart-fails" style="display:none"><canvas id="loginlockdown-fails-chart" style="height: 160px; width: 100%;"></canvas></div>'; |
| 74 |
echo '<div class="loginlockdown-stats-main loginlockdown-stats-fails" style="display:none">'; |
| 75 |
echo '<img src="' . esc_url(LOGINLOCKDOWN_PLUGIN_URL) . '/images/advanced_stats.png" alt="Login Lockdown" title="Login Lockdown Advanced Stats" />'; |
| 76 |
echo '</div>'; |
| 77 |
echo '<div class="tab-content">'; |
| 78 |
echo '<div id="loginlockdown-fails-log-table-wrapper"> |
| 79 |
<table cellpadding="0" cellspacing="0" border="0" class="display" id="loginlockdown-fails-log-table"> |
| 80 |
<thead> |
| 81 |
<tr> |
| 82 |
<th style="width:160px;" align="left">Date & Time</th> |
| 83 |
<th style="width:280px;" align="left">User</th> |
| 84 |
<th style="width:180px;">Location</th> |
| 85 |
<th style="width:180px;">IP</th> |
| 86 |
<th style="width:180px;">User Agent</th> |
| 87 |
<th style="width:280px;">Reason</th> |
| 88 |
<th style="width:80px;"></th> |
| 89 |
</tr> |
| 90 |
</thead> |
| 91 |
<tbody></tbody> |
| 92 |
<tfoot> |
| 93 |
<tr> |
| 94 |
<th>Date & Time</th> |
| 95 |
<th>Username</th> |
| 96 |
<th>Location</th> |
| 97 |
<th>IP</th> |
| 98 |
<th>User Agent</th> |
| 99 |
<th>Reason</th> |
| 100 |
<th></th> |
| 101 |
</tr> |
| 102 |
</tfoot> |
| 103 |
</table> |
| 104 |
</div> |
| 105 |
<div data-log="fails" class="tooltip empty_log tooltipstered" data-msg-success="Fails Log Emptied" data-btn-confirm="Yes, empty the log" data-title="Are you sure you want to empty the Failed Logins Log?" data-wait-msg="Emptying. Please wait." data-name=""><i class="loginlockdown-icon loginlockdown-trash"></i> Empty Failed Logins Log</div>'; |
| 106 |
echo '</div>'; |
| 107 |
} |
| 108 |
} // class LoginLockdown_Tab_Activity |
| 109 |
|