]> git.p6c8.net - jirafeau/pcanterino.git/blobdiff - lib/functions.php
The generated download password was not shown in the "finished" page
[jirafeau/pcanterino.git] / lib / functions.php
index 03725073dae490118cf8ae4837578c99e4d58e03..5d4602e6c235fedb8e56e5ffb98c52b55fdc52fc 100644 (file)
@@ -446,7 +446,7 @@ function jirafeau_upload($file, $one_time_download, $key, $time, $ip, $crypt, $l
                  'link' => '',
                  'delete_link' => ''));
     }
-    jirafeau_add_file($file, $one_time_download, $key, $time, $ip, $crypt, $link_name_length, $file_hash_method);
+    return jirafeau_add_file($file, $one_time_download, $key, $time, $ip, $crypt, $link_name_length, $file_hash_method);
 }
 
 /**
@@ -623,7 +623,7 @@ function jirafeau_is_viewable($mime)
     if (!empty($mime)) {
         $viewable = array('image', 'video', 'audio');
         $decomposed = explode('/', $mime);
-        if (in_array($decomposed[0], $viewable) && stripos($mime, 'image/svg+xml') === false) {
+        if (in_array($decomposed[0], $viewable) && stripos($mime, 'image/svg+xml') === false && strpos($mime, ',') === false) {
             return true;
         }
         $viewable = array('text/plain');
@@ -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