]> git.p6c8.net - jirafeau/jirafeau.git/commitdiff
The generated download password was not shown in the "finished" page
authorPatrick Canterino <patrick@patrick-canterino.de>
Sat, 9 Aug 2025 13:06:13 +0000 (15:06 +0200)
committerPatrick Canterino <patrick@patrick-canterino.de>
Sat, 9 Aug 2025 13:06:13 +0000 (15:06 +0200)
This feature got accidentally lost during refactoring

Also made the form field readonly

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..5d4602e6c235fedb8e56e5ffb98c52b55fdc52fc 100644 (file)
@@ -1779,7 +1779,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 +1796,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