1<?php 2 3use Fisharebest\Webtrees\Carbon; 4use Fisharebest\Webtrees\Contracts\UserInterface; 5use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel; 6use Fisharebest\Webtrees\Http\RequestHandlers\UserEditPage; 7use Fisharebest\Webtrees\Http\RequestHandlers\UserListPage; 8use Fisharebest\Webtrees\Http\RequestHandlers\UsersCleanupAction; 9use Fisharebest\Webtrees\I18N; 10use Illuminate\Support\Collection; 11 12/** 13 * @var Collection<UserInterface> $inactive_users 14 * @var string $title 15 * @var Collection<UserInterface> $unverified_users 16 */ 17 18?> 19 20<?= view('components/breadcrumbs', ['links' => [ 21 route(ControlPanel::class) => I18N::translate('Control panel'), 22 route(UserListPage::class) => I18N::translate('User administration'), 23 $title, 24]]) ?> 25 26<h1><?= $title ?></h1> 27 28<form method="post" action="<?= e(route(UsersCleanupAction::class)) ?>"> 29 <?= csrf_field() ?> 30 31 <table class="table table-bordered"> 32 <?php foreach ($inactive_users as $user) : ?> 33 <tr> 34 <td> 35 <input type="checkbox" name="delete[]" value="<?= $user->id() ?>" aria-label="<?= e($user->userName()) ?>"> 36 </td> 37 <td> 38 <a href="<?= e(route(UserEditPage::class, ['user_id' => $user->id()])) ?>"> 39 <?= e($user->userName()) ?> 40 — 41 <bdi><?= e($user->realName()) ?></bdi> 42 </a> 43 </td> 44 <td> 45 <?= I18N::translate('User’s account has been inactive too long: ') ?> 46 <?= view('components/datetime', ['timestamp' => Carbon::createFromTimestamp(max((int) $user->getPreference(UserInterface::PREF_TIMESTAMP_REGISTERED), (int) $user->getPreference(UserInterface::PREF_TIMESTAMP_ACTIVE)))]) ?> 47 </td> 48 </tr> 49 <?php endforeach ?> 50 51 <?php foreach ($unverified_users as $user) : ?> 52 <tr> 53 <td> 54 <input type="checkbox" name="delete[]" value="<?= $user->id() ?>" aria-label="<?= e($user->userName()) ?>"> 55 </td> 56 <td> 57 <a href="<?= e(route(UserEditPage::class, ['user_id' => $user->id()])) ?>"> 58 <?= e($user->userName()) ?> 59 — 60 <bdi><?= e($user->realName()) ?></bdi> 61 </a> 62 </td> 63 <td> 64 <?= I18N::translate('User didn’t verify within 7 days.') ?> 65 <?php if ($user->getPreference(UserInterface::PREF_IS_ACCOUNT_APPROVED) !== '1') : ?> 66 <?= I18N::translate('User not verified by administrator.') ?> 67 <?php endif ?> 68 </td> 69 </tr> 70 <?php endforeach ?> 71 </table> 72 73 <p> 74 <?php if ($inactive_users->isEmpty() && $unverified_users->isEmpty()) : ?> 75 <?= I18N::translate('Nothing found to cleanup') ?> 76 <?php else : ?> 77 <button type="submit" class="btn btn-primary"> 78 <?= I18N::translate('delete') ?> 79 </button> 80 <?php endif ?> 81 </p> 82</form> 83