mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Fix city setter on user_adapter
This commit is contained in:
@@ -771,12 +771,13 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
|
|
||||||
public function set_geonameid($geonameid)
|
public function set_geonameid($geonameid)
|
||||||
{
|
{
|
||||||
$country_code = null;
|
$country_code = $city = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$country = $this->app['geonames.connector']
|
$data = $this->app['geonames.connector']
|
||||||
->geoname($this->geonameid)
|
->geoname($geonameid);
|
||||||
->get('country');
|
$country = $data->get('country');
|
||||||
|
$city = $data->get('name');
|
||||||
|
|
||||||
if (isset($country['code'])) {
|
if (isset($country['code'])) {
|
||||||
$country_code = $country['code'];
|
$country_code = $country['code'];
|
||||||
@@ -785,12 +786,13 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE usr SET geonameid = :geonameid, pays=:country_code WHERE usr_id = :usr_id';
|
$sql = 'UPDATE usr SET geonameid = :geonameid, pays=:country_code, ville = :city WHERE usr_id = :usr_id';
|
||||||
|
|
||||||
$datas = array(
|
$datas = array(
|
||||||
':geonameid' => $geonameid,
|
':geonameid' => $geonameid,
|
||||||
':usr_id' => $this->get_id(),
|
':usr_id' => $this->get_id(),
|
||||||
':country_code' => $country_code
|
':country_code' => $country_code,
|
||||||
|
':city' => $city,
|
||||||
);
|
);
|
||||||
|
|
||||||
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
@@ -798,6 +800,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
$this->geonameid = $geonameid;
|
$this->geonameid = $geonameid;
|
||||||
$this->country = $country_code;
|
$this->country = $country_code;
|
||||||
|
$this->city = $city;
|
||||||
$this->delete_data_from_cache();
|
$this->delete_data_from_cache();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Reference in New Issue
Block a user