mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Add account logs to admin panel accounts editor
This commit is contained in:
parent
d90810cf84
commit
8c3b73ca9e
@ -266,6 +266,9 @@ else if (isset($_REQUEST['search'])) {
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="accounts-acc-tab" data-toggle="pill" href="#accounts-acc">Account</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="accounts-logs-tab" data-toggle="pill" href="#accounts-logs">Logs</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="accounts-chars-tab" data-toggle="pill" href="#accounts-chars">Characters</a>
|
||||
</li>
|
||||
@ -423,6 +426,34 @@ else if (isset($_REQUEST['search'])) {
|
||||
<a href="<?php echo ADMIN_URL; ?>?p=accounts" class="btn btn-danger float-right"><i class="fas fa-cancel"></i> Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="accounts-logs">
|
||||
<div class="row">
|
||||
<table class="table table-striped table-condensed table-responsive d-md-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Date</th>
|
||||
<th>Action</th>
|
||||
<th>IP</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$accountActions = \MyAAC\Models\AccountAction::where('account_id', $account->getId())->orderByDesc('date')->get();
|
||||
foreach ($accountActions as $i => $log):
|
||||
$log->ip = ($log->ip != 0 ? long2ip($log->ip) : inet_ntop($log->ipv6));
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $i + 1; ?></td>
|
||||
<td><?= date("M d Y, H:i:s", $log->date); ?></td>
|
||||
<td><?= $log->action; ?></td>
|
||||
<td><?= $log->ip; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="accounts-chars">
|
||||
<div class="row">
|
||||
<?php
|
||||
|
14
system/src/Models/AccountAction.php
Normal file
14
system/src/Models/AccountAction.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace MyAAC\Models;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AccountAction extends Model {
|
||||
|
||||
protected $table = TABLE_PREFIX . 'account_actions';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = ['account_id', 'ip', 'ipv6', 'date', 'action'];
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user