mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
do not check for named formtoken in op/op.Ajax.php anymore, use new statusbox-container for last file uploads
This commit is contained in:
parent
ee732551c6
commit
3471835d0a
|
@ -265,7 +265,7 @@ switch($command) {
|
||||||
|
|
||||||
case 'movefolder': /* {{{ */
|
case 'movefolder': /* {{{ */
|
||||||
if($user) {
|
if($user) {
|
||||||
if(!checkFormKey('movefolder', 'GET')) {
|
if(!checkFormKey('', 'GET')) {
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
||||||
} else {
|
} else {
|
||||||
|
@ -304,7 +304,7 @@ switch($command) {
|
||||||
|
|
||||||
case 'movedocument': /* {{{ */
|
case 'movedocument': /* {{{ */
|
||||||
if($user) {
|
if($user) {
|
||||||
if(!checkFormKey('movedocument', 'GET')) {
|
if(!checkFormKey('', 'GET')) {
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
||||||
} else {
|
} else {
|
||||||
|
@ -343,7 +343,7 @@ switch($command) {
|
||||||
|
|
||||||
case 'transfercontent': /* {{{ */
|
case 'transfercontent': /* {{{ */
|
||||||
if($user) {
|
if($user) {
|
||||||
if(!checkFormKey('movedocument', 'GET')) {
|
if(!checkFormKey('', 'GET')) {
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
||||||
} else {
|
} else {
|
||||||
|
@ -394,7 +394,7 @@ switch($command) {
|
||||||
|
|
||||||
case 'linkdocument': /* {{{ */
|
case 'linkdocument': /* {{{ */
|
||||||
if($user) {
|
if($user) {
|
||||||
if(!checkFormKey('movedocument', 'GET')) {
|
if(!checkFormKey('', 'GET')) {
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
||||||
} else {
|
} else {
|
||||||
|
@ -607,7 +607,7 @@ switch($command) {
|
||||||
|
|
||||||
case 'uploaddocument': /* {{{ */
|
case 'uploaddocument': /* {{{ */
|
||||||
if($user) {
|
if($user) {
|
||||||
if(checkFormKey('adddocument')) {
|
if(checkFormKey('')) {
|
||||||
if (!isset($_POST["folderid"]) || !is_numeric($_POST["folderid"]) || intval($_POST["folderid"])<1) {
|
if (!isset($_POST["folderid"]) || !is_numeric($_POST["folderid"]) || intval($_POST["folderid"])<1) {
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode(array('success'=>false, 'message'=>getMLText("invalid_folder_id")));
|
echo json_encode(array('success'=>false, 'message'=>getMLText("invalid_folder_id")));
|
||||||
|
|
|
@ -661,6 +661,7 @@ function onAddClipboard(ev) { /* {{{ */
|
||||||
fd.append('command', 'uploaddocument');
|
fd.append('command', 'uploaddocument');
|
||||||
// fd.append('path', files[i].webkitRelativePath);
|
// fd.append('path', files[i].webkitRelativePath);
|
||||||
|
|
||||||
|
statusbar.parent().show();
|
||||||
var status = new createStatusbar(statusbar);
|
var status = new createStatusbar(statusbar);
|
||||||
status.setFileNameSize(files[i].name,files[i].size);
|
status.setFileNameSize(files[i].name,files[i].size);
|
||||||
sendFileToServer(fd,status);
|
sendFileToServer(fd,status);
|
||||||
|
@ -725,7 +726,7 @@ $(document).ready(function() { /* {{{ */
|
||||||
var files = e.originalEvent.dataTransfer.files;
|
var files = e.originalEvent.dataTransfer.files;
|
||||||
|
|
||||||
//We need to send dropped files to Server
|
//We need to send dropped files to Server
|
||||||
SeedDMSUpload.handleFileUpload(files,obj,obj);
|
SeedDMSUpload.handleFileUpload(files,obj, obj);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('dragenter', '.droptarget', function (e) {
|
$(document).on('dragenter', '.droptarget', function (e) {
|
||||||
|
@ -753,7 +754,7 @@ $(document).ready(function() { /* {{{ */
|
||||||
var files = e.originalEvent.dataTransfer.files;
|
var files = e.originalEvent.dataTransfer.files;
|
||||||
if(files.length > 0) {
|
if(files.length > 0) {
|
||||||
console.log('Drop '+files.length+' files on '+target_type+' '+target_id);
|
console.log('Drop '+files.length+' files on '+target_type+' '+target_id);
|
||||||
SeedDMSUpload.handleFileUpload(files,$(e.currentTarget),$(e.currentTarget).find("span"));
|
SeedDMSUpload.handleFileUpload(files,$(e.currentTarget),$('div.statusbar-container h1')/*$(e.currentTarget).find("span")*/);
|
||||||
} else {
|
} else {
|
||||||
var source_info = JSON.parse(e.originalEvent.dataTransfer.getData("text"));
|
var source_info = JSON.parse(e.originalEvent.dataTransfer.getData("text"));
|
||||||
source_type = source_info.type;
|
source_type = source_info.type;
|
||||||
|
@ -848,7 +849,7 @@ $(document).ready(function() { /* {{{ */
|
||||||
var files = e.originalEvent.dataTransfer.files;
|
var files = e.originalEvent.dataTransfer.files;
|
||||||
if(files.length > 0) {
|
if(files.length > 0) {
|
||||||
console.log('Drop '+files.length+' files on '+target_type+' '+target_id);
|
console.log('Drop '+files.length+' files on '+target_type+' '+target_id);
|
||||||
SeedDMSUpload.handleFileUpload(files,$(e.currentTarget),$(e.currentTarget).find("span"));
|
SeedDMSUpload.handleFileUpload(files,$(e.currentTarget),$('div.statusbar-container h1')/*$(e.currentTarget).find("span")*/);
|
||||||
} else {
|
} else {
|
||||||
var source_info = JSON.parse(e.originalEvent.dataTransfer.getData("text"));
|
var source_info = JSON.parse(e.originalEvent.dataTransfer.getData("text"));
|
||||||
source_type = source_info.type;
|
source_type = source_info.type;
|
||||||
|
|
|
@ -390,7 +390,7 @@ $('#loadmore').click(function(e) {
|
||||||
// $this->addFooterJS("SeedDMSUpload.setMaxFileSize(".SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize")).");");
|
// $this->addFooterJS("SeedDMSUpload.setMaxFileSize(".SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize")).");");
|
||||||
// $this->addFooterJS("SeedDMSUpload.setMaxFileSizeMsg('".getMLText("uploading_maxsize")."');");
|
// $this->addFooterJS("SeedDMSUpload.setMaxFileSizeMsg('".getMLText("uploading_maxsize")."');");
|
||||||
?>
|
?>
|
||||||
<div id="dragandrophandler" class="well alert" data-droptarget="folder_<?php echo $folder->getID(); ?>" data-target="<?php echo $folder->getID(); ?>" data-uploadformtoken="<?php echo createFormKey('adddocument'); ?>"><?php printMLText('drop_files_here'); ?></div>
|
<div id="dragandrophandler" class="well alert" data-droptarget="folder_<?php echo $folder->getID(); ?>" data-target="<?php echo $folder->getID(); ?>" data-uploadformtoken="<?php echo createFormKey(''); ?>"><?php printMLText('drop_files_here'); ?></div>
|
||||||
<?php
|
<?php
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user