Initial commits to the new options
This commit is contained in:
parent
4709667fe3
commit
566383ccd5
|
@ -45,7 +45,7 @@ public function checkPteroClientkey(){
|
||||||
"per-page-limit" => "required|min:0|integer",
|
"per-page-limit" => "required|min:0|integer",
|
||||||
"pterodactyl-admin-api-key" => "required|string",
|
"pterodactyl-admin-api-key" => "required|string",
|
||||||
"enable-upgrades" => "string",
|
"enable-upgrades" => "string",
|
||||||
|
"enable-disable-servers" => "string",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$validator->after(function ($validator) use ($request) {
|
$validator->after(function ($validator) use ($request) {
|
||||||
|
@ -85,6 +85,8 @@ public function checkPteroClientkey(){
|
||||||
"SETTINGS::SYSTEM:ENABLE_LOGIN_LOGO" => "enable-login-logo",
|
"SETTINGS::SYSTEM:ENABLE_LOGIN_LOGO" => "enable-login-logo",
|
||||||
"SETTINGS::SYSTEM:PTERODACTYL:ADMIN_USER_TOKEN" => "pterodactyl-admin-api-key",
|
"SETTINGS::SYSTEM:PTERODACTYL:ADMIN_USER_TOKEN" => "pterodactyl-admin-api-key",
|
||||||
"SETTINGS::SYSTEM:ENABLE_UPGRADE" => "enable-upgrade",
|
"SETTINGS::SYSTEM:ENABLE_UPGRADE" => "enable-upgrade",
|
||||||
|
"SETTINGS::SYSTEM:DISABLE_NEW_SERVERS" => "enable-disable-servers",
|
||||||
|
"SETTINGS::SYSTEM:DISABLE_NEW_USERS" => "enable-disable-new-users",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,11 @@ class ServerController extends Controller
|
||||||
return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can create a server."));
|
return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can create a server."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Required Verification for creating an server
|
||||||
|
if (config('SETTINGS::SYSTEM:DISABLE_NEW_SERVERS', 'false') === 'true' && !Auth::user()->role === "admin") {
|
||||||
|
return redirect()->route('servers.index')->with('error', __("The system administrator has prevented the creation of new servers."));
|
||||||
|
}
|
||||||
|
|
||||||
//Required Verification for creating an server
|
//Required Verification for creating an server
|
||||||
if (config('SETTINGS::USER:FORCE_DISCORD_VERIFICATION', 'false') === 'true' && !Auth::user()->discordUser) {
|
if (config('SETTINGS::USER:FORCE_DISCORD_VERIFICATION', 'false') === 'true' && !Auth::user()->discordUser) {
|
||||||
return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can create a server."));
|
return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can create a server."));
|
||||||
|
|
|
@ -522,5 +522,19 @@ class SettingsSeeder extends Seeder
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'description' => 'Enables the updgrade/downgrade feature for servers'
|
'description' => 'Enables the updgrade/downgrade feature for servers'
|
||||||
]);
|
]);
|
||||||
|
Settings::firstOrCreate([
|
||||||
|
'key' => 'SETTINGS::SYSTEM:DISABLE_NEW_SERVERS',
|
||||||
|
], [
|
||||||
|
'value' => "",
|
||||||
|
'type' => 'boolean',
|
||||||
|
'description' => 'Enable/disable the creation of new servers'
|
||||||
|
]);
|
||||||
|
Settings::firstOrCreate([
|
||||||
|
'key' => 'SETTINGS::SYSTEM:DISABLE_NEW_USERS',
|
||||||
|
], [
|
||||||
|
'value' => "",
|
||||||
|
'type' => 'boolean',
|
||||||
|
'description' => 'Enable/disable the creation of new users'
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,12 +128,18 @@
|
||||||
<label for="force-discord-verification">{{ __('Force Discord verification') }}
|
<label for="force-discord-verification">{{ __('Force Discord verification') }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="custom-control mb-3 p-0">
|
<div class="custom-control mb-1 p-0">
|
||||||
<input value="true" id="force-email-verification" name="force-email-verification"
|
<input value="true" id="force-email-verification" name="force-email-verification"
|
||||||
{{ config('SETTINGS::USER:FORCE_EMAIL_VERIFICATION') == 'true' ? 'checked' : '' }}
|
{{ config('SETTINGS::USER:FORCE_EMAIL_VERIFICATION') == 'true' ? 'checked' : '' }}
|
||||||
type="checkbox">
|
type="checkbox">
|
||||||
<label for="force-email-verification">{{ __('Force E-Mail verification') }} </label>
|
<label for="force-email-verification">{{ __('Force E-Mail verification') }} </label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="custom-control mb-3 p-0">
|
||||||
|
<input value="true" id="enable-disable-new-users" name="enable-disable-new-users"
|
||||||
|
{{ config('SETTINGS::SYSTEM:DISABLE_NEW_USERS') == 'true' ? 'checked' : '' }}
|
||||||
|
type="checkbox">
|
||||||
|
<label for="enable-disable-new-users">{{ __('Enable/disable nem users') }} </label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="custom-control mb-3 p-0">
|
<div class="custom-control mb-3 p-0">
|
||||||
<label for="initial-credits">{{ __('Initial Credits') }}</label>
|
<label for="initial-credits">{{ __('Initial Credits') }}</label>
|
||||||
|
@ -209,6 +215,21 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="custom-control mb-1 p-0">
|
||||||
|
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
|
||||||
|
<div>
|
||||||
|
<input value="true" id="enable-disable-servers" name="enable-disable-servers"
|
||||||
|
{{ config('SETTINGS::SYSTEM:DISABLE_NEW_SERVERS') == 'true' ? 'checked' : '' }}
|
||||||
|
type="checkbox">
|
||||||
|
<label for="enable-disable-servers">{{ __('Enable/disable new servers') }} </label>
|
||||||
|
</div>
|
||||||
|
<i data-toggle="popover" data-trigger="hover" data-html="true"
|
||||||
|
data-content="{{ __('Enable/disable the creation of new servers.') }}"
|
||||||
|
class="fas fa-info-circle"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="custom-control mb-3 p-0">
|
<div class="custom-control mb-3 p-0">
|
||||||
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
|
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
|
||||||
|
@ -222,8 +243,6 @@
|
||||||
class="form-control @error('allocation-limit') is-invalid @enderror" required>
|
class="form-control @error('allocation-limit') is-invalid @enderror" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- Design --}}
|
{{-- Design --}}
|
||||||
|
|
|
@ -2,118 +2,128 @@
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<body class="hold-transition dark-mode register-page">
|
<body class="hold-transition dark-mode register-page">
|
||||||
<div class="register-box">
|
<div class="register-box">
|
||||||
<div class="card card-outline card-primary">
|
<div class="card card-outline card-primary">
|
||||||
<div class="card-header text-center">
|
<div class="card-header text-center">
|
||||||
<a href="{{route('welcome')}}" class="h1"><b class="mr-1">{{config('app.name', 'Laravel')}}</b></a>
|
<a href="{{route('welcome')}}" class="h1"><b class="mr-1">{{config('app.name', 'Laravel')}}</b></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p class="login-box-msg">{{__('Register a new membership')}}</p>
|
@if(config('SETTINGS::SYSTEM:DISABLE_NEW_USERS'))
|
||||||
|
<div class="alert alert-warning p-2 m-2">
|
||||||
|
<h5><i class="icon fas fa-exclamation-circle"></i> {{ __('Warning!') }}</h5>
|
||||||
|
{{ __('The system administrator has blocked the registration of new users') }}
|
||||||
|
</div>
|
||||||
|
<div class="text-center">
|
||||||
|
<a class="btn btn-primary" href="{{ route('login') }}">{{__('Back')}}</a>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<p class="login-box-msg">{{__('Register a new membership')}}</p>
|
||||||
|
|
||||||
<form method="POST" action="{{ route('register') }}">
|
<form method="POST" action="{{ route('register') }}">
|
||||||
|
|
||||||
@error('ip')
|
@error('ip')
|
||||||
<span class="text-danger" role="alert">
|
|
||||||
<small><strong>{{ $message }}</strong></small>
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
|
|
||||||
@error('registered')
|
|
||||||
<span class="text-danger" role="alert">
|
|
||||||
<small><strong>{{ $message }}</strong></small>
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
@if( $errors->has('ptero_registration_error') )
|
|
||||||
@foreach( $errors->get('ptero_registration_error') as $err )
|
|
||||||
<span class="text-danger" role="alert">
|
<span class="text-danger" role="alert">
|
||||||
<small><strong>{{ $err }}</strong></small>
|
<small><strong>{{ $message }}</strong></small>
|
||||||
</span>
|
</span>
|
||||||
@endforeach
|
@enderror
|
||||||
@endif
|
|
||||||
|
|
||||||
@csrf
|
@error('registered')
|
||||||
<div class="form-group">
|
<span class="text-danger" role="alert">
|
||||||
<div class="input-group">
|
<small><strong>{{ $message }}</strong></small>
|
||||||
<input type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}"
|
</span>
|
||||||
placeholder="{{__('Username')}}" required autocomplete="name" autofocus>
|
@enderror
|
||||||
<div class="input-group-append">
|
@if( $errors->has('ptero_registration_error') )
|
||||||
<div class="input-group-text">
|
@foreach( $errors->get('ptero_registration_error') as $err )
|
||||||
<span class="fas fa-user"></span>
|
<span class="text-danger" role="alert">
|
||||||
|
<small><strong>{{ $err }}</strong></small>
|
||||||
|
</span>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@csrf
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}"
|
||||||
|
placeholder="{{__('Username')}}" required autocomplete="name" autofocus>
|
||||||
|
<div class="input-group-append">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<span class="fas fa-user"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@error('name')
|
||||||
|
<span class="text-danger" role="alert">
|
||||||
|
<small><strong>{{ $message }}</strong></small>
|
||||||
|
</span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<input type="email" name="email" class="form-control @error('email') is-invalid @enderror" placeholder="{{__('Email')}}"
|
||||||
|
value="{{ old('email') }}" required autocomplete="email">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<span class="fas fa-envelope"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@error('email')
|
||||||
|
<span class="text-danger" role="alert">
|
||||||
|
<small><strong>{{ $message }}</strong></small>
|
||||||
|
</span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<input type="password" class="form-control @error('password') is-invalid @enderror" placeholder="{{__('Password')}}" name="password" required autocomplete="new-password">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<span class="fas fa-lock"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@error('password')
|
||||||
|
<span class="text-danger" role="alert">
|
||||||
|
<small><strong>{{ $message }}</strong></small>
|
||||||
|
</span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<input type="password" class="form-control" name="password_confirmation" placeholder="{{__('Retype password')}}" required autocomplete="new-password">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<span class="fas fa-lock"></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@if(config('SETTINGS::REFERRAL::ENABLED') == "true")
|
||||||
@error('name')
|
<div class="input-group mb-3">
|
||||||
<span class="text-danger" role="alert">
|
<input type="text" value="{{ \Request::get('ref') }}" class="form-control" name="referral_code" placeholder="{{__('Referral code')}} ({{__("optional")}})">
|
||||||
<small><strong>{{ $message }}</strong></small>
|
<div class="input-group-append">
|
||||||
</span>
|
<div class="input-group-text">
|
||||||
@enderror
|
<span class="fas fa-user-check"></span>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="input-group mb-3">
|
|
||||||
<input type="email" name="email" class="form-control @error('email') is-invalid @enderror" placeholder="{{__('Email')}}"
|
|
||||||
value="{{ old('email') }}" required autocomplete="email">
|
|
||||||
<div class="input-group-append">
|
|
||||||
<div class="input-group-text">
|
|
||||||
<span class="fas fa-envelope"></span>
|
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
|
@if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true')
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
{!! htmlFormSnippet() !!}
|
||||||
|
@error('g-recaptcha-response')
|
||||||
|
<span class="text-danger" role="alert">
|
||||||
|
<small><strong>{{ $message }}</strong></small>
|
||||||
|
</span>
|
||||||
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@endif
|
||||||
@error('email')
|
|
||||||
<span class="text-danger" role="alert">
|
|
||||||
<small><strong>{{ $message }}</strong></small>
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="row">
|
||||||
<div class="input-group mb-3">
|
<div class="col-8">
|
||||||
<input type="password" class="form-control @error('password') is-invalid @enderror" placeholder="{{__('Password')}}" name="password" required autocomplete="new-password">
|
|
||||||
<div class="input-group-append">
|
|
||||||
<div class="input-group-text">
|
|
||||||
<span class="fas fa-lock"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@error('password')
|
|
||||||
<span class="text-danger" role="alert">
|
|
||||||
<small><strong>{{ $message }}</strong></small>
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-group mb-3">
|
|
||||||
<input type="password" class="form-control" name="password_confirmation" placeholder="{{__('Retype password')}}" required autocomplete="new-password">
|
|
||||||
<div class="input-group-append">
|
|
||||||
<div class="input-group-text">
|
|
||||||
<span class="fas fa-lock"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@if(config('SETTINGS::REFERRAL::ENABLED') == "true")
|
|
||||||
<div class="input-group mb-3">
|
|
||||||
<input type="text" value="{{ \Request::get('ref') }}" class="form-control" name="referral_code" placeholder="{{__('Referral code')}} ({{__("optional")}})">
|
|
||||||
<div class="input-group-append">
|
|
||||||
<div class="input-group-text">
|
|
||||||
<span class="fas fa-user-check"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
@if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true')
|
|
||||||
<div class="input-group mb-3">
|
|
||||||
{!! htmlFormSnippet() !!}
|
|
||||||
@error('g-recaptcha-response')
|
|
||||||
<span class="text-danger" role="alert">
|
|
||||||
<small><strong>{{ $message }}</strong></small>
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
{{-- <div class="icheck-primary">--}}
|
{{-- <div class="icheck-primary">--}}
|
||||||
{{-- <input type="checkbox" id="agreeTerms" name="terms" value="agree">--}}
|
{{-- <input type="checkbox" id="agreeTerms" name="terms" value="agree">--}}
|
||||||
{{-- <label for="agreeTerms">--}}
|
{{-- <label for="agreeTerms">--}}
|
||||||
|
@ -147,4 +157,5 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- /.register-box -->
|
<!-- /.register-box -->
|
||||||
</body>
|
</body>
|
||||||
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
|
Loading…
Reference in a new issue