Skip to content

Commit

Permalink
🔧 add option to disallow registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu committed Dec 16, 2024
1 parent ea0d044 commit f0c82b7
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 38 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ IMPRINT_FAX=
IMPRINT_EMAIL=

MATOMO_URL=
MATOMO_ID=
MATOMO_ID=

REGISTRATION_ENABLED=false
2 changes: 2 additions & 0 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class RegisterController extends Controller {

use RegistersUsers;



/**
* Where to redirect users after registration.
*
Expand Down
2 changes: 2 additions & 0 deletions config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,6 @@

'password_timeout' => 10800,

'registration_enabled' => env('REGISTRATION_ENABLED', true),

];
74 changes: 38 additions & 36 deletions resources/views/layout/cover.blade.php
Original file line number Diff line number Diff line change
@@ -1,47 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

<title>KStats - {{__('general.menu.stats')}}</title>
<title>KStats - {{__('general.menu.stats')}}</title>

<link href="/css/app.css" rel="stylesheet">
<link href="/css/cover.css" rel="stylesheet">
<link href="/css/app.css" rel="stylesheet">
<link href="/css/cover.css" rel="stylesheet">

<link rel="shortcut icon" type="image/x-icon" href="/favicon.svg">
</head>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.svg">
</head>

<body class="text-center">
<body class="text-center">

<div class="cover-container d-flex h-100 p-3 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<h3 class="masthead-brand">KStats</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="{{ route('welcome') }}">{{__('general.menu.home')}}</a>
@guest
<a class="nav-link" href="{{ route('login') }}">{{__('auth.login')}}</a>
<a class="nav-link" href="{{ route('register') }}">{{__('auth.register')}}</a>
@else
<a class="nav-link" href="{{ route('home') }}">{{__('general.menu.dashboard')}}</a>
@endif
</nav>
</div>
</header>
<div class="cover-container d-flex h-100 p-3 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<h3 class="masthead-brand">KStats</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="{{ route('welcome') }}">{{__('general.menu.home')}}</a>
@guest
<a class="nav-link" href="{{ route('login') }}">{{__('auth.login')}}</a>
@if (Route::has('register'))
<a class="nav-link" href="{{ route('register') }}">{{__('auth.register')}}</a>
@endif
@else
<a class="nav-link" href="{{ route('home') }}">{{__('general.menu.dashboard')}}</a>
@endif
</nav>
</div>
</header>

@yield('content')
@yield('content')

<footer class="mastfoot mt-auto">
<div class="inner">
<p>
<a href="https://github.com/MrKrisKrisu/KStats"
target="github">{{ __('general.show_sourcecode') }}</a> -
<a href="/imprint/">{{__('general.menu.imprint')}}</a> -
<a href="/privacy">{{ __('general.menu.privacy_policy') }}</a>
</p>
</div>
</footer>
<footer class="mastfoot mt-auto">
<div class="inner">
<p>
<a href="https://github.com/MrKrisKrisu/KStats"
target="github">{{ __('general.show_sourcecode') }}</a> -
<a href="/imprint/">{{__('general.menu.imprint')}}</a> -
<a href="/privacy">{{ __('general.menu.privacy_policy') }}</a>
</p>
</div>
</body>
</footer>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Route::get('/public/{username}/{shareId}', [SharedLinkController::class, 'show'])
->name('public.show');

Auth::routes();
Auth::routes(['register' => config('auth.registration_enabled')]);

Route::middleware(['auth', 'privacy_confirmation'])->group(function() {

Expand Down

0 comments on commit f0c82b7

Please sign in to comment.