mirror of
https://gitlab.com/mojo42/Jirafeau.git
synced 2025-04-22 12:36:17 +02:00
[BUGFIX] Delete links using POST
closes #136 Signed-off-by: Jerome Jutteau <mojo@couak.net>
This commit is contained in:
parent
379a0267c2
commit
5efae52e30
28
f.php
28
f.php
@ -84,10 +84,32 @@ if (!file_exists(VAR_FILES . $p . $link['md5'])) {
|
||||
}
|
||||
|
||||
if (!empty($delete_code) && $delete_code == $link['link_code']) {
|
||||
jirafeau_delete_link($link_name);
|
||||
require(JIRAFEAU_ROOT.'lib/template/header.php');
|
||||
echo '<div class="message"><p>'.t('File has been deleted.').
|
||||
'</p></div>';
|
||||
if (isset($_POST['do_delete'])) {
|
||||
jirafeau_delete_link($link_name);
|
||||
echo '<div class="message"><p>'.t('File has been deleted.').
|
||||
'</p></div>';
|
||||
} else { ?>
|
||||
<div>
|
||||
<form action="f.php" method="post" id="submit_delete_post" class="form login">
|
||||
<input type="hidden" name="do_delete" value=1/>
|
||||
<fieldset>
|
||||
<legend> <?php echo t('Confirm deletion') ?> </legend>
|
||||
<table>
|
||||
<tr><td>
|
||||
<?php echo t('You are about to delete') . ' "' . htmlspecialchars($link['file_name']) . '" (' . jirafeau_human_size($link['file_size']) . ').' ?>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<?php echo t('By using our services, you accept our'). ' <a href="tos.php">' . t('Terms of Service') . '</a>.' ?>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="submit" id="submit_delete" value="<?php echo t('Delete'); ?>"
|
||||
onclick="document.getElementById('submit_delete_post').action='<?php echo 'f.php?h=' . $link_name . '&d=' . $delete_code . "';"; ?>
|
||||
document.getElementById('submit_delete').submit ();"/>
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset></form></div><?php
|
||||
}
|
||||
require(JIRAFEAU_ROOT.'lib/template/footer.php');
|
||||
exit;
|
||||
}
|
||||
|
@ -37,6 +37,9 @@
|
||||
"Preview": "",
|
||||
"Sorry, the requested file is not found": "",
|
||||
"File not available.": "",
|
||||
"Confirm deletion": "",
|
||||
"You are about to delete": "",
|
||||
"Delete": "",
|
||||
"File has been deleted.": "",
|
||||
"The time limit of this file has expired.": "",
|
||||
"Password protection": "",
|
||||
|
Loading…
x
Reference in New Issue
Block a user