forked from fa/breadcrumb-the-shire
26 lines
692 B
PHP
26 lines
692 B
PHP
<?php
|
|
|
|
use MintyPHP\Buffer;
|
|
use MintyPHP\Support\Flash;
|
|
use MintyPHP\Support\Guard;
|
|
use MintyPHP\Router;
|
|
use MintyPHP\Service\MailLogService;
|
|
use MintyPHP\Service\PermissionService;
|
|
|
|
Guard::requireLogin();
|
|
Guard::requirePermission(PermissionService::MAIL_LOG_VIEW);
|
|
|
|
$currentUserId = (int) ($_SESSION['user']['id'] ?? 0);
|
|
if ($currentUserId > 0) {
|
|
PermissionService::getUserPermissions($currentUserId);
|
|
}
|
|
|
|
$mailLogId = (int) ($id ?? 0);
|
|
$mailLog = $mailLogId > 0 ? MailLogService::find($mailLogId) : null;
|
|
if (!$mailLog) {
|
|
Flash::error('Mail log not found', 'admin/mail-log', 'mail_log_not_found');
|
|
Router::redirect('admin/mail-log');
|
|
}
|
|
|
|
Buffer::set('title', t('View mail log'));
|