This commit is contained in:
Jürgen Mummert
2026-03-06 21:25:18 +01:00
commit d10c160ae9
25 changed files with 903 additions and 0 deletions

48
README.md Normal file
View File

@@ -0,0 +1,48 @@
# Limited Downloads Bundle (Contao 5.7)
Dieses Bundle erzeugt zeitlich befristete Download-Links nach einem Formularversand.
## Funktionsweise
1. Formular wird abgeschickt.
2. `processFormData`-Hook erstellt Token und Ablaufzeit.
3. Token wird in `tl_timed_download` gespeichert.
4. Token wird in der Session hinterlegt.
5. Frontend-Modul `timed_download_link` liest Token aus `?tdl=...` oder Session.
6. Modul zeigt Countdown und Download-Link.
7. Route `/download/{token}` prueft Token und Ablauf.
8. Bei gueltigem Token wird nur eine geschuetzte Datei ausgeliefert.
## Backend-Konfiguration
### Formular (`tl_form`)
- `Befristeten Download aktivieren`
- `Download-Datei` (muss in `tl_files` als geschuetzt markiert sein)
- `Gueltigkeitsdauer`
- `Zeiteinheit`
### Modul (`tl_module`)
Modultyp: `Befristeter Downloadlink`
- Ueberschrift (Standard-Modulfeld)
- Text (oberhalb des Links)
## Datenbank
Tabelle `tl_timed_download`:
- `token`
- `file_uuid`
- `expires_at`
## Installation (Privates GitHub-Repository)
1. Paket im privaten Repository bereitstellen, z.B. `eiswurm/limited-downloads-bundle`.
2. Im Projekt per Composer einbinden.
3. `vendor/bin/contao-console contao:migrate` ausfuehren.
## Hinweis
Das Bundle liefert bewusst nur Dateien aus, die in `tl_files` als `geschuetzt` markiert sind.