feat: TOTP 2차 인증, 관리자 메뉴/대시보드 및 의존성 반영

- robthree/twofactorauth, Auth 설정·TotpService·2FA 뷰·라우트
- member TOTP 컬럼 DDL(login_tables, member_add_totp.sql)
- 관리자 메뉴·레이아웃·필터·대시보드 등 연관 변경
- env 샘플에 auth.requireTotp 주석

Made-with: Cursor
This commit is contained in:
taekyoungc
2026-03-26 15:29:55 +09:00
parent d36217920f
commit a3f92cd322
32 changed files with 1416 additions and 66 deletions

View File

@@ -4,7 +4,6 @@ $list = $list ?? [];
$mtIdx = (int) ($mtIdx ?? 0);
$mtCode = (string) ($mtCode ?? '');
$levelNames = $levelNames ?? [];
$superAdminLevel = \Config\Roles::LEVEL_SUPER_ADMIN;
?>
<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
<div class="flex flex-wrap items-center justify-between gap-y-2">
@@ -76,7 +75,7 @@ $superAdminLevel = \Config\Roles::LEVEL_SUPER_ADMIN;
if ((string) $row->mm_level === '') {
echo '전체';
} else {
$levels = array_filter(explode(',', $row->mm_level), fn ($lv) => (int) trim($lv) !== $superAdminLevel);
$levels = array_filter(explode(',', $row->mm_level), fn ($lv) => ! \Config\Roles::isSuperAdminEquivalent((int) trim($lv)));
$labels = array_map(fn ($lv) => $levelNames[trim($lv)] ?? trim($lv), $levels);
echo esc(implode(', ', $labels) ?: '전체');
}
@@ -146,7 +145,7 @@ $superAdminLevel = \Config\Roles::LEVEL_SUPER_ADMIN;
<span class="text-sm">전체</span>
</label>
<?php foreach ($levelNames as $lv => $name): ?>
<?php if ((int) $lv === $superAdminLevel) { continue; } ?>
<?php if (\Config\Roles::isSuperAdminEquivalent((int) $lv)) { continue; } ?>
<label class="inline-flex items-center gap-1 mm-level-label">
<input type="checkbox" name="mm_level[]" value="<?= (int) $lv ?>" class="mm-level-cb"/>
<span class="text-sm"><?= esc($name) ?></span>