From: Patrick Canterino Date: Tue, 12 Aug 2025 12:46:59 +0000 (+0200) Subject: Merge branch 'f_issue_35-36' into 'next-release' X-Git-Tag: 4.7.0~6 X-Git-Url: https://git.p6c8.net/jirafeau/jirafeau.git/commitdiff_plain/3c708cc1e3834dc936e2480261aec9ad56f66a48?hp=1272757a4447535a7050cedc403a3c0b0a3c0854 Merge branch 'f_issue_35-36' into 'next-release' Fixes for issues 35 and 36 See merge request jirafeau/Jirafeau!26 --- diff --git a/index.php b/index.php index 435e059..4881c51 100644 --- a/index.php +++ b/index.php @@ -25,7 +25,9 @@ require(JIRAFEAU_ROOT . 'lib/settings.php'); require(JIRAFEAU_ROOT . 'lib/functions.php'); require(JIRAFEAU_ROOT . 'lib/lang.php'); -if ($cfg['download_password_requirement'] === "generated") { +$download_pass = null; + +if ($cfg['download_password_requirement'] === 'generated') { $download_pass = jirafeau_gen_download_pass($cfg['download_password_gen_len'], $cfg['download_password_gen_chars']); } @@ -102,7 +104,7 @@ elseif (true === jirafeau_challenge_upload_ip($cfg, get_ip_address($cfg))) { ?> - +

diff --git a/lib/functions.php b/lib/functions.php index f9fbd9b..578276f 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -771,6 +771,9 @@ function jirafeau_admin_list($name, $file_hash, $link_hash) if (!empty($link_hash) && $link_hash != $node) { continue; } + + /* Get download statistics */ + $ld = jirafeau_get_download_stats($node); /* Print link information. */ echo ''; echo ''; @@ -793,6 +796,11 @@ function jirafeau_admin_list($name, $file_hash, $link_hash) if (strlen($l['ip']) > 0) { echo t('ORIGIN') . ': ' . $l['ip'] . '
'; } + echo t('DOWNLOAD_COUNT') . ': ' . $ld['count'] . '
'; + if ($ld['count'] > 0) { + echo t('DOWNLOAD_DATE') . ': ' . jirafeau_get_datetimefield($ld['date']) . '
'; + echo t('DOWNLOAD_IP') . ': ' . $ld['ip'] . '
'; + } echo ''; if (!$l['crypted'] && !$l['crypted_legacy']) { @@ -1779,7 +1787,7 @@ function jirafeau_write_download_stats($hash, $ip) fclose($handle); } -function jirafeau_create_upload_finished_box($preview = true) +function jirafeau_create_upload_finished_box($preview = true, $download_pass = null) { ?> @@ -1796,6 +1804,22 @@ function jirafeau_create_upload_finished_box($preview = true)

+ +
+

+ +
+

+ '?> + +

+
+
+ + +