diff --git a/htdocs/admin/system/web.php b/htdocs/admin/system/web.php
index 4cb4ea4a653..6d237bdfff1 100644
--- a/htdocs/admin/system/web.php
+++ b/htdocs/admin/system/web.php
@@ -22,6 +22,7 @@
require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
+require_once(DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php');
$langs->load("admin");
@@ -62,5 +63,5 @@ print '';
llxFooter();
-$db->close('');
+$db->close();
?>
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index b5843af4b3f..4bb630d685b 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -21,19 +21,6 @@
* \brief Library for file managing functions
*/
-/**
- * Return user/group account of web server
- *
- * @param string $mode 'user' or 'group'
- * @return string Return user or group of web server
- */
-function dol_getwebuser($mode)
-{
- $t='?';
- if ($mode=='user') $t=getenv('APACHE_RUN_USER'); // $_ENV['APACHE_RUN_USER'] is empty
- if ($mode=='group') $t=getenv('APACHE_RUN_GROUP');
- return $t;
-}
/**
* Scan a directory and return a list of files/directories.
diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index 803245a5a84..c6d7863e83d 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -26,6 +26,20 @@
*/
+/**
+ * Return user/group account of web server
+ *
+ * @param string $mode 'user' or 'group'
+ * @return string Return user or group of web server
+ */
+function dol_getwebuser($mode)
+{
+ $t='?';
+ if ($mode=='user') $t=getenv('APACHE_RUN_USER'); // $_ENV['APACHE_RUN_USER'] is empty
+ if ($mode=='group') $t=getenv('APACHE_RUN_GROUP');
+ return $t;
+}
+
/**
* Return a login if login/pass was successfull
*
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 65a342bf83a..f7451cfc506 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -102,6 +102,7 @@ ErrorLoginDoesNotExists=User with login %s could not be found.
ErrorLoginHasNoEmail=This user has no email address. Process aborted.
ErrorBadValueForCode=Bad value for security code. Try again with new value...
ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative
+ErrorWebServerUserHasNotPermission=User account %s used to execute web server has no permission for that
# Warnings
WarningSafeModeOnCheckExecDir=Warning, PHP option safe_mode is on so command must be stored inside a directory declared by php parameter safe_mode_exec_dir.
diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang
index 870589c8322..3d6cb1bf4dc 100644
--- a/htdocs/langs/fr_FR/errors.lang
+++ b/htdocs/langs/fr_FR/errors.lang
@@ -103,6 +103,7 @@ ErrorLoginDoesNotExists=Le compte utilisateur de login %s n'a pu être tr
ErrorLoginHasNoEmail=Cet utilisateur n'a pas d'email. Impossible de continuer.
ErrorBadValueForCode=Mauvaise valeur saisie pour le code. Réessayez avec une nouvelle valeur...
ErrorBothFieldCantBeNegative=Les champs %s et %s ne peuvent être tous deux négatifs
+ErrorWebServerUserHasNotPermission=Le compte d'execution du serveur web %s n'a pas les permissions pour cela
# Warnings
WarningSafeModeOnCheckExecDir=Attention, l'option PHP safe_mode est active, la commande doit dont être dans un répertoire déclaré dans le paramètre php safe_mode_exec_dir.