diff --git a/app/Http/Controllers/OptionsController.php b/app/Http/Controllers/OptionsController.php index 7fbbcc3..6285faf 100644 --- a/app/Http/Controllers/OptionsController.php +++ b/app/Http/Controllers/OptionsController.php @@ -55,6 +55,9 @@ class OptionsController extends Controller 'requiresPMC' => Options::getOption('requireGameLicense'), 'enforce2fa' => Options::getOption('force2fa'), ], + 'features' => [ + 'enableRegistrations' => Options::getOption('enable_registrations') + ], 'currentGame' => Options::getOption('currentGame'), ]); } diff --git a/app/Http/Controllers/SecuritySettingsController.php b/app/Http/Controllers/SecuritySettingsController.php index af0ba31..7a53ab7 100644 --- a/app/Http/Controllers/SecuritySettingsController.php +++ b/app/Http/Controllers/SecuritySettingsController.php @@ -21,6 +21,7 @@ class SecuritySettingsController extends Controller 'pwExpiry' => $request->pwExpiry, 'enforce2fa' => $request->enforce2fa, 'requirePMC' => $request->requirePMC, + 'enable_registrations' => $request->input('enable_registrations') ]); return redirect() diff --git a/app/Services/SecuritySettingsService.php b/app/Services/SecuritySettingsService.php index b170b0f..763940b 100644 --- a/app/Services/SecuritySettingsService.php +++ b/app/Services/SecuritySettingsService.php @@ -40,6 +40,7 @@ class SecuritySettingsService Options::changeOption('password_expiry', $options['pwExpiry']); Options::changeOption('force2fa', $options['enforce2fa']); Options::changeOption('requireGameLicense', $options['requirePMC']); + Options::changeOption('enable_registrations', $options['enable_registrations']); return true; } diff --git a/database/seeders/DefaultOptionsSeeder.php b/database/seeders/DefaultOptionsSeeder.php index 365a0b7..001bde3 100644 --- a/database/seeders/DefaultOptionsSeeder.php +++ b/database/seeders/DefaultOptionsSeeder.php @@ -54,5 +54,6 @@ class DefaultOptionsSeeder extends Seeder Options::setOption('enable_slack_notifications', true, 'Enable slack notifications', 'notifications'); Options::setOption('enable_email_notifications', true, 'Enable e-mail notifications', 'notifications'); + Options::setOption('enable_registrations', true, 'Enable sign-uos', 'app_features'); } } diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 2e16ffd..b3c81c1 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -13,98 +13,134 @@
{{__('Sign up for an account')}}
- @if(\App\Facades\Options::getOption('pw_security_policy') !== 'off') + @if(\App\Facades\Options::getOption('enable_registrations') == true) +{{__('Sign up for an account')}}
-{{__('Basic password security')}}
-{{__("For your security, we implement strict password policies. It's also advisable to let your password manager or browser generate and save passwords for you (if it's a private device).")}}
+ @if(\App\Facades\Options::getOption('pw_security_policy') !== 'off') -{{__('Passwords must be a combination of:')}}
-{{__('Basic password security')}}
+{{__("For your security, we implement strict password policies. It's also advisable to let your password manager or browser generate and save passwords for you (if it's a private device).")}}
- @case('low') -{{__('Passwords must be a combination of:')}}
+{{ __('Warning') }}
-{{ __('Do not use real credentials here. The application is in demo mode. Additionally, the database is wiped every day.') }}
+ @endif -{{ __("Also note: If a game license is required to sign up, you may find valid MC usernames at NameMC. No special validation is performed other than contacting Mojang's authentication servers to verify the username's existence, therefore, you can use any username for testing purposes.") }}
+ @if($demoActive) +{{ __('Warning') }}
+{{ __('Do not use real credentials here. The application is in demo mode. Additionally, the database is wiped every day.') }}
+ +{{ __("Also note: If a game license is required to sign up, you may find valid MC usernames at NameMC. No special validation is performed other than contacting Mojang's authentication servers to verify the username's existence, therefore, you can use any username for testing purposes.") }}
+{{ __('Due to an internal policy, new accounts cannot be created, and so you will not be able to sign up for an account. If you already have an account with us, you can still sign-in as you usually would.') }}
{{ __('Effectively, this means that you will not be able to apply for any of our vacancies unless you already have an account. However, if you\'ve received an invitation to create an account or apply for a vacancy, you still can, but you must use the sign-up invitation link sent to your email address.') }}
+{!! __('Alternatively, if you don\'t have an invitation, feel free to :requestInviteLink.', ['requestInviteLink' => '' . __('request an invite') . '']) !!}
+{{ __('Unchecking this box will stop people from signing up to :appName and disable the associated form. However, you will still be able to invite users and create new accounts from the administrative UI if you so choose.', ['appName' => config('app.name')]) }}
+ +