Location: PHPKode > projects > injooosm > components/com_injooosm/controllers/geo.php
<?php
/**
 * Joomla! 1.5 component injooosm
 *
 * @version $Id: geo.php 2010-02-05 22:04:00$
 * @author Christian Knorr
 * @package injooosm
 * @subpackage frontend
 * @license GNU/GPL
 * @filesource
 *
 */
class InjooosmControllerGeo extends InjooosmController  {

	function __construct()
	{
		parent::__construct();
	}

	function save() {
		$user = JFactory::getUser();
		$userid = (int)$user->id;
		JRequest::checkToken() or jexit( 'Invalid Token' );
		$lat =& JRequest::getVar('lat');
		$lon =& JRequest::getVar('lon');
		$visible =& JRequest::getVar('visible');
		global $mainframe;
		$query = "UPDATE #__users SET ".
			"osmlat='".$lat."',".
			"osmlon='".$lon."',".
			"osmvisible='".$visible."' ".
			"WHERE id='".$userid."'";
		$db = JFactory::getDBO();
		$db->setQuery($query);
		$db->query();
		if ($db->getErrorNum()) {
			JError::raiseWarning(0,JText::_('OSM_DATABASE_ERROR_H') );
			echo JText::_('OSM_DATABASE_ERROR')."<br /><br />\n".$db->stderr();
			return false;
		} else {
			$this->setRedirect( JRoute::_('index.php?option=com_injooosm&view=injooosm&layout=geo'), false );
			return true;
		}
	}
}
Return current item: injooosm