im profil kann ein nutzer nun seine daten exportieren. man kann seinen account löschen. nach 2 jahren werden inaktive accounts gelöscht, 1 monat vorher wird eine email geschickt. Hilfetexte und Legal Pages in der Guest PWA korrigiert und vom layout her optimiert (dark mode).
This commit is contained in:
39
app/Http/Controllers/ProfileAccountController.php
Normal file
39
app/Http/Controllers/ProfileAccountController.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Jobs\AnonymizeAccount;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ProfileAccountController extends Controller
|
||||
{
|
||||
public function destroy(Request $request): RedirectResponse
|
||||
{
|
||||
$confirmationWord = Str::upper(__('profile.delete.confirmation_keyword'));
|
||||
|
||||
$request->validate([
|
||||
'confirmation' => [
|
||||
'required',
|
||||
function ($attribute, $value, $fail) use ($confirmationWord) {
|
||||
if (Str::upper(trim((string) $value)) !== $confirmationWord) {
|
||||
$fail(__('profile.delete.validation', ['word' => $confirmationWord]));
|
||||
}
|
||||
},
|
||||
],
|
||||
]);
|
||||
|
||||
$user = $request->user();
|
||||
|
||||
abort_unless($user, 403);
|
||||
|
||||
if ($user->tenant?->anonymized_at) {
|
||||
return back()->with('status', __('profile.delete.already'));
|
||||
}
|
||||
|
||||
AnonymizeAccount::dispatch($user->id);
|
||||
|
||||
return redirect()->route('profile.index')->with('status', __('profile.delete.started'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user