mirror of
https://github.com/v2board/v2board.git
synced 2025-06-12 12:37:54 +08:00
add email whitelist config
This commit is contained in:
18
app/Utils/Dict.php
Normal file
18
app/Utils/Dict.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Utils;
|
||||
|
||||
class Dict
|
||||
{
|
||||
CONST EMAIL_WHITELIST_SUFFIX_DEFAULT = [
|
||||
'gmail.com',
|
||||
'qq.com',
|
||||
'163.com',
|
||||
'yahoo.com',
|
||||
'sina.com',
|
||||
'126.com',
|
||||
'outlook.com',
|
||||
'yeah.net',
|
||||
'foxmail.com'
|
||||
];
|
||||
}
|
@ -84,4 +84,12 @@ class Helper
|
||||
default: return password_verify($password, $hash);
|
||||
}
|
||||
}
|
||||
|
||||
public static function emailSuffixVerify($email, $suffixs)
|
||||
{
|
||||
$suffix = preg_split('@', $email)[1];
|
||||
if (!$suffix) return false;
|
||||
if (!in_array($suffix, $suffixs)) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user