49 lines
1.3 KiB
Markdown
49 lines
1.3 KiB
Markdown
# 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. `mummert/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.
|