X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgeocode.php;h=9e208914c16ca088cf63cd7f08c43e07eb83cefc;hb=06f60b57c10c37fe6114ff09949b187e4cb2c964;hp=9671d2c2769f4feb615688dadf37634e1c06d3d0;hpb=fdb64eed2f1d24ad38fe4a6bc680e3592647c0a6;p=quix0rs-gnu-social.git diff --git a/actions/geocode.php b/actions/geocode.php index 9671d2c276..9e208914c1 100644 --- a/actions/geocode.php +++ b/actions/geocode.php @@ -37,27 +37,28 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @category Action * @package StatusNet * @author Craig Andrews + * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://status.net/ */ class GeocodeAction extends Action { + var $lat = null; + var $lon = null; + var $location = null; + function prepare($args) { parent::prepare($args); $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { + // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token. '. 'Try again, please.')); } $this->lat = $this->trimmed('lat'); $this->lon = $this->trimmed('lon'); - $location = Location::fromLatLon($this->lat, $this->lon); - if ($location) { - $this->location = Location::fromId($location->location_id, $location->location_ns); - $this->lat = $this->location->lat; - $this->lon = $this->location->lon; - } + $this->location = Location::fromLatLon($this->lat, $this->lon); return true; } @@ -68,7 +69,7 @@ class GeocodeAction extends Action * * @return nothing * - **/ + */ function handle($args) { header('Content-Type: application/json; charset=utf-8'); @@ -89,10 +90,8 @@ class GeocodeAction extends Action * * @return boolean true */ - function isReadOnly($args) { return true; } } -?>