diff --git a/ChangeLog b/ChangeLog
index 084246050cd..0da3052021d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,7 +29,8 @@ For users:
or credit note invoice.
- New: task #10885: Add a week view for calendar
- New: task #11018 : Add a status "not applicable" on event
-- New: Add region/country statistics for member module.
+- New: Add region/country statistics for member module.
+- New: Can define a proxy for external web access.
- Fix: Better Postgresql compatibility.
For developers:
diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php
new file mode 100755
index 00000000000..0f8724e965c
--- /dev/null
+++ b/htdocs/admin/proxy.php
@@ -0,0 +1,161 @@
+
+ *
+ * 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/proxyto.php
+ * \ingroup core
+ * \brief Page setup proxy to use for external web access
+ * \version $Id$
+ */
+
+require("../main.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
+
+$langs->load("users");
+$langs->load("admin");
+$langs->load("other");
+
+
+if (!$user->admin) accessforbidden();
+
+$upload_dir=$conf->admin->dir_temp;
+
+
+/*
+ * Actions
+ */
+
+if (GETPOST("action") == 'set_proxy')
+{
+ $result=0;
+ $result+=dolibarr_set_const($db, 'MAIN_PROXY_USE', $_POST["MAIN_PROXY_USE"], 'chaine',0,'',$conf->entity);
+ $result+=dolibarr_set_const($db, 'MAIN_PROXY_HOST',$_POST["MAIN_PROXY_HOST"],'chaine',0,'',$conf->entity);
+ $result+=dolibarr_set_const($db, 'MAIN_PROXY_PORT',$_POST["MAIN_PROXY_PORT"],'chaine',0,'',$conf->entity);
+ $result+=dolibarr_set_const($db, 'MAIN_PROXY_USER',$_POST["MAIN_PROXY_USER"],'chaine',0,'',$conf->entity);
+ $result+=dolibarr_set_const($db, 'MAIN_PROXY_PASS',$_POST["MAIN_PROXY_PASS"],'chaine',0,'',$conf->entity);
+ if ($result < 5)
+ {
+ dol_print_error($db);
+ }
+ else
+ {
+ $mesg='
';
print '';
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index b85ee31aa45..e7bec2e41b5 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -819,6 +819,12 @@ SomeTranslationAreUncomplete=Some languages may be partially translated or may c
MenuUseLayout=Make vertical menu hidable (option javascript must not be disabled)
MAIN_DISABLE_METEO=Disable meteo view
TestLoginToAPI=Test login to API
+ProxyDesc=Some features of Dolibarr need to have an Internet access to work. If the Dolibarr server is behind a Proxy server, those parameters tells Dolibarr how to access Internet through it.
+MAIN_PROXY_USE=Use a proxy server
+MAIN_PROXY_HOST=Name/Address of proxy server
+MAIN_PROXY_PORT=Port of proxy server
+MAIN_PROXY_USER=Login to use the proxy server
+MAIN_PROXY_PASS=Password to use the proxy server
##### Module password generation
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 4f31368d7f1..1c88b3c68a7 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -829,7 +829,12 @@ SomeTranslationAreUncomplete=Certaines langues sont traduites partiellement ou p
MenuUseLayout=Rendre le menu gauche cachable (L'option javascript ne doit pas avoir été désactivée)
MAIN_DISABLE_METEO=Désactiver la vue météo
TestLoginToAPI=Tester connexion à l'API
-
+ProxyDesc=Certaines fonction de Dolibarr nécessite que le serveur ait accès à internet. Si le serveur Dolibarr est derrière un proxy, ces paramètres indiquent à Dolibarr comment le traverser.
+MAIN_PROXY_USE=Utiliser un serveur proxy mandataire
+MAIN_PROXY_HOST=Nom/Adresse du serveur proxy mandataire
+MAIN_PROXY_PORT=Port du serveur proxy mandataire
+MAIN_PROXY_USER=Login pour passer le serveur proxy mandataire
+MAIN_PROXY_PASS=Mot de passe pour passer le serveur proxy mandataire
##### Module password generation= undefined
PasswordGenerationStandard= Renvoie un mot de passe généré selon algorithme interne Dolibarr: 8 caractères, chiffres et caractères en minuscules mélangés.
PasswordGenerationNone= Ne propose pas de mots de passe générés. Le mot de passe est à saisir manuellement.
diff --git a/htdocs/lib/admin.lib.php b/htdocs/lib/admin.lib.php
index bce9b2c1b97..282e0c2c3d2 100644
--- a/htdocs/lib/admin.lib.php
+++ b/htdocs/lib/admin.lib.php
@@ -220,7 +220,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='')
// Ajout trace sur requete (eventuellement a commenter si beaucoup de requetes)
if (! $silent) print '