diff --git a/index.php b/index.php index ac3b49c..91ec823 100644 --- a/index.php +++ b/index.php @@ -6,9 +6,15 @@ Copyright John Campbell (jcampbell1) Liscense: MIT ********************************/ +//Disable error report for undefined superglobals +error_reporting( error_reporting() & ~E_NOTICE ); + // Set to false to disable delete button and delete POST request. + $allow_delete = true; -$allow_create_folder= true; +$allow_create_folder = true; +$allow_upload = true; + /* Uncomment section below, if you want a trivial password protection */ @@ -87,7 +93,7 @@ if($_GET['do'] == 'list') { chdir($file); @mkdir($_POST['name']); exit; -} elseif ($_POST['do'] == 'upload') { +} elseif ($_POST['do'] == 'upload' && $allow_upload == true) { var_dump($_POST); var_dump($_FILES); var_dump($_FILES['file_data']['tmp_name']); @@ -261,7 +267,7 @@ $(function(){ $dir.val(''); return false; }); - + // file upload stuff $('#file_drop_target').bind('dragover',function(){ $(this).addClass('drag_over'); @@ -327,7 +333,7 @@ $(function(){ .append( $('').html(' file size - ' + formatFileSize(file.size) + '' +' exceeds max upload size of ' + formatFileSize(MAX_UPLOAD_SIZE) + '') ); } - + function list() { var hashval = window.location.hash.substr(1); $.get('?',{'do':'list','file':hashval},function(data) { @@ -401,12 +407,17 @@ $(function(){ + + + +