From 6b9e424b74eb443a003c623d9c042561f4434f45 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Sun, 9 Feb 2020 18:09:48 +0800 Subject: [PATCH] add email whitelist config --- app/Http/Controllers/Passport/AuthController.php | 4 ++-- app/Http/Controllers/Passport/CommController.php | 4 ++-- app/Http/Requests/Admin/ConfigSave.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Passport/AuthController.php b/app/Http/Controllers/Passport/AuthController.php index 1a23fcfc..41f92a12 100644 --- a/app/Http/Controllers/Passport/AuthController.php +++ b/app/Http/Controllers/Passport/AuthController.php @@ -18,10 +18,10 @@ class AuthController extends Controller { public function register(AuthRegister $request) { - if ((int)config('v2board.email_suffix_enable', 0)) { + if ((int)config('v2board.email_whitelist_enable', 0)) { if (!Helper::emailSuffixVerify( $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, '邮箱后缀不处于白名单中'); } diff --git a/app/Http/Controllers/Passport/CommController.php b/app/Http/Controllers/Passport/CommController.php index b026b4a0..c21de2eb 100644 --- a/app/Http/Controllers/Passport/CommController.php +++ b/app/Http/Controllers/Passport/CommController.php @@ -21,8 +21,8 @@ class CommController extends Controller 'data' => [ 'isEmailVerify' => (int)config('v2board.email_verify', 0) ? 1 : 0, 'isInviteForce' => (int)config('v2board.invite_force', 0) ? 1 : 0, - 'emailSuffixWhiteList' => (int)config('v2board.email_suffix_enable', 0) - ? config('v2board.email_suffix_whitelist', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT) + 'emailWhitelistSuffix' => (int)config('v2board.email_whitelist_enable', 0) + ? config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT) : 0 ] ]); diff --git a/app/Http/Requests/Admin/ConfigSave.php b/app/Http/Requests/Admin/ConfigSave.php index 845b8e94..c24cfcd2 100755 --- a/app/Http/Requests/Admin/ConfigSave.php +++ b/app/Http/Requests/Admin/ConfigSave.php @@ -23,7 +23,7 @@ class ConfigSave extends FormRequest 'try_out_plan_id' => 'integer', 'try_out_hour' => 'numeric', 'email_whitelist_enable' => 'in:0,1', - 'email_suffix_whitelist' => '', + 'email_whitelist_suffix' => '', // server 'server_token' => 'nullable|min:16', 'server_license' => 'nullable',