From ca62db1d528009f166bc512e60681b73d531d860 Mon Sep 17 00:00:00 2001 From: nuxsmin Date: Mon, 28 Oct 2013 11:56:31 +0100 Subject: [PATCH] Fix error while uploading/deleting files Security token wasn't submitted --- js/functions.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/functions.js b/js/functions.js index b71a6ec1..48f3464a 100644 --- a/js/functions.js +++ b/js/functions.js @@ -492,13 +492,14 @@ function delFile(id){ $.fancybox.showLoading(); - var data = {fileId: $("#files").val(), action: 'delete'}; + var sk = $('input:[name=sk]').val(); + var data = {'fileId': $("#files").val(), 'action': 'delete', 'sk' : sk}; $.post( APP_ROOT + '/ajax/ajax_files.php', data, function( data ) { $.fancybox.hideLoading(); resMsg("ok", data); - $("#downFiles").load( APP_ROOT + "/ajax/ajax_getFiles.php?id=" + id +"&del=1&is_ajax=1"); + $("#downFiles").load( APP_ROOT + "/ajax/ajax_getFiles.php?id=" + id +"&del=1&is_ajax=1&sk=" + sk); } ); } @@ -515,7 +516,8 @@ function upldFile(id){ }, success: function(responseText, statusText, xhr, $form){ resMsg("ok", responseText); - $("#downFiles").load( APP_ROOT + "/ajax/ajax_getFiles.php?id=" + id +"&del=1&is_ajax=1"); + var sk = $('input:[name=sk]').val(); + $("#downFiles").load( APP_ROOT + "/ajax/ajax_getFiles.php?id=" + id +"&del=1&is_ajax=1&sk=" + sk); $.fancybox.hideLoading(); }, error:function(jqXHR, textStatus, errorThrown){ @@ -978,4 +980,4 @@ function resMsg(type, txt, url, action){ this.element.show(); } }); -})( jQuery ); \ No newline at end of file +})( jQuery );