Dateien nur mit Anmeldung, nur Microsoft-Login, mehrere Titelbilder (0.47.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m25s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m46s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m52s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 8m5s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m33s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m53s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 9m1s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m49s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 54s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m4s

- /uploads nur über das Portal: UploadController prüft Sitzung bzw. App-Token;
  frei nur die Dateien der Anmeldeseite (Logos, Symbole, Anmeldehintergrund,
  Stylesheet, Schrift); public/uploads/.htaccess leitet alles an index.php
  (Migration schreibt sie, da der Ordner vor dem Updater geschützt ist);
  Systemzustand prüft die Regel; nginx-Hinweis in docs/SECURITY.md
- Passwort-Anmeldung abschaltbar (PasswordLogin): Login-Formular, Passwort
  vergessen, App-Token und /api/v1/config; nur mit verknüpftem Konto
  abschaltbar, automatische Rückkehr ohne nutzbaren Dienst, Notausgang
  INHAUS_PASSWORD_LOGIN
- Titelbilder: profile_covers (bis 12), zufällig je Seitenaufruf
- ImageCompressor: Uploads im Backend (SafeUpload) und WordPress-Import auf
  ≤ 2400 px komprimiert, Format bleibt

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-28 17:26:15 +00:00
parent 47b55b4ce5
commit d91570f118
155 changed files with 1035 additions and 382 deletions

View file

@ -8,6 +8,7 @@ use App\Http\Responses\NeutralPasswordResetLinkResponse;
use App\Models\IdentityProvider;
use App\Models\User;
use App\Support\Audit;
use App\Support\PasswordLogin;
use Illuminate\Auth\Events\Failed;
use Illuminate\Auth\Events\Login;
use Illuminate\Auth\Events\PasswordReset;
@ -18,6 +19,7 @@ use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
use Inertia\Inertia;
use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse;
use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse;
@ -38,7 +40,8 @@ class FortifyServiceProvider extends ServiceProvider
Fortify::resetUserPasswordsUsing(ResetUserPassword::class);
Fortify::loginView(fn (Request $request) => Inertia::render('Auth/Login', [
'canResetPassword' => true,
'canResetPassword' => app(PasswordLogin::class)->enabled(),
'passwordLogin' => app(PasswordLogin::class)->enabled(),
'providers' => IdentityProvider::forLogin()->map->toLoginButton()->values(),
'identityError' => $request->session()->get('identity_error'),
'status' => $request->boolean('eingerichtet')
@ -58,6 +61,10 @@ class FortifyServiceProvider extends ServiceProvider
// Deaktivierte Konten und Konten ohne lokales Passwort (später: nur IdP) können
// sich nicht per Passwort anmelden.
Fortify::authenticateUsing(function (Request $request): ?User {
if (! app(PasswordLogin::class)->enabled()) {
throw ValidationException::withMessages([Fortify::username() => 'Die Anmeldung mit Passwort ist abgeschaltet – bitte über den Anmeldedienst oben anmelden.']);
}
$user = User::query()->where('email', Str::lower($request->input(Fortify::username())))->first();
// Immer ein Passwort prüfen – gleiche Antwortzeit, ob es das Konto gibt oder nicht