misuzu/public/manage/general/logs.php

28 lines
589 B
PHP
Raw Normal View History

<?php
namespace Misuzu;
2020-05-21 15:05:30 +00:00
use Misuzu\AuditLog;
use Misuzu\Pagination;
2020-05-25 19:58:06 +00:00
use Misuzu\Users\User;
2020-05-21 15:05:30 +00:00
require_once '../../../misuzu.php';
2020-05-25 19:58:06 +00:00
if(!User::hasCurrent() || !perms_check_user(MSZ_PERMS_GENERAL, User::getCurrent()->getId(), MSZ_PERM_GENERAL_VIEW_LOGS)) {
echo render_error(403);
return;
}
2020-05-21 15:05:30 +00:00
$pagination = new Pagination(AuditLog::countAll(), 50);
2020-05-21 15:05:30 +00:00
if(!$pagination->hasValidOffset()) {
echo render_error(404);
return;
}
2020-05-21 15:05:30 +00:00
$logs = AuditLog::all($pagination);
Template::render('manage.general.logs', [
'global_logs' => $logs,
2020-05-21 15:05:30 +00:00
'global_logs_pagination' => $pagination,
]);