Update geotag ajax action to properly accept POST only
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 9 Nov 2009 17:01:31 +0000 (12:01 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 9 Nov 2009 17:01:31 +0000 (12:01 -0500)
ansel/js/googlemap_edit.js
ansel/lib/Ajax/Imple/ImageSaveGeotag.php

index 8a8ddf3..423c39e 100644 (file)
@@ -76,14 +76,8 @@ Ansel_MapEdit.prototype = {
     handleSave: function(id)
     {
         var o = this._options;
-        params = {
-            img: id,
-            lat: this._map.points[0].getLatLng().lat(),
-            lng: this._map.points[0].getLatLng().lng(),
-            type: 'geotag'
-        };
-
-        new Ajax.Request(o.xurl, {
+        var params = { "values": "img=" + id + "/lat=" + this._map.points[0].getLatLng().lat() + "/lng=" + this._map.points[0].getLatLng().lng() };
+        new Ajax.Request(o.xurl + "/action=geotag/post=values", {
             method: 'post',
             parameters: params,
             onComplete: function(transport) {
index bce0d16..dd86d2e 100644 (file)
@@ -25,12 +25,11 @@ class Ansel_Ajax_Imple_ImageSaveGeotag extends Horde_Ajax_Imple_Base
     {
         include_once dirname(__FILE__) . '/../../base.php';
 
-        /* Require type, location, img to be from POST */
-        $type = Horde_Util::getPost('type');
-        $location = Horde_Util::getPost('location');
-        $img = Horde_Util::getPost('img');
-        $lat = Horde_Util::getPost('lat');
-        $lng = Horde_Util::getPost('lng');
+        $type = $args['action'];
+        $location = empty($post['location']) ? '' : $post['location'];
+        $img = $post['img'];
+        $lat = $post['lat'];
+        $lng = $post['lng'];
 
         if (empty($img) ||
             ($type == 'location' && empty($location)) ||