X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/2b4714c704f8ca5567c85a26e9202d5c9b3550e4..a916c325ea4dac39af4941d4a1fcd0c755c0edda:/lib/functions.php diff --git a/lib/functions.php b/lib/functions.php index 84f2a44..ae3516a 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -2,7 +2,7 @@ /* * Jirafeau, your web file repository * Copyright (C) 2008 Julien "axolotl" BERNARD <axolotl@magieeternelle.org> - * Copyright (C) 2015 Jerome Jutteau <j.jutteau@gmail.com> + * Copyright (C) 2015 Jerome Jutteau <jerome@jutteau.fr> * Copyright (C) 2015 Nicola Spanti (RyDroid) <dev@nicola-spanti.info> * * This program is free software: you can redistribute it and/or modify @@ -627,15 +627,9 @@ function jirafeau_admin_list($name, $file_hash, $link_hash) echo t('LS_FILES'); } echo '</legend>'; - echo '<table border="1" width="1100">'; + echo '<table>'; echo '<tr>'; - echo '<th>' . t('FILENAME') . '</th>'; - echo '<th>' . t('TYPE') . '</th>'; - echo '<th>' . t('SIZE') . '</th>'; - echo '<th>' . t('EXPIRE') . '</th>'; - echo '<th>' . t('ONETIME') . '</th>'; - echo '<th>' . t('UPLOAD_DATE') . '</th>'; - echo '<th>' . t('ORIGIN') . '</th>'; + echo '<th></th>'; echo '<th>' . t('ACTION') . '</th>'; echo '</tr>'; @@ -672,22 +666,15 @@ function jirafeau_admin_list($name, $file_hash, $link_hash) echo '<tr>'; echo '<td>' . '<strong><a id="upload_link" href="f.php?h='. jirafeau_escape($node) .'" title="' . - t('DL_PAGE') . '">' . jirafeau_escape($l['file_name']) . '</a></strong>'; - echo '</td>'; - echo '<td>' . jirafeau_escape($l['mime_type']) . '</td>'; - echo '<td>' . jirafeau_human_size($l['file_size']) . '</td>'; - echo '<td>' . ($l['time'] == -1 ? 'â' : jirafeau_get_datetimefield($l['time'])) . '</td>'; - echo '<td>'; - if ($l['onetime'] == 'O') { - echo 'Y'; - } else { - echo 'N'; - } - echo '</td>'; - echo '<td>' . jirafeau_get_datetimefield($l['upload_date']) . '</td>'; - echo '<td>' . $l['ip'] . '</td>'; - echo '<td>' . - '<form method="post">' . + t('DL_PAGE') . '">' . jirafeau_escape($l['file_name']) . '</a></strong><br/>'; + echo t('TYPE') . ': ' . jirafeau_escape($l['mime_type']) . '<br/>'; + echo t('SIZE') . ': ' . jirafeau_human_size($l['file_size']) . '<br>'; + echo t('EXPIRE') . ': ' . ($l['time'] == -1 ? 'â' : jirafeau_get_datetimefield($l['time'])) . '<br/>'; + echo t('ONETIME') . ': ' . ($l['onetime'] == 'O' ? 'Yes' : 'No') . '<br/>'; + echo t('UPLOAD_DATE') . ': ' . jirafeau_get_datetimefield($l['upload_date']) . '<br/>'; + echo t('ORIGIN') . ': ' . $l['ip'] . '<br/>'; + echo '</td><td>'; + echo '<form method="post">' . '<input type = "hidden" name = "action" value = "download"/>' . '<input type = "hidden" name = "link" value = "' . $node . '"/>' . jirafeau_admin_csrf_field() . @@ -866,6 +853,10 @@ function jirafeau_async_init($filename, $type, $one_time, $key, $time, $ip) return; } + /* touch empty data file */ + $w_path = $p . $ref . '_data'; + touch($w_path); + /* md5 password or empty */ $password = ''; if (!empty($key)) { @@ -1013,7 +1004,7 @@ function jirafeau_async_end($ref, $code, $crypt, $link_name_length, $file_hash_m $l = s2p("$hash_link"); if (!@mkdir(VAR_LINKS . $l, 0755, true) || !rename($link_tmp_name, VAR_LINKS . $l . $hash_link)) { - echo "Error"; + return 'Error'; } /* Clean async upload. */