diff options
| -rw-r--r-- | public/index.php | 7 | ||||
| -rw-r--r-- | public/static/style.css | 6 | ||||
| -rw-r--r-- | public/upload.php | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/public/index.php b/public/index.php index a6fa197..9e3dc4e 100644 --- a/public/index.php +++ b/public/index.php @@ -334,6 +334,13 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); </td> </tr> <tr> + <th>Password<span class="help" title="For file deletion">[?]</span>:</th> + <td><input type="text" name="password" + placeholder="Leave empty if you want the file to be non-deletable" + value="<?= generate_random_char_sequence(FILE_ID_CHARACTERS, FILE_DELETION_KEY_LENGTH) ?>"> + </td> + </tr> + <tr> <th>Preserve original filename:</th> <td><input type="checkbox" name="preserve_original_name" value="1"></td> </tr> diff --git a/public/static/style.css b/public/static/style.css index 2194b28..1d640a3 100644 --- a/public/static/style.css +++ b/public/static/style.css @@ -364,4 +364,10 @@ button[type=submit].fancy:hover { .font-small { font-size: 10px; +} + +.help { + cursor: help; + font-size: 10px; + vertical-align: top; }
\ No newline at end of file diff --git a/public/upload.php b/public/upload.php index 8ad01e1..f578631 100644 --- a/public/upload.php +++ b/public/upload.php @@ -242,7 +242,7 @@ try { 'download_url' => INSTANCE_URL . "/{$file_data['id']}.{$file_data['extension']}" ]; - if (FILE_DELETION) { + if (FILE_DELETION && !empty($_POST['password'])) { $file_data['password'] = $_POST['password'] ?? generate_random_char_sequence(FILE_ID_CHARACTERS, FILE_DELETION_KEY_LENGTH); $file_data['urls']['deletion_url'] = INSTANCE_URL . "/delete.php?f={$file_data['id']}.{$file_data['extension']}&key={$file_data['password']}"; } |
