mirror of
https://github.com/v2board/v2board.git
synced 2025-01-27 00:19:10 +08:00
add email whitelist config
This commit is contained in:
parent
078e1e7bd6
commit
6b9e424b74
@ -18,10 +18,10 @@ class AuthController extends Controller
|
|||||||
{
|
{
|
||||||
public function register(AuthRegister $request)
|
public function register(AuthRegister $request)
|
||||||
{
|
{
|
||||||
if ((int)config('v2board.email_suffix_enable', 0)) {
|
if ((int)config('v2board.email_whitelist_enable', 0)) {
|
||||||
if (!Helper::emailSuffixVerify(
|
if (!Helper::emailSuffixVerify(
|
||||||
$request->input('email'),
|
$request->input('email'),
|
||||||
config('v2board.email_suffix_whitelist', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT))
|
config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT))
|
||||||
) {
|
) {
|
||||||
abort(500, '邮箱后缀不处于白名单中');
|
abort(500, '邮箱后缀不处于白名单中');
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,8 @@ class CommController extends Controller
|
|||||||
'data' => [
|
'data' => [
|
||||||
'isEmailVerify' => (int)config('v2board.email_verify', 0) ? 1 : 0,
|
'isEmailVerify' => (int)config('v2board.email_verify', 0) ? 1 : 0,
|
||||||
'isInviteForce' => (int)config('v2board.invite_force', 0) ? 1 : 0,
|
'isInviteForce' => (int)config('v2board.invite_force', 0) ? 1 : 0,
|
||||||
'emailSuffixWhiteList' => (int)config('v2board.email_suffix_enable', 0)
|
'emailWhitelistSuffix' => (int)config('v2board.email_whitelist_enable', 0)
|
||||||
? config('v2board.email_suffix_whitelist', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT)
|
? config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT)
|
||||||
: 0
|
: 0
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
@ -23,7 +23,7 @@ class ConfigSave extends FormRequest
|
|||||||
'try_out_plan_id' => 'integer',
|
'try_out_plan_id' => 'integer',
|
||||||
'try_out_hour' => 'numeric',
|
'try_out_hour' => 'numeric',
|
||||||
'email_whitelist_enable' => 'in:0,1',
|
'email_whitelist_enable' => 'in:0,1',
|
||||||
'email_suffix_whitelist' => '',
|
'email_whitelist_suffix' => '',
|
||||||
// server
|
// server
|
||||||
'server_token' => 'nullable|min:16',
|
'server_token' => 'nullable|min:16',
|
||||||
'server_license' => 'nullable',
|
'server_license' => 'nullable',
|
||||||
|
Loading…
Reference in New Issue
Block a user