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:
41
app/Console/Commands/PurgeExpiredDataExports.php
Normal file
41
app/Console/Commands/PurgeExpiredDataExports.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\DataExport;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class PurgeExpiredDataExports extends Command
|
||||
{
|
||||
protected $signature = 'exports:purge';
|
||||
|
||||
protected $description = 'Delete abgelaufene Datenexporte und entfernen die entsprechenden Dateien.';
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$expired = DataExport::query()
|
||||
->whereNotNull('expires_at')
|
||||
->where('expires_at', '<', now())
|
||||
->get();
|
||||
|
||||
if ($expired->isEmpty()) {
|
||||
$this->info(__('profile.export.purge.none'));
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
||||
$count = 0;
|
||||
foreach ($expired as $export) {
|
||||
if ($export->path && Storage::disk('local')->exists($export->path)) {
|
||||
Storage::disk('local')->delete($export->path);
|
||||
}
|
||||
$export->delete();
|
||||
$count++;
|
||||
}
|
||||
|
||||
$this->info(trans_choice('profile.export.purge.deleted', $count, ['count' => $count]));
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user