- robthree/twofactorauth, Auth 설정·TotpService·2FA 뷰·라우트 - member TOTP 컬럼 DDL(login_tables, member_add_totp.sql) - 관리자 메뉴·레이아웃·필터·대시보드 등 연관 변경 - env 샘플에 auth.requireTotp 주석 Made-with: Cursor
49 lines
1020 B
PHP
49 lines
1020 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class MemberModel extends Model
|
|
{
|
|
protected $table = 'member';
|
|
protected $primaryKey = 'mb_idx';
|
|
protected $returnType = 'object';
|
|
protected $useTimestamps = false;
|
|
protected $allowedFields = [
|
|
'mb_id',
|
|
'mb_passwd',
|
|
'mb_totp_secret',
|
|
'mb_totp_enabled',
|
|
'mb_name',
|
|
'mb_email',
|
|
'mb_phone',
|
|
'mb_lang',
|
|
'mb_level',
|
|
'mb_group',
|
|
'mb_lg_idx',
|
|
'mb_state',
|
|
'mb_regdate',
|
|
'mb_latestdate',
|
|
'mb_leavedate',
|
|
'mb_login_fail_count',
|
|
'mb_locked_until',
|
|
];
|
|
|
|
/**
|
|
* mb_id로 회원 조회
|
|
*/
|
|
public function findByLoginId(string $mbId): ?object
|
|
{
|
|
return $this->where('mb_id', $mbId)->first();
|
|
}
|
|
|
|
/**
|
|
* mb_id 중복 여부
|
|
*/
|
|
public function isIdExists(string $mbId): bool
|
|
{
|
|
return $this->where('mb_id', $mbId)->countAllResults() > 0;
|
|
}
|
|
}
|