Drupal: preveri drzavo glede na IP
This commit is contained in:
parent
0143cef84e
commit
ebed86c30f
@ -6,6 +6,7 @@
|
||||
**/
|
||||
|
||||
|
||||
use
|
||||
// Nastavimo url api-ja
|
||||
$api_url = 'http://localhost/frontend/payments/api.php';
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Class ki vsebuje funkcije APIJA za narocila (oddaj narocilo, izvedi placilo...)
|
||||
@ -345,7 +346,10 @@ class ApiNarocilaController{
|
||||
global $site_path;
|
||||
|
||||
$reader = new Reader($site_path.'admin/survey/modules/mod_geoIP/db/GeoLite2-City.mmdb');
|
||||
$this->response['drzava'] = $reader->country($this->data['ip']);
|
||||
$podatki = $reader->city($this->data['ip']);
|
||||
|
||||
// Vrnemo ime države
|
||||
$this->response['drzava'] = $podatki->country->name;
|
||||
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user