- The host has their show recorded and wishes to select a slot.
- They go to https://hackerpublicradio.org/ and select the [⇧Upload⇧](https://hub.hackerpublicradio.org/calendar.php), which executes [calendar.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/calendar.php).
- The host selects a slot from [request.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/request.php), which executes [request_confirm.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/request_confirm.php).
- An email is sent to the host.
- The host clicks on the email link and is redirected to [upload.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/upload.php).
- The host fills in the form which executes [upload_confirm.php](https://repo.anhonesthost.net/HPR/hpr_hub/src/branch/main/hub/upload_confirm.php).
- The host receives a confirmation email.
## Sequence Diagram Requesting a slot
```mermaid
sequenceDiagram
host->>HPR: Reserve Slot
HPR->>HPR: Remove any old stale requests
HPR->>HPR: Remove any requests from this IP older than 15min
HPR->>HPR: Check for existing upload from this IP
alt Existing Upload found
HPR->>host: You already made a request for a show
Note over host: 412 Precondition Failed
end
HPR->>HPR: Create a temporary entry for this host
HPR->>HPR: Check for excessive uploads
alt Excessive uploads found
HPR->>host: Uploads have temporarily been suspended
Note over host: 412 Precondition Failed
end
HPR->>HPR: Populate the list of posted shows
HPR->>HPR: Validate provided ID
alt Invalid ID found
HPR->>HPR: Log IP to naughty file.
HPR->>host: 412 Precondition Failed
Note over host: 412 Precondition Failed
end
HPR->>HPR: Generate webform of free slots
HPR->>HPR: Populate the list of posted shows
HPR->>host: Webform
host->>HPR: show ID and email
loop Preform Checks
alt If check fails
HPR->>HPR: Log Error
HPR->>host: 412 ${error_code}
else All checks passed
HPR-->>email: email upload url
email-->>host: email upload url
end
end
```
## Checks in request.php and request_confirm.php
| 412 Error Code | Check |
| --- | ------ |
| e015b7c89da03385a9156d3e5d2eb25d | The ID is not an integer |
| 1493a07dec01a006d11bf43d2f17e5aa | The ID is negative |
| 79543dbb498ec47404aaed4d56bdc22b | Only one argument was allowed |
| f1f531c768f64404cb00437254b06d71 | The ID is too large |
| 2227263ac7171aca3214d155dec539ad | The ID is already allotted |
| 5971624889258aefb44e5f7bf8dffbd4 | We are under DDOS attack. |
| 19e9019c9615f755aec834000892ee9e | Wrong method used |
| 9bb147a251e8db132dafa93d98f8487f | Your hiding your IP Address |
| 02de1aef3b9490a417c39170d8f06028 | You did not use the web form |
| 2162941738512bfdb1d21f288ee7cdb4 | You skipped the request page |
| f0ad965f523b5c2ade071eb20d3618b5 | A breach in the space time continuum |
| 6570026fd11fc31ac0cada3e1dae4d0b | There is too long a time entering the form |
| a32fbe5f0494eb7f34034b164739314d | Wrong date |
| 76eaa1a1556faeadfc14631c35b8590a | Missing an email address |
| 8c307efe37146015a35e2d928c2c0f69 | Not a valid email |
| 705f8e26e42a90b31075a110674b19ee | Not a valid date |
| ad7f805c2f42be77122ec52f114fe318 | Date failed format check |
| 9424f7407b2fb83407760ad763286b53 | Episode Number is wrong |
| 59c7bff340d023773d987d71df545110 | Invalid date |