This blob has been accessed 369 times via Git panel.
- <?php
- require_once("core.php");
- if (!isset($_SESSION['logged_uid']) or !isset($_SESSION['logged_lvl']) or !isset($_SESSION['logged_key']) or ($_SESSION['logged_lvl'] != "subscriber")) {
- exit;
- }
- echo "<img src=\"images/ajax-loader.gif\" class=\"loader\">";
- if (isset($_FILES['filedrop_obj']) and !empty($_FILES['filedrop_obj']) and isset($_POST['filedrop_box']) and !empty($_POST['filedrop_box'])) {
- if (is_uploaded_file($_FILES['filedrop_obj']['tmp_name'])) {
- if ($_FILES['filedrop_obj']['size'] <= $max_file_size) {
- $filedrop_dir = sha1($_SESSION['logged_uid']);
- $filedrop_box = $_POST['filedrop_box'];
- $filedrop_nom = str_replace(" ", "_", $_FILES['filedrop_obj']['name']);
- if (!file_exists(".tmp/$filedrop_dir/$filedrop_box")) {
- mkdir(".tmp/$filedrop_dir/$filedrop_box",0700,1);
- }
- if (!file_exists(".tmp/$filedrop_dir/$filedrop_box/$filedrop_nom")) {
- $res = copy($_FILES['filedrop_obj']['tmp_name'], ".tmp/$filedrop_dir/$filedrop_box/$filedrop_nom");
- unlink($_FILES['filedrop_obj']['tmp_name']);
- echo "<script>alert(\"{$_FILES['filedrop_obj']['name']} saved as $filedrop_nom\");</script>";
- }
- else {
- unlink($_FILES['filedrop_obj']['tmp_name']);
- }
- }
- else {
- unlink($_FILES['filedrop_obj']['tmp_name']);
- echo "<script>alert(\"Failed to save {$_FILES['filedrop_obj']['name']} because it is too big.\");</script>";
- }
- }
- else {
- unlink($_FILES['filedrop_obj']['tmp_name']);
- }
- }
- ?>
- <script>
- parent.top.document.getElementById('filedrop_wait').innerHTML = '';
- parent.top.document.filedrop_form.filedrop_submit.disabled=false;
- </script>