]> git.p6c8.net - jirafeau/jirafeau.git/commitdiff
Merge branch 'f_issue_35-36' into 'next-release'
authorPatrick Canterino <patrick@patrick-canterino.de>
Tue, 12 Aug 2025 12:46:59 +0000 (14:46 +0200)
committerPatrick Canterino <patrick@patrick-canterino.de>
Tue, 12 Aug 2025 12:46:59 +0000 (14:46 +0200)
Fixes for issues 35 and 36

See merge request jirafeau/Jirafeau!26

index.php
lib/functions.php

index 435e059711db7532e24bb67c6c8ef37f1c5dee49..4881c51517a29d050153513f24ac7fe3876ccade 100644 (file)
--- 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))) {
 
 ?>
 
-<?php jirafeau_create_upload_finished_box($cfg['preview']); ?>
+<?php jirafeau_create_upload_finished_box($cfg['preview'], $download_pass); ?>
 
 <div id="uploading">
     <p>
index f9fbd9b72a92d79fa24e883db6f470bd30cb998a..578276f7e5642496696c703b46cfd10a4d19f394 100644 (file)
@@ -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 '<tr>';
                     echo '<td><strong>';
@@ -793,6 +796,11 @@ function jirafeau_admin_list($name, $file_hash, $link_hash)
                     if (strlen($l['ip']) > 0) {
                         echo t('ORIGIN') . ': ' . $l['ip'] . '<br/>';
                     }
+                    echo t('DOWNLOAD_COUNT') . ': ' . $ld['count'] . '<br/>';
+                    if ($ld['count'] > 0) {
+                        echo t('DOWNLOAD_DATE') . ': ' . jirafeau_get_datetimefield($ld['date']) . '<br/>';
+                        echo t('DOWNLOAD_IP') . ': ' . $ld['ip'] . '<br/>';
+                    }
                     echo '</td><td>';
 
                     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)
     </p>
     </div>
 
+    <?php if (!is_null($download_pass)) {
+    ?>
+    <div id="show_password">
+    <p><?php echo t('PSW') ?></p>
+
+    <div id="download_password">
+    <p>
+        <?php echo '<input id="output_key" value="' . $download_pass . '" readonly/>'?>
+        <button id="password_copy_button">&#128203;</button>
+    </p>
+    </div>
+    </div>
+    <?php
+    }?>
+
+
     <?php
     if ($preview == true) { ?>
     <div id="upload_finished_preview">

patrick-canterino.de