X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/d598ed64ed220d9bc3113add823c93310c68ad38..a155e54c13f86994f4280fb18eba021f3cc7c9fd:/script.php diff --git a/script.php b/script.php index 3f7d2f7..434a2c3 100644 --- a/script.php +++ b/script.php @@ -65,7 +65,7 @@ if (has_error()) { /* Upload file */ if (isset($_FILES['file']) && is_writable(VAR_FILES) && is_writable(VAR_LINKS)) { - if (isset ($_POST['upload_password'])) { + if (isset($_POST['upload_password'])) { if (!jirafeau_challenge_upload($cfg, get_ip_address($cfg), $_POST['upload_password'])) { echo 'Error 3: Invalid password'; exit; @@ -127,11 +127,22 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES) exit; } - $res = jirafeau_upload($_FILES['file'], - isset($_POST['one_time_download']), - $key, $time, get_ip_address($cfg), - $cfg['enable_crypt'], $cfg['link_name_length'], - $cfg['file_hash']); + if ($cfg['store_uploader_ip']) { + $ip = get_ip_address($cfg); + } else { + $ip = ""; + } + + $res = jirafeau_upload( + $_FILES['file'], + isset($_POST['one_time_download']), + $key, + $time, + $ip, + $cfg['enable_crypt'], + $cfg['link_name_length'], + $cfg['file_hash'] + ); if (empty($res) || $res['error']['has_error']) { echo 'Error 6 ' . $res['error']['why']; @@ -384,7 +395,6 @@ elif [ "$1" == "delete" ]; then $curl $proxy "$2" fi