error_log("PHP extension sodium not loaded, won't encrypt in Jirafeau");
}
if ($crypt_module_enabled == true && extension_loaded('sodium') == true) {
- $crypt_key = jirafeau_encrypt_file($file_path, $file_path.'crypt');
+ $crypt_key = jirafeau_encrypt_file($file_path, $file_path.'.crypt');
if (strlen($crypt_key) > 0) {
- if (rename($file_path.'crypt', $file_path) === true) {
+ if (rename($file_path.'.crypt', $file_path) === true) {
$crypted = true;
}
}
$handle,
$name . NL. $mime_type . NL. $size . NL. $password . NL. $time .
NL . $hash. NL . ($one_time_download ? 'O' : 'R') . NL . time() .
- NL . $ip . NL. $delete_link_code . NL . ($crypted ? 'C' : 'O')
+ NL . $ip . NL. $delete_link_code . NL . ($crypted ? 'C2' : 'O')
);
fclose($handle);
$hash_link = substr(base_16_to_64(md5_file($link_tmp_name)), 0, $link_name_length);
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>';
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']) {
</p>
</div>
- <?php if (!is_null($download_pass)) {
- ?>
+ <?php if (!is_null($download_pass)) { ?>
<div id="show_password">
<p><?php echo t('PSW') ?></p>