This repository has been archived on 2025-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
misuzu-interim/public-legacy/settings/logs.php

22 lines
861 B
PHP
Raw Permalink Normal View History

2022-09-13 15:14:49 +02:00
<?php
namespace Misuzu;
use Misuzu\Pagination;
$currentUser = $msz->authInfo->userInfo;
if($currentUser === null)
Template::throwError(401);
2022-09-13 15:14:49 +02:00
$loginHistoryPagination = new Pagination($msz->authCtx->loginAttempts->countAttempts(userInfo: $currentUser), 5, 'hp');
$accountLogPagination = new Pagination($msz->auditLog->countLogs(userInfo: $currentUser), 10, 'ap');
$loginHistory = iterator_to_array($msz->authCtx->loginAttempts->getAttempts(userInfo: $currentUser, pagination: $loginHistoryPagination));
$auditLogs = iterator_to_array($msz->auditLog->getLogs(userInfo: $currentUser, pagination: $accountLogPagination));
2022-09-13 15:14:49 +02:00
Template::render('settings.logs', [
'login_history_list' => $loginHistory,
2022-09-13 15:14:49 +02:00
'login_history_pagination' => $loginHistoryPagination,
'account_log_list' => $auditLogs,
2022-09-13 15:14:49 +02:00
'account_log_pagination' => $accountLogPagination,
]);