Add location support for femanager
The model of femanager should contain "location". This was a function in ajaxlogin:
`/**
* @return array
*/
protected function getLocationDataByIp()
{
$data = file_get_contents('http://geoip.nekudo.com/api/' . $_SERVER['REMOTE_ADDR']);
if ($data !== false) {
data = json_decode(
data, true);
return $data;
}
return array();
}
`
and
`$locationData = $this->getLocationDataByIp(); if (!empty($locationData)) { if (isset($locationData['error'])) { $mapsLink = 'Location could not retrieved.'; } else {
if (isset($locationData['country']['name'])) {
$mapsLink = $locationData['country']['name'];
$user->setCountry($locationData['country']['name']);
}
if (isset($locationData['city']) && $locationData['city']) {
$mapsLink .= ', ' . $locationData['city'];
$user->setCity($locationData['city']);
}
}
}`