gmail limit

This commit is contained in:
Tokumeikoi 2020-05-25 18:02:13 +08:00
parent 6c3148bdb9
commit eb49e29cd0
4 changed files with 10 additions and 2 deletions

View File

@ -59,7 +59,8 @@ class ConfigController extends Controller
'try_out_plan_id' => (int)config('v2board.try_out_plan_id', 0),
'try_out_hour' => (int)config('v2board.try_out_hour', 1),
'email_whitelist_enable' => (int)config('v2board.email_whitelist_enable', 0),
'email_whitelist_suffix' => config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT)
'email_whitelist_suffix' => config('v2board.email_whitelist_suffix', Dict::EMAIL_WHITELIST_SUFFIX_DEFAULT),
'email_gmail_limit_enable' => config('v2board.email_gmail_limit_enable', 0)
],
'subscribe' => [
'plan_change_enable' => (int)config('v2board.plan_change_enable', 1),

View File

@ -27,6 +27,12 @@ class AuthController extends Controller
abort(500, '邮箱后缀不处于白名单中');
}
}
if ((int)config('v2board.email_gmail_limit_enable', 0)) {
$prefix = explode('@', $request->input('email'))[0];
if (strpos($prefix, '.') !== false || strpos($prefix, '+') !== false) {
abort(500, '不支持Gmail别名邮箱');
}
}
if ((int)config('v2board.stop_register', 0)) {
abort(500, '本站已关闭注册');
}

View File

@ -27,6 +27,7 @@ class ConfigSave extends FormRequest
'try_out_hour' => 'numeric',
'email_whitelist_enable' => 'in:0,1',
'email_whitelist_suffix' => '',
'email_gmail_limit_enable' => 'in:0,1',
// subscribe
'plan_change_enable' => 'in:0,1',
'reset_traffic_method' => 'in:0,1',

File diff suppressed because one or more lines are too long