mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
add safe mode
This commit is contained in:
parent
ffe05a5467
commit
1f471545d4
@ -24,7 +24,7 @@ class ConfigController extends Controller
|
|||||||
'invite_never_expire' => config('v2board.invite_never_expire', 0)
|
'invite_never_expire' => config('v2board.invite_never_expire', 0)
|
||||||
],
|
],
|
||||||
'site' => [
|
'site' => [
|
||||||
'save_mode' => (int)config('v2board.save_mode', 0),
|
'safe_mode_enable' => (int)config('v2board.safe_mode_enable', 0),
|
||||||
'stop_register' => (int)config('v2board.stop_register', 0),
|
'stop_register' => (int)config('v2board.stop_register', 0),
|
||||||
'email_verify' => (int)config('v2board.email_verify', 0),
|
'email_verify' => (int)config('v2board.email_verify', 0),
|
||||||
'app_name' => config('v2board.app_name', 'V2Board'),
|
'app_name' => config('v2board.app_name', 'V2Board'),
|
||||||
|
@ -7,7 +7,7 @@ use Illuminate\Foundation\Http\FormRequest;
|
|||||||
class ConfigSave extends FormRequest
|
class ConfigSave extends FormRequest
|
||||||
{
|
{
|
||||||
CONST RULES = [
|
CONST RULES = [
|
||||||
'save_mode' => 'in:0,1',
|
'safe_mode_enable' => 'in:0,1',
|
||||||
'invite_force' => 'in:0,1',
|
'invite_force' => 'in:0,1',
|
||||||
'invite_commission' => 'integer',
|
'invite_commission' => 'integer',
|
||||||
'invite_gen_limit' => 'integer',
|
'invite_gen_limit' => 'integer',
|
||||||
|
@ -14,7 +14,7 @@ use Illuminate\Http\Request;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Route::get('/', function (Request $request) {
|
Route::get('/', function (Request $request) {
|
||||||
if (config('v2board.app_url')) {
|
if (config('v2board.app_url') && config('v2board.safe_mode_enable', 0)) {
|
||||||
if ($request->server('HTTP_HOST') !== parse_url(config('v2board.app_url'))['host']) {
|
if ($request->server('HTTP_HOST') !== parse_url(config('v2board.app_url'))['host']) {
|
||||||
abort(403);
|
abort(403);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user