Tasks: Use POST for ajax calls that change data

This commit is contained in:
Bart Visscher 2012-06-09 14:32:51 +02:00
parent 014895aeab
commit 4aee5a7ce4
3 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ $calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
$first_calendar = reset($calendars);
$cid = $first_calendar['id'];
$input = $_GET['text'];
$input = $_POST['text'];
$request = array();
$request['summary'] = $input;
$request["categories"] = null;

View file

@ -24,7 +24,7 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('tasks');
$id = $_GET['id'];
$id = $_POST['id'];
$task = OC_Calendar_App::getEventObject( $id );
OC_Calendar_Object::delete($id);

View file

@ -440,7 +440,7 @@ $(document).ready(function(){
$('#tasks_delete').live('click',function(){
var id = $('#task_details').data('id');
$.getJSON('ajax/delete.php',{'id':id},function(jsondata){
$.post('ajax/delete.php',{'id':id},function(jsondata){
if(jsondata.status == 'success'){
$('#tasks [data-id="'+jsondata.data.id+'"]').remove();
$('#task_details').data('id','');
@ -455,7 +455,7 @@ $(document).ready(function(){
$('#tasks_addtask').click(function(){
var input = $('#tasks_newtask').val();
$.getJSON(OC.filePath('tasks', 'ajax', 'addtask.php'),{text:input},function(jsondata){
$.post(OC.filePath('tasks', 'ajax', 'addtask.php'),{text:input},function(jsondata){
if(jsondata.status == 'success'){
$('#tasks_list').append(OC.Tasks.create_task_div(jsondata.task));
}