';
diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php
new file mode 100644
index 00000000000..21bd4f72bc8
--- /dev/null
+++ b/htdocs/admin/geoipmaxmind.php
@@ -0,0 +1,132 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * \file htdocs/admin/geoipmaxmind.php
+ * \ingroup geoipmaxmind
+ * \brief Setup page for geoipmaxmind module
+ * \version $Id$
+ */
+
+require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/dolgeoip.class.php");
+
+// Security check
+if (!$user->admin)
+accessforbidden();
+
+$langs->load("admin");
+$langs->load("errors");
+
+/*
+ * Actions
+ */
+if ($_POST["action"] == 'set')
+{
+ $error=0;
+ if (! empty($_POST["GEOIPMAXMIND_COUNTRY_DATAFILE"]) && ! file_exists($_POST["GEOIPMAXMIND_COUNTRY_DATAFILE"]))
+ {
+ $mesg='
';
diff --git a/htdocs/includes/modules/modGeoIPMaxmind.class.php b/htdocs/includes/modules/modGeoIPMaxmind.class.php
index 837455688be..b9866cee0ae 100644
--- a/htdocs/includes/modules/modGeoIPMaxmind.class.php
+++ b/htdocs/includes/modules/modGeoIPMaxmind.class.php
@@ -53,7 +53,7 @@ class modGeoIPMaxmind extends DolibarrModules
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "GeoIP Maxmind conversions capabilities";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
- $this->version = 'experimental';
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
@@ -67,7 +67,7 @@ class modGeoIPMaxmind extends DolibarrModules
$this->dirs = array("/geoipmaxmind");
// Config pages
- $this->config_page_url = array();
+ $this->config_page_url = array("geoipmaxmind.php");
// D�pendances
$this->depends = array();
diff --git a/htdocs/langs/ar_AR/errors.lang b/htdocs/langs/ar_AR/errors.lang
index f84b905cfeb..6cdc4e009d2 100644
--- a/htdocs/langs/ar_AR/errors.lang
+++ b/htdocs/langs/ar_AR/errors.lang
@@ -40,7 +40,7 @@ ErrorNoMailDefinedForThisUser=البريد لا يعرف لهذا المستخد
ErrorFeatureNeedJavascript=هذه الميزة تحتاج إلى تفعيل جافا سكريبت في العمل. هذا التغيير في البنية -- عرض.
ErrorTopMenuMustHaveAParentWithId0=وهناك قائمة من نوع 'توب' لا يمكن أن يكون أحد الوالدين القائمة. 0 وضعت في القائمة أو الأم في اختيار قائمة من نوع 'اليسار'.
ErrorLeftMenuMustHaveAParentId=وهناك قائمة من نوع 'اليسار' يجب أن يكون لها هوية الوالد.
-ErrorGenbarCodeNotfound=لم يتم العثور على الملف (باد الطريق الخطأ أو أذونات الوصول نفى المعلم openbasedir)
+ErrorFileNotFound=لم يتم العثور على الملف (باد الطريق الخطأ أو أذونات الوصول نفى المعلم openbasedir)
ErrorFunctionNotAvailableInPHP=ق ٪ وظيفة مطلوبة لهذه الميزة ولكن لا تتوافر في هذه النسخة / الإعداد للPHP.
ErrorDirAlreadyExists=دليل بهذا الاسم بالفعل.
ErrorFieldCanNotContainSpecialCharacters=ميدان ٪ ق يجب ألا يحتوي على أحرف خاصة.
diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang
index f1ffd4b2fff..08425d3fad8 100644
--- a/htdocs/langs/ca_ES/errors.lang
+++ b/htdocs/langs/ca_ES/errors.lang
@@ -33,7 +33,7 @@ ErrorNoMailDefinedForThisUser = E-Mail no definit per a aquest usuari
ErrorFeatureNeedJavascript = Aquesta funcionalitat requereix javascript actiu per funcionar. Modifiqueu en configuració->entorn.
ErrorTopMenuMustHaveAParentWithId0 = Un menú del tipus 'Superior' no pot tenir un menú pare. Poseu 0 en l'ID pare o busqueu un menu del tipus 'Esquerra'
ErrorLeftMenuMustHaveAParentId = Un menú del tipus 'Esquerra' ha de tenir un ID de pare
-ErrorGenbarCodeNotfound = Arxiu no trobat (ruta incorrecta, permisos incorrectes o accés prohibit pel paràmetre openbasedir)
+ErrorFileNotFound = Arxiu no trobat (ruta incorrecta, permisos incorrectes o accés prohibit pel paràmetre openbasedir)
ErrorFunctionNotAvailableInPHP = La funció %s és requerida per aquesta característica, però no es troba disponible en aquesta versió/instal·lació de PHP.
ErrorDirAlreadyExists = Ja existeix una carpeta amb aquest nom.
ErrorFieldCanNotContainSpecialCharacters = El camp %s no ha de contenir caràcters especials
diff --git a/htdocs/langs/da_DA/errors.lang b/htdocs/langs/da_DA/errors.lang
index 8d4de2ed807..6a8ff3510df 100644
--- a/htdocs/langs/da_DA/errors.lang
+++ b/htdocs/langs/da_DA/errors.lang
@@ -40,7 +40,7 @@ ErrorNoMailDefinedForThisUser=Nr. mail defineret for denne bruger
ErrorFeatureNeedJavascript=Denne funktion skal have Javascript skal aktiveres for at arbejde. Ændre dette i opsætningen - displayet.
ErrorTopMenuMustHaveAParentWithId0=En menu af type 'Top' kan ikke have en forælder menuen. Sæt 0 i moderselskabet menu eller vælge en menu af typen »Venstre«.
ErrorLeftMenuMustHaveAParentId=En menu af typen »Venstre« skal have en forælder id.
-ErrorGenbarCodeNotfound=Filen blev ikke fundet (Forkert sti, forkerte tilladelser eller adgang nægtet ved openbasedir parameter)
+ErrorFileNotFound=Filen blev ikke fundet (Forkert sti, forkerte tilladelser eller adgang nægtet ved openbasedir parameter)
ErrorFunctionNotAvailableInPHP=Funktion% s er påkrævet for denne funktion, men er ikke tilgængelig i denne version / opsætning af PHP.
ErrorDirAlreadyExists=En mappe med dette navn findes allerede.
ErrorFieldCanNotContainSpecialCharacters=Felt% s må ikke indeholder specialtegn.
diff --git a/htdocs/langs/de_DE/errors.lang b/htdocs/langs/de_DE/errors.lang
index 7448a8423fd..59504a106c6 100644
--- a/htdocs/langs/de_DE/errors.lang
+++ b/htdocs/langs/de_DE/errors.lang
@@ -38,7 +38,7 @@ ErrorNoMailDefinedForThisUser=Keine Mail, die für dieses Benutzers
ErrorFeatureNeedJavascript=Diese Funktion muss JavaScript aktiviert werden zu arbeiten. Ändern Sie diese im Setup - Display.
ErrorTopMenuMustHaveAParentWithId0=Ein Menü vom Typ 'Top' kann nicht sein, Eltern-Menü. Put 0 in Stamm-Menü oder wählen Sie ein Menü vom Typ 'Links'.
ErrorLeftMenuMustHaveAParentId=Ein Menü vom Typ 'Linke' muss ein Elternteil id.
-ErrorGenbarCodeNotfound=Datei nicht gefunden (Bad Weg, falsche Berechtigungen oder der Zugriff wurde verweigert, indem openbasedir-Parameter)
+ErrorFileNotFound=Datei nicht gefunden (Bad Weg, falsche Berechtigungen oder der Zugriff wurde verweigert, indem openbasedir-Parameter)
ErrorFunctionNotAvailableInPHP=Funktion% s ist für diese Funktion ist aber nicht in dieser Version / Konfiguration von PHP.
ErrorDirAlreadyExists=Ein Verzeichnis mit diesem Namen ist bereits vorhanden.
ErrorFieldCanNotContainSpecialCharacters=Feld% s ist nicht Sonderzeichen.
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index de41df9468a..2dfaee4c4ef 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1108,4 +1108,11 @@ FreeLegalTextOnChequeReceipts=Free text on cheque receipts
##### Multicompany #####
MultiCompanySetup=Multi-company module setup
##### Suppliers #####
-SuppliersSetup=Supplier module setup
\ No newline at end of file
+SuppliersSetup=Supplier module setup
+##### GeoIPMaxmind #####
+GeoIPMaxmindSetup=GeoIP Maxmind module setup
+PathToGeoIPMaxmindCountryDataFile=Path to file containing Maxmind ip to country translation. Example: /usr/local/share/GeoIP/GeoIP.dat
+NoteOnPathLocation=Note that your ip to country data file must be inside a directory your PHP can read (Check your PHP open_basedir setup and filesystem permissions).
+YouCanDownloadFreeDatFileTo=You can download a free demo version of the Maxmind GeoIP country file at %s.
+YouCanDownloadAdvancedDatFileTo=You can also download a more complete version, with updates, of the Maxmind GeoIP country file at %s.
+TestGeoIPResult=Test of a conversion IP -> country
\ No newline at end of file
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 3966cfae4cb..b74c1544a64 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -32,7 +32,7 @@ ErrorNoMailDefinedForThisUser=No mail defined for this user
ErrorFeatureNeedJavascript=This feature need javascript to be activated to work. Change this in setup - display.
ErrorTopMenuMustHaveAParentWithId0=A menu of type 'Top' can't have a parent menu. Put 0 in parent menu or choose a menu of type 'Left'.
ErrorLeftMenuMustHaveAParentId=A menu of type 'Left' must have a parent id.
-ErrorGenbarCodeNotfound=File not found (Bad path, wrong permissions or access denied by openbasedir parameter)
+ErrorFileNotFound=File %s not found (Bad path, wrong permissions or access denied by PHP openbasedir or safe_mode parameter)
ErrorFunctionNotAvailableInPHP=Function %s is required for this feature but is not available in this version/setup of PHP.
ErrorDirAlreadyExists=A directory with this name already exists.
ErrorFieldCanNotContainSpecialCharacters=Field %s must not contains special characters.
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 34836c9112a..9c2988c1ab3 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -539,6 +539,7 @@ WarningYouAreInMaintenanceMode=Warning, you are in a maintenance mode, so only l
CreditCard=Credit card
FieldsWithAreMandatory=Fields with %s are mandatory
FieldsWithIsForPublic=Fields with %s are shown on public list of members. If you don't want this, check the "public" box.
+AccordingToGeoIPDatabase=(according to GeoIP convertion)
# Week day
Day1=Monday
diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang
index f681110831a..2ebf42aa30c 100644
--- a/htdocs/langs/es_ES/errors.lang
+++ b/htdocs/langs/es_ES/errors.lang
@@ -33,7 +33,7 @@ ErrorNoMailDefinedForThisUser = E-Mail no definido para este usuario
ErrorFeatureNeedJavascript = Esta funcionalidad precisa de javascript activo para funcionar. Modifique en configuración->entorno.
ErrorTopMenuMustHaveAParentWithId0 = Un menú del tipo 'Superior' no puede tener un menú padre. Ponga 0 en el ID padre o busque un menu del tipo 'Izquierdo'
ErrorLeftMenuMustHaveAParentId = Un menú del tipo 'Izquierdo' debe de tener un ID de padre
-ErrorGenbarCodeNotfound = Archivo no encontrado (ruta incorrecta, permisos incorrectos o acceso prohibido por el parámetro openbasedir)
+ErrorFileNotFound = Archivo %s no encontrado (ruta incorrecta, permisos incorrectos o acceso prohibido por el parámetro openbasedir)
ErrorFunctionNotAvailableInPHP = La función %s es requerida por esta funcionalidad, pero no se encuetra disponible en esta versión/instalación de PHP.
ErrorDirAlreadyExists = Ya existe una carpeta con ese nombre.
ErrorFieldCanNotContainSpecialCharacters = El campo %s no debe contener carácteres especiales
diff --git a/htdocs/langs/fi_FI/errors.lang b/htdocs/langs/fi_FI/errors.lang
index 516c425e306..41956d3cc9b 100644
--- a/htdocs/langs/fi_FI/errors.lang
+++ b/htdocs/langs/fi_FI/errors.lang
@@ -38,7 +38,7 @@ ErrorNoMailDefinedForThisUser=Ei postia määritelty tälle käyttäjälle
ErrorFeatureNeedJavascript=Tätä ominaisuutta tarvitaan JavaScript on aktivoitu työstä. Muuta tämän setup - näyttö.
ErrorTopMenuMustHaveAParentWithId0=A-valikosta tyyppi "Alkuun" ei voi olla emo-valikosta. Laita 0 vanhemman valikosta tai valita valikosta tyyppi "vasemmisto".
ErrorLeftMenuMustHaveAParentId=A-valikosta tyyppi "vasemmisto" on oltava vanhemman id.
-ErrorGenbarCodeNotfound=Tiedostoa ei löydy (Bad polku väärä oikeudet tai pääsy evätty openbasedir parametri)
+ErrorFileNotFound=Tiedostoa ei löydy (Bad polku väärä oikeudet tai pääsy evätty openbasedir parametri)
ErrorFunctionNotAvailableInPHP=Tehtävä% s tarvitaan tätä ominaisuutta, mutta ei ole käytettävissä tässä versiossa / setup PHP.
ErrorDirAlreadyExists=A-hakemisto on jo olemassa.
ErrorFieldCanNotContainSpecialCharacters=Kenttä% s ei saa sisältää erikoismerkkejä.
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 82549e6a283..560481448cc 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -1107,4 +1107,11 @@ FreeLegalTextOnChequeReceipts=Mention complémentaire sur les bordereaux de remi
##### Multicompany #####
MultiCompanySetup=Configuration du module Multi-société
##### Suppliers #####
-SuppliersSetup=Configuration du module Fournisseurs
\ No newline at end of file
+SuppliersSetup=Configuration du module Fournisseurs
+##### GeoIPMaxmind #####
+GeoIPMaxmindSetup=Configuration du module GeoIP Maxmind
+PathToGeoIPMaxmindCountryDataFile=Chemin du fichier Maxmind contenant les conversions IP->Pays. Exemple: /usr/local/share/GeoIP/GeoIP.dat
+NoteOnPathLocation=Notez que ce fichier doit etre dans un répertoire accessible à votre PHP (Vérifiez le paramètre open_basedir de votre PHP et les permissions du fichier/répertoires).
+YouCanDownloadFreeDatFileTo=Vous pouvez téléchargez une version demo gratuite de la base Maxmind à l'adresse %s.
+YouCanDownloadAdvancedDatFileTo=Vous pouvez aussi télécharger une version plus complète avec mise à jours de la base Maxmind à l'adresse %s.
+TestGeoIPResult=Test de conversion IP -> Pays
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang
index 1ae1c3d378b..b85bf0c77ae 100644
--- a/htdocs/langs/fr_FR/errors.lang
+++ b/htdocs/langs/fr_FR/errors.lang
@@ -33,7 +33,7 @@ ErrorNoMailDefinedForThisUser=EMail non defini pour cet utilisateur
ErrorFeatureNeedJavascript=Cette fonctionnalité a besoin de javascript activé pour fonctionner. Modifier dans configuration - affichage.
ErrorTopMenuMustHaveAParentWithId0=Un menu de type 'Top' ne peut avoir de menu père. Mettre 0 dans l'id père ou choisir un menu de type 'Left'.
ErrorLeftMenuMustHaveAParentId=Un menu de type 'Left' doit avoir un id de père.
-ErrorGenbarCodeNotfound=Fichier introuvable (Mauvais chemin, permissions incorrectes ou accès interdit par le paramètre openbasedir)
+ErrorFileNotFound=Fichier %s introuvable (Mauvais chemin, permissions incorrectes ou accès interdit par le paramètre PHP openbasedir ou safe_mode)
ErrorFunctionNotAvailableInPHP=La fonction %s est requise pour cette fonctionnalité mais n'est pas disponible dans cette version/installation de PHP.
ErrorDirAlreadyExists=Un répertoire portant ce nom existe déjà.
ErrorFieldCanNotContainSpecialCharacters=Le champ %s ne peut contenir de caractères spéciaux.
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index f3be801a66e..1ab2d47b6c6 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -538,6 +538,7 @@ WarningYouAreInMaintenanceMode=Attention, vous êtes en mode maintenance, aussi
CreditCard=Carte de crédit
FieldsWithAreMandatory=Les champs marqués par un %s sont obligatoires
FieldsWithIsForPublic=Les champs marqués par %s seront affiches sur la liste publique des membres. Si vous ne le souhaitez pas, décochez la case "public".
+AccordingToGeoIPDatabase=(obtenu par conversion GeoIP)
# Week day
Day1=Lundi
diff --git a/htdocs/langs/it_IT/errors.lang b/htdocs/langs/it_IT/errors.lang
index 5c1468f52f6..57d6f711fc2 100644
--- a/htdocs/langs/it_IT/errors.lang
+++ b/htdocs/langs/it_IT/errors.lang
@@ -27,7 +27,7 @@ ErrorNoMailDefinedForThisUser =Nessun messaggio definito per questo utente
ErrorFeatureNeedJavascript =Questa funzione javascript necessita di essere attivata al lavoro. Modificare questa impostazione in - visualizzazione.
ErrorTopMenuMustHaveAParentWithId0 =Un menu di tipo 'Top' non può avere un menu principale. Metti 0 menu genitori o scegliere un menu di tipo 'sinistra'.
ErrorLeftMenuMustHaveAParentId =Un menu di tipo 'rimasto' necessario disporre di un id genitore .
-ErrorGenbarCodeNotfound =File non trovato (Bad percorso sbagliato autorizzazioni o accesso negato da openbasedir parametro)
+ErrorFileNotFound =File non trovato (Bad percorso sbagliato autorizzazioni o accesso negato da openbasedir parametro)
ErrorFunctionNotAvailableInPHP =Funzione %s è necessario per questa funzione, ma non è disponibile in questa versione / configurazione di PHP.
ErrorDirAlreadyExists =Una directory con questo nome esiste già.
WarningAllowUrlFopenMustBeOn =Parametro allow_url_fopen deve essere impostato su su nel filer php.ini per avere questo modulo di lavoro completamente. È necessario modificare questo file manualmente.
diff --git a/htdocs/langs/nb_NO/errors.lang b/htdocs/langs/nb_NO/errors.lang
index ed60f1b54c2..9444ad89efd 100644
--- a/htdocs/langs/nb_NO/errors.lang
+++ b/htdocs/langs/nb_NO/errors.lang
@@ -28,7 +28,7 @@ ErrorNoMailDefinedForThisUser=Ingen e-post angitt for denne brukeren.
ErrorFeatureNeedJavascript=Denne funksjonen krever javascript for å virke. Endre dette i innstillinger - visning.
ErrorTopMenuMustHaveAParentWithId0=En meny av typen 'Topp' kan ikke ha noen foreldremeny. Skriv 0 i foreldremeny eller velg menytypen 'Venstre'.
ErrorLeftMenuMustHaveAParentId=En meny av typen 'Venstre' må ha foreldre-ID.
-ErrorGenbarCodeNotfound=Fant ikke filen (Feil sti, feil tillatelser eller access denied av openbasedir-parameter)
+ErrorFileNotFound=Fant ikke filen (Feil sti, feil tillatelser eller access denied av openbasedir-parameter)
ErrorFunctionNotAvailableInPHP=Funksjonen %s kreves for denne funksjonen, men den er ikke tilgjengelig i denne versjonen/oppsettet av PHP.
ErrorDirAlreadyExists=En mappe med dette navnet eksisterer allerede.
ErrorFieldCanNotContainSpecialCharacters=Feltet %s kan ikke inneholde spesialtegn.
diff --git a/htdocs/langs/nl_BE/errors.lang b/htdocs/langs/nl_BE/errors.lang
index 32df484788e..fa2231fb7ad 100644
--- a/htdocs/langs/nl_BE/errors.lang
+++ b/htdocs/langs/nl_BE/errors.lang
@@ -30,7 +30,7 @@ ErrorNoMailDefinedForThisUser=Geen mail gedefinieerd voor deze gebruiker
ErrorFeatureNeedJavascript=Javascript moet geactiveerd zijn voor deze functie. Verander dit in de setup - display.
ErrorTopMenuMustHaveAParentWithId0=A menu of type 'Top' can't have a parent menu. Put 0 in parent menu or choose a menu of type 'Left'.
ErrorLeftMenuMustHaveAParentId=A menu of type 'Left' must have a parent id.
-ErrorGenbarCodeNotfound=Bestand niet gevonden (Slecht pad, verkeerde permissies of toegang geweigerd door openbasedir parameter)
+ErrorFileNotFound=Bestand niet gevonden (Slecht pad, verkeerde permissies of toegang geweigerd door openbasedir parameter)
ErrorFunctionNotAvailableInPHP=Functie %s is vereist voor deze toepassing, maar is niet beschikbaar in deze versie / setup van PHP.
ErrorDirAlreadyExists=Een map met deze naam bestaat al.
ErrorFieldCanNotContainSpecialCharacters=Veld %s mag geen speciale tekens bevat.
diff --git a/htdocs/langs/nl_NL/errors.lang b/htdocs/langs/nl_NL/errors.lang
index 5d774d9113a..a403bcb6534 100644
--- a/htdocs/langs/nl_NL/errors.lang
+++ b/htdocs/langs/nl_NL/errors.lang
@@ -40,7 +40,7 @@ ErrorNoMailDefinedForThisUser=No mail gedefinieerd voor deze gebruiker
ErrorFeatureNeedJavascript=Deze functie moet javascript geactiveerd te werken. Verander dit in de setup - display.
ErrorTopMenuMustHaveAParentWithId0=Een menu van het type 'Top' kan niet beschikken over een ouder menu. Leg 0 bij de ouders menu of kiezen uit een menu van het type 'Links'.
ErrorLeftMenuMustHaveAParentId=Een menu van het type 'links' moeten een ouder id.
-ErrorGenbarCodeNotfound=Bestand niet gevonden (Bad pad, verkeerde permissies of toegang geweigerd door openbasedir parameter)
+ErrorFileNotFound=Bestand niet gevonden (Bad pad, verkeerde permissies of toegang geweigerd door openbasedir parameter)
ErrorFunctionNotAvailableInPHP=Functie% s is vereist voor deze functie, maar is niet beschikbaar in deze versie / setup van PHP.
ErrorDirAlreadyExists=Een map met deze naam al bestaat.
ErrorFieldCanNotContainSpecialCharacters=Veld% s mag geen speciale tekens bevat.
diff --git a/htdocs/langs/pl_PL/errors.lang b/htdocs/langs/pl_PL/errors.lang
index eb2d1359958..eb890e64f5e 100644
--- a/htdocs/langs/pl_PL/errors.lang
+++ b/htdocs/langs/pl_PL/errors.lang
@@ -40,7 +40,7 @@ ErrorNoMailDefinedForThisUser=Nie określono mail do tego użytkownika
ErrorFeatureNeedJavascript=Ta funkcja JavaScript trzeba być aktywowany do pracy. Zmień to w konfiguracji - wyświetlacz.
ErrorTopMenuMustHaveAParentWithId0=Menu typu "góry" nie może mieć dominującej menu. Umieść 0 dominującej w menu lub wybrać z menu typu "Lewy".
ErrorLeftMenuMustHaveAParentId=Menu typu "Lewy" musi mieć identyfikator rodzica.
-ErrorGenbarCodeNotfound=Nie znaleziono pliku (Złe drogi, złe uprawnienia lub odmowa dostępu przez openbasedir parametr)
+ErrorFileNotFound=Nie znaleziono pliku (Złe drogi, złe uprawnienia lub odmowa dostępu przez openbasedir parametr)
ErrorFunctionNotAvailableInPHP=Funkcja% s jest wymagane dla tej funkcji, ale nie jest dostępny w tej wersji / konfiguracji PHP.
ErrorDirAlreadyExists=A katalog o takiej nazwie już istnieje.
ErrorFieldCanNotContainSpecialCharacters=Pole% s nie zawiera znaki specjalne.
diff --git a/htdocs/langs/pt_BR/errors.lang b/htdocs/langs/pt_BR/errors.lang
index 147d9977c7e..305f11f8788 100644
--- a/htdocs/langs/pt_BR/errors.lang
+++ b/htdocs/langs/pt_BR/errors.lang
@@ -32,7 +32,7 @@ ErrorNoMailDefinedForThisUser=E-Mail não definido para este usuário
ErrorFeatureNeedJavascript=Esta Funcionalidade precisa de javascript ativo para funcionar. Modifique em configuração->entorno.
ErrorTopMenuMustHaveAParentWithId0=um menu do tipo 'Superior' não pode ter um menu pai. Coloque 0 ao ID pai o busque um menu do tipo 'esquerdo'
ErrorLeftMenuMustHaveAParentId=um menu do tipo 'esquerdo' deve de ter um ID de pai
-ErrorGenbarCodeNotfound=Arquivo não encontrado (Rota incorreta, permissões incorretos o acesso prohibido por o parâmetro openbasedir)
+ErrorFileNotFound=Arquivo não encontrado (Rota incorreta, permissões incorretos o acesso prohibido por o parâmetro openbasedir)
ErrorFunctionNotAvailableInPHP=a função %s é requerida por esta Funcionalidade, mas não se encuetra disponível nesta Versão/Instalação de PHP.
ErrorDirAlreadyExists=já existe uma pasta com ese Nome.
ErrorFieldCanNotContainSpecialCharacters=o campo %s não deve contener caracter0es especiais
diff --git a/htdocs/langs/pt_PT/errors.lang b/htdocs/langs/pt_PT/errors.lang
index 1e3155c1fc7..f22c27d234f 100644
--- a/htdocs/langs/pt_PT/errors.lang
+++ b/htdocs/langs/pt_PT/errors.lang
@@ -31,7 +31,7 @@ ErrorNoMailDefinedForThisUser=E-Mail não definido para este utilizador
ErrorFeatureNeedJavascript=Esta Funcionalidade precisa de javascript activo para funcionar. Modifique em configuração->entorno.
ErrorTopMenuMustHaveAParentWithId0=um menu do tipo 'Superior' não pode ter um menu pai. Coloque 0 ao ID pai o busque um menu do tipo 'esquerdo'
ErrorLeftMenuMustHaveAParentId=um menu do tipo 'esquerdo' deve de ter um ID de pai
-ErrorGenbarCodeNotfound=Ficheiro não encontrado (Rota incorrecta, permissões incorrectos o acesso prohibido por o parâmetro openbasedir)
+ErrorFileNotFound=Ficheiro não encontrado (Rota incorrecta, permissões incorrectos o acesso prohibido por o parâmetro openbasedir)
ErrorFunctionNotAvailableInPHP=a função %s é requerida por esta Funcionalidade, mas não se encuetra disponivel em esta Versão/Instalação de PHP.
ErrorDirAlreadyExists=já existe uma pasta com ese Nome.
ErrorFieldCanNotContainSpecialCharacters=o campo %s não deve contener carácteres especiais
diff --git a/htdocs/langs/ro_RO/errors.lang b/htdocs/langs/ro_RO/errors.lang
index 4d9cd3b179c..3c7501bb7b9 100644
--- a/htdocs/langs/ro_RO/errors.lang
+++ b/htdocs/langs/ro_RO/errors.lang
@@ -38,7 +38,7 @@ ErrorNoMailDefinedForThisUser=Nu mail definite pentru acest utilizator
ErrorFeatureNeedJavascript=Această caracteristică JavaScript trebuie activat pentru a fi la locul de muncă. Schimbare în acest setup - display.
ErrorTopMenuMustHaveAParentWithId0=Un meniu de tip "Top" nu poate avea un părinte de meniu. Pune-0 în meniul părinte sau alege un meniu de tip "stânga".
ErrorLeftMenuMustHaveAParentId=Un meniu de tip "stânga" trebuie să aibă o mamă id.
-ErrorGenbarCodeNotfound=Fişierul nu a fost găsit (Bad calea, greşit permisiunile de acces refuzat sau de openbasedir parametru)
+ErrorFileNotFound=Fişierul nu a fost găsit (Bad calea, greşit permisiunile de acces refuzat sau de openbasedir parametru)
ErrorFunctionNotAvailableInPHP=Funcţia% s este necesar pentru această funcţie, dar nu este disponibil în această versiune / setup de PHP.
ErrorDirAlreadyExists=Un director cu acest nume există deja.
ErrorFieldCanNotContainSpecialCharacters=Câmp% s trebuie să nu conţine caractere speciale.
diff --git a/htdocs/langs/ru_RU/errors.lang b/htdocs/langs/ru_RU/errors.lang
index 05fbec2c91f..24cf853ecf4 100644
--- a/htdocs/langs/ru_RU/errors.lang
+++ b/htdocs/langs/ru_RU/errors.lang
@@ -38,7 +38,7 @@ ErrorNoMailDefinedForThisUser=Нет почты определить для эт
ErrorFeatureNeedJavascript=Эта функция JavaScript должны быть активированы на работу. Изменить это в настройки - дисплей.
ErrorTopMenuMustHaveAParentWithId0=Меню типа 'Top' не может быть родителем меню. Положить 0 родителей в меню или выбрать меню типа 'левых'.
ErrorLeftMenuMustHaveAParentId=Меню типа 'левых' должен иметь родителя ID.
-ErrorGenbarCodeNotfound=Файл не найден (Неверный путь, неправильное или разрешения доступа отказано openbasedir параметр)
+ErrorFileNotFound=Файл не найден (Неверный путь, неправильное или разрешения доступа отказано openbasedir параметр)
ErrorFunctionNotAvailableInPHP=Функция% S необходим для этой функции, но не доступен в этой версии / настройки PHP.
ErrorDirAlreadyExists=Каталог с таким именем уже существует.
ErrorFieldCanNotContainSpecialCharacters=Поле% S не содержит специальных символов.
diff --git a/htdocs/lib/dolgeoip.class.php b/htdocs/lib/dolgeoip.class.php
index 64f9cba797e..5b27bd0a9e0 100644
--- a/htdocs/lib/dolgeoip.class.php
+++ b/htdocs/lib/dolgeoip.class.php
@@ -71,7 +71,8 @@ class DolGeoIP
}
/**
- * Return in lower cas the country code
+ * Return in lower case the country code from an ip
+ *
* @param $ip IP to scan
* @return string Country code (two letters)
*/
@@ -84,19 +85,35 @@ class DolGeoIP
return strtolower(geoip_country_code_by_addr($this->gi, $ip));
}
- function getCountryCodeFromName($ip)
+ /**
+ * Return in lower case the country code from a host name
+ *
+ * @param $name FQN of host (example: myserver.xyz.com)
+ * @return string Country code (two letters)
+ */
+ function getCountryCodeFromName($name)
{
if (empty($this->gi))
{
return '';
}
- return geoip_country_code_by_name($this->gi, $ip);
+ return geoip_country_code_by_name($this->gi, $name);
}
+ /**
+ * Return verion of data file
+ */
+ function getVersion()
+ {
+ return '';
+ }
+
+ /**
+ * Close geoip object
+ */
function close()
{
geoip_close($this->gi);
}
-
}
?>
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index 11f3ccc581a..7e495054b0d 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -860,12 +860,21 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ=
return $newphone;
}
-function dol_print_ip($ip)
+/**
+ * \brief Return an IP formated to be shown on screen
+ * \param ip IP
+ * \param mode 1=return only country/flag,2=return only IP
+ * \return string Formated IP, with country if GeoIP module is enabled
+ */
+function dol_print_ip($ip,$mode=0)
{
global $conf,$langs;
- print $ip;
- if (! empty($conf->geoipmaxmind->enabled))
+ $ret='';
+
+ if (empty($mode)) $ret.=$ip;
+
+ if (! empty($conf->geoipmaxmind->enabled) && $mode != 2)
{
$datafile=$conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE;
//$ip='24.24.24.24';
@@ -878,11 +887,13 @@ function dol_print_ip($ip)
{
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/common/flags/'.$countrycode.'.png'))
{
- print ' '.img_picto($langs->trans("AccordingToGeoIPDatabase"),DOL_URL_ROOT.'/theme/common/flags/'.$countrycode.'.png','',1);
+ $ret.=' '.img_picto($countrycode.' '.$langs->trans("AccordingToGeoIPDatabase"),DOL_URL_ROOT.'/theme/common/flags/'.$countrycode.'.png','',1);
}
- else print ' ('.$countrycode.')';
+ else $ret.=' ('.$countrycode.')';
}
}
+
+ return $ret;
}
/**