]> source.dussan.org Git - nextcloud-server.git/commitdiff
make use of post instead of get
authorGeorg Ehrke <dev@georgswebsite.de>
Sat, 9 Jun 2012 12:40:15 +0000 (14:40 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Sat, 9 Jun 2012 12:41:26 +0000 (14:41 +0200)
13 files changed:
apps/calendar/ajax/calendar/edit.form.php
apps/calendar/ajax/changeview.php
apps/calendar/ajax/event/edit.form.php
apps/calendar/ajax/import/import.php
apps/calendar/ajax/settings/guesstimezone.php
apps/calendar/ajax/share/activation.php
apps/calendar/ajax/share/changepermission.php
apps/calendar/ajax/share/dropdown.php
apps/calendar/ajax/share/share.php
apps/calendar/ajax/share/unshare.php
apps/calendar/js/calendar.js
apps/calendar/js/geo.js
apps/calendar/js/loader.js

index 77366809311ced6709508d3b0f0372eaccf2fc16..036ed12bb74309a49ba13a7dff67aed8b05d7851 100644 (file)
@@ -11,7 +11,7 @@ OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('calendar');
 
 $calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
-$calendar = OC_Calendar_App::getCalendar($_GET['calendarid']);
+$calendar = OC_Calendar_App::getCalendar($_POST['calendarid']);
 $tmpl = new OCP\Template("calendar", "part.editcalendar");
 $tmpl->assign('new', false);
 $tmpl->assign('calendarcolor_options', $calendarcolor_options);
index 2c2d09ccb1294b2e5445538e7b16b67acfcfc1fe..0099fd5ec216c4522964d5fd361c4ce28ea64e31 100644 (file)
@@ -7,7 +7,7 @@
  */
 OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('calendar');
-$view = $_GET['v'];
+$view = $_POST['v'];
 switch($view){
        case 'agendaWeek':
        case 'month';
index f2ea84dd205f30641aeeba24dc207f4c53fc9e57..dbb78edb798f9e3a2419f52c0f687d520158ec1d 100644 (file)
@@ -13,7 +13,7 @@ if(!OCP\User::isLoggedIn()) {
 }
 OCP\JSON::checkAppEnabled('calendar');
 
-$id = $_GET['id'];
+$id = $_POST['id'];
 $data = OC_Calendar_App::getEventObject($id, true, true);
 
 if(!$data){
index a3eaed844a14737d3871e44efc289b93d73961bf..6fdad12c085f20ef52994a55ee404593b6b493e6 100644 (file)
@@ -16,9 +16,9 @@ $nl="\r\n";
 $comps = array('VEVENT'=>true, 'VTODO'=>true, 'VJOURNAL'=>true);
 
 global $progresskey;
-$progresskey = 'calendar.import-' . $_GET['progresskey'];
+$progresskey = 'calendar.import-' . $_POST['progresskey'];
 
-if (isset($_GET['progress']) && $_GET['progress']) {
+if (isset($_POST['progress']) && $_POST['progress']) {
        echo OC_Cache::get($progresskey);
        die;
 }
index 13092777b78bdf54c9dc92850dfbb4a4b6dd7b2a..f36f3bf061ff919629b72ae90ceea27459273c94 100644 (file)
@@ -12,8 +12,8 @@ OCP\JSON::checkAppEnabled('calendar');
 
 $l = OC_L10N::get('calendar');
 
-$lat = $_GET['lat'];
-$lng = $_GET['long'];
+$lat = $_POST['lat'];
+$lng = $_POST['lng'];
 
 $timezone =  OC_Geo::timezone($lat, $lng);
 
index 7d6b8fcb16ec2daf6c478ac5e19bac077b362d97..bce8693577bace086e2d856050b22a9f6b994bf6 100644 (file)
@@ -5,7 +5,7 @@
  * later.
  * See the COPYING-README file.
  */
-$id = strip_tags($_GET['id']);
-$activation = strip_tags($_GET['activation']);
+$id = strip_tags($_POST['id']);
+$activation = strip_tags($_POST['activation']);
 OC_Calendar_Share::set_active(OCP\USER::getUser(), $id, $activation);
 OCP\JSON::success();
index 2737420c94ede4c2717f8008cd163c040d401242..e807c164a236926b3a66fc2513cafae661a3c523 100644 (file)
@@ -6,9 +6,9 @@
  * See the COPYING-README file.
  */
  
-$id = strip_tags($_GET['id']);
-$idtype = strip_tags($_GET['idtype']);
-$permission = (int) strip_tags($_GET['permission']);
+$id = strip_tags($_POST['id']);
+$idtype = strip_tags($_POST['idtype']);
+$permission = (int) strip_tags($_POST['permission']);
 switch($idtype){
        case 'calendar':
        case 'event':
@@ -25,8 +25,8 @@ if($idtype == 'event' && !OC_Calendar_App::getEventObject($id)){
        OCP\JSON::error(array('message'=>'permission denied'));
        exit;
 }
-$sharewith = $_GET['sharewith'];
-$sharetype = strip_tags($_GET['sharetype']);
+$sharewith = $_POST['sharewith'];
+$sharetype = strip_tags($_POST['sharetype']);
 switch($sharetype){
        case 'user':
        case 'group':
index a3b0faca4bf171341e9f49a89dce7373d52d577d..86cf4ac090eada40d76242f0792dfb1d10af7ced 100644 (file)
@@ -7,7 +7,7 @@
  */
  
 $user = OCP\USER::getUser();
-$calid = $_GET['calid'];
+$calid = $_POST['calid'];
 $calendar = OC_Calendar_Calendar::find($calid);
 if($calendar['userid'] != $user){
        OCP\JSON::error();
index 629a7b6b79fb217d7c9b6ca1224303162ba4e1d3..838db619f62c55d36bed3cfe1ee87d6b959109f3 100644 (file)
@@ -6,8 +6,8 @@
  * See the COPYING-README file.
  */
  
-$id = strip_tags($_GET['id']);
-$idtype = strip_tags($_GET['idtype']);
+$id = strip_tags($_POST['id']);
+$idtype = strip_tags($_POST['idtype']);
 switch($idtype){
        case 'calendar':
        case 'event':
@@ -24,8 +24,8 @@ if($idtype == 'event' && !OC_Calendar_App::getEventObject($id)){
        OCP\JSON::error(array('message'=>'permission denied'));
        exit;
 }
-$sharewith = $_GET['sharewith'];
-$sharetype = strip_tags($_GET['sharetype']);
+$sharewith = $_POST['sharewith'];
+$sharetype = strip_tags($_POST['sharetype']);
 switch($sharetype){
        case 'user':
        case 'group':
index fe7c98452d7e14528dd4d9532944d1ee51350756..1ce04677fb13c3c1bf37f2ec0f8240b099b3c883 100644 (file)
@@ -6,8 +6,8 @@
  * See the COPYING-README file.
  */
  
-$id = strip_tags($_GET['id']);
-$idtype = strip_tags($_GET['idtype']);
+$id = strip_tags($_POST['id']);
+$idtype = strip_tags($_POST['idtype']);
 switch($idtype){
        case 'calendar':
        case 'event':
@@ -24,8 +24,8 @@ if($idtype == 'event' && !OC_Calendar_App::getEventObject($id)){
        OCP\JSON::error(array('message'=>'permission denied'));
        exit;
 }
-$sharewith = $_GET['sharewith'];
-$sharetype = strip_tags($_GET['sharetype']);
+$sharewith = $_POST['sharewith'];
+$sharetype = strip_tags($_POST['sharetype']);
 switch($sharetype){
        case 'user':
        case 'group':
index b5411d3fd95d087ca5cec70333d9637db5990441..f869fcf2ad2b44492b2a631811d3fef3fb2ede6c 100644 (file)
@@ -77,7 +77,7 @@ Calendar={
                                $('#event').dialog('destroy').remove();
                        }else{
                                Calendar.UI.loading(true);
-                               $('#dialog_holder').load(OC.filePath('calendar', 'ajax/event', 'edit.form.php') + '?id=' + id, Calendar.UI.startEventDialog);
+                               $('#dialog_holder').load(OC.filePath('calendar', 'ajax/event', 'edit.form.php'), {id: id}, Calendar.UI.startEventDialog);
                        }
                },
                submitDeleteEventForm:function(url){
@@ -413,7 +413,7 @@ Calendar={
                        },
                        edit:function(object, calendarid){
                                var tr = $(document.createElement('tr'))
-                                       .load(OC.filePath('calendar', 'ajax/calendar', 'edit.form.php') + "?calendarid="+calendarid,
+                                       .load(OC.filePath('calendar', 'ajax/calendar', 'edit.form.php'), {calendarid: calendarid},
                                                function(){Calendar.UI.Calendar.colorPicker(this)});
                                $(object).closest('tr').after(tr).hide();
                        },
@@ -502,14 +502,14 @@ Calendar={
                        currentid: 'false',
                        idtype: '',
                        activation:function(object,owner,id){
-                               $.getJSON(OC.filePath('calendar', 'ajax/share', 'activation.php'),{id:id, idtype:'calendar', activation:object.checked?1:0});
+                               $.post(OC.filePath('calendar', 'ajax/share', 'activation.php'),{id:id, idtype:'calendar', activation:object.checked?1:0});
                                $('#calendar_holder').fullCalendar('refetchEvents');
                        },
                        dropdown:function(userid, calid){
                                $('.calendar_share_dropdown').remove();
                                var element = document.getElementById(userid+'_'+calid);
                                $('<div class="calendar_share_dropdown"></div>').appendTo(element);
-                               $.get(OC.filePath('calendar', 'ajax/share', 'dropdown.php') + '?calid=' + calid, function(data){
+                               $.post(OC.filePath('calendar', 'ajax/share', 'dropdown.php'), {calid: calid}, function(data){
                                        $('.calendar_share_dropdown').html(data);
                                        $('.calendar_share_dropdown').show('blind');
                                        $('#share_user').chosen();
@@ -519,7 +519,7 @@ Calendar={
                                Calendar.UI.Share.idtype = 'calendar';
                        },
                        share:function(id, idtype, sharewith, sharetype){
-                               $.getJSON(OC.filePath('calendar', 'ajax/share', 'share.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(data){
+                               $.post(OC.filePath('calendar', 'ajax/share', 'share.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(data){
                                        if(sharetype == 'public'){
                                                $('#public_token').val(parent.location.protocol+'//'+location.host+OC.linkTo('', 'public.php')+'?service=calendar&t='+data.message);
                                                $('#public_token').css('display', 'block');
@@ -527,7 +527,7 @@ Calendar={
                                });
                        },
                        unshare:function(id, idtype, sharewith, sharetype){
-                               $.getJSON(OC.filePath('calendar', 'ajax/share', 'unshare.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(){
+                               $.post(OC.filePath('calendar', 'ajax/share', 'unshare.php'),{id:id, idtype:idtype, sharewith:sharewith, sharetype:sharetype}, function(){
                                        if(sharetype == 'public'){
                                                $('#public_token').val('');
                                                $('#public_token').css('display', 'none');
@@ -535,7 +535,7 @@ Calendar={
                                });
                        },
                        changepermission:function(id, idtype, sharewith, sharetype, permission){
-                               $.getJSON(OC.filePath('calendar', 'ajax/share', 'changepermission.php'),{id:id, idtype:idtype, sharewith: sharewith, sharetype:sharetype, permission: (permission?1:0)});
+                               $.post(OC.filePath('calendar', 'ajax/share', 'changepermission.php'),{id:id, idtype:idtype, sharewith: sharewith, sharetype:sharetype, permission: (permission?1:0)});
                        },
                        init:function(){
                                $('.calendar_share_dropdown').live('mouseleave', function(){
@@ -846,7 +846,7 @@ $(document).ready(function(){
                viewDisplay: function(view) {
                        $('#datecontrol_date').html(view.title);
                        if (view.name != defaultView) {
-                               $.get(OC.filePath('calendar', 'ajax', 'changeview.php') + "?v="+view.name);
+                               $.post(OC.filePath('calendar', 'ajax', 'changeview.php'), {v:view.name});
                                defaultView = view.name;
                        }
                        Calendar.UI.setViewActive(view.name);
index 092d8547469ac32caea9f26df70435a8772e15ca..99290d940e3c5ac10e2b859f133d1d74c1dd099d 100644 (file)
@@ -6,7 +6,7 @@
  */
 if (navigator.geolocation) { 
        navigator.geolocation.getCurrentPosition(function(position) {
-               $.getJSON(OC.filePath('calendar', 'ajax/settings', 'guesstimezone.php') + '?lat=' + position.coords.latitude + '&long=' + position.coords.longitude,
+               $.post(OC.filePath('calendar', 'ajax/settings', 'guesstimezone.php'), {lat: position.coords.latitude, lng: position.coords.longitude},
                function(data){
                        if (data.status == 'success' && typeof(data.message) != 'undefined'){
                                $('#notification').html(data.message);
index 838521ec7f55253cb7a818f28973f6cb0c3b164d..0fc5018e89c55b7b6b9833bb6aa4c8658fefae77 100644 (file)
@@ -63,7 +63,7 @@ Calendar_Import={
                });
        },
        getimportstatus: function(progresskey){
-               $.get(OC.filePath('calendar', 'ajax/import', 'import.php') + '?progress=1&progresskey=' + progresskey, function(percent){
+               $.post(OC.filePath('calendar', 'ajax/import', 'import.php'), {progress:1,progresskey: progresskey}, function(percent){
                        $('#progressbar').progressbar('option', 'value', parseInt(percent));
                        if(percent < 100){
                                window.setTimeout('Calendar_Import.getimportstatus(\'' + progresskey + '\')', 500);