root/trunk/wifidog-auth/wifidog/geocoder.php @ 1409

Revision 1409, 3.1 KB (checked in by networkfusion, 4 years ago)

* Addded New Geocoders Yahoo and Google.
* Geocoder now defaults to google if no country specific
Geocoder is found (in future, this will be made selectable by network)
* Fixed Postcode search on Find Hotspot Map #436
* Added search for user by email closes #417
* Added validation to networkID to stop database errors, closes
#458

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[769]1<?php
[866]2
3/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5// +-------------------------------------------------------------------+
6// | WiFiDog Authentication Server                                     |
7// | =============================                                     |
8// |                                                                   |
9// | The WiFiDog Authentication Server is part of the WiFiDog captive  |
10// | portal suite.                                                     |
11// +-------------------------------------------------------------------+
12// | PHP version 5 required.                                           |
13// +-------------------------------------------------------------------+
14// | Homepage:     http://www.wifidog.org/                             |
15// | Source Forge: http://sourceforge.net/projects/wifidog/            |
16// +-------------------------------------------------------------------+
17// | This program is free software; you can redistribute it and/or     |
18// | modify it under the terms of the GNU General Public License as    |
19// | published by the Free Software Foundation; either version 2 of    |
20// | the License, or (at your option) any later version.               |
21// |                                                                   |
22// | This program is distributed in the hope that it will be useful,   |
23// | but WITHOUT ANY WARRANTY; without even the implied warranty of    |
24// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     |
25// | GNU General Public License for more details.                      |
26// |                                                                   |
27// | You should have received a copy of the GNU General Public License |
28// | along with this program; if not, contact:                         |
29// |                                                                   |
30// | Free Software Foundation           Voice:  +1-617-542-5942        |
31// | 59 Temple Place - Suite 330        Fax:    +1-617-542-2652        |
32// | Boston, MA  02111-1307,  USA       gnu@gnu.org                    |
33// |                                                                   |
34// +-------------------------------------------------------------------+
35
36/**
[769]37 * Geocoding service
[866]38 *
39 * @package    WiFiDogAuthServer
40 * @author     Francois Proulx <francois.proulx@gmail.com>
[916]41 * @copyright  2005-2006 Francois Proulx, Technologies Coeus inc.
42 * @version    Subversion $Id$
43 * @link       http://www.wifidog.org/
[769]44 */
[866]45
[916]46/**
47 * Load required files
48 */
[874]49require_once(dirname(__FILE__) . '/include/common.php');
[866]50
[874]51require_once('classes/AbstractGeocoder.php');
52
[769]53header("Content-Type: text/xml");
[866]54
[769]55if(!empty($_REQUEST["postal_code"]))
56{
[1409]57    $geocoder = AbstractGeocoder::getGeocoder("Earth");
[866]58    $geocoder->setPostalCode($_REQUEST["postal_code"]);
59    $long = $geocoder->getLongitude();
60    $lat = $geocoder->getLatitude();
61    echo "<geo><lat>{$lat}</lat><long>{$long}</long></geo>";
[769]62}
63else
[866]64    echo "<geo></geo>";
65
66/*
67 * Local variables:
68 * tab-width: 4
69 * c-basic-offset: 4
70 * c-hanging-comment-ender-p: nil
71 * End:
72 */
73
[1409]74?>
Note: See TracBrowser for help on using the browser.