diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index d88d9a0facb..f82b4eb6d26 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -752,7 +752,6 @@ class Adherent extends CommonObject // If new password not provided, we generate one if (! $password) { - include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); $password=getRandomPassword(''); } @@ -1389,8 +1388,6 @@ class Adherent extends CommonObject */ function add_to_spip() { - require_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); - dol_syslog(get_class($this)."::add_to_spip"); if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 && diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 0529ee062d5..18d15e818d4 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -710,7 +710,6 @@ if ($action == 'create') // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); $generated_password=getRandomPassword(''); print ''.$langs->trans("Password").''; print ''; diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index 5dfde6a6ed4..87fc6990c40 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -25,7 +25,6 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); llxHeader(); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 8399c46a34b..01f1f7b714c 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -24,7 +24,6 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); $langs->load("users"); $langs->load("admin"); diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 234df487888..8397528f648 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -339,7 +339,6 @@ abstract class ActionsContactCardCommon $generated_password=''; if (! $ldap_sid) { - include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); $generated_password=getRandomPassword(''); } $password=$generated_password; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 6ae75394a7f..752d44b5e1d 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -760,7 +760,6 @@ else $generated_password=''; if (! $ldap_sid) // TODO ldap_sid ? { - include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); $generated_password=getRandomPassword(''); } $password=$generated_password; diff --git a/htdocs/core/ajaxsecurity.php b/htdocs/core/ajaxsecurity.php index 5757ca2ecf3..9cdf885734c 100644 --- a/htdocs/core/ajaxsecurity.php +++ b/htdocs/core/ajaxsecurity.php @@ -28,8 +28,6 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require('../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php"); - /* * View diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 8bcd41f2769..b2e043939f8 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -187,12 +187,11 @@ if (! file_exists(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php")) } include_once(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"); // Need 970ko memory (1.1 in 2.2) - +include_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php"); // Include by default // If password is encoded, we decode it if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass)) { - require_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php"); if (preg_match('/crypted:/i',$dolibarr_main_db_pass)) { $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php index 1bd4be0f9cb..5ddc040f6cc 100644 --- a/htdocs/lib/files.lib.php +++ b/htdocs/lib/files.lib.php @@ -519,7 +519,6 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable // If we need to make a virus scan if (empty($disablevirusscan) && file_exists($src_file) && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { - require_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/antivir.class.php'); $antivir=new AntiVir($db); $result = $antivir->dol_avscan_file($src_file); diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index c5f2144ce8c..7d6fc9f3fd1 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -92,7 +92,7 @@ function GETPOST($paramname,$check='',$method=0) */ function dol_getprefix() { - return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); + return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); } /** diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d3d8c9169a0..43d5dc40b8d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -354,7 +354,6 @@ if (! defined('NOLOGIN')) // Validation of login with a third party login module method if (is_array($conf->login_method_modules) && !empty($conf->login_method_modules)) { - include_once(DOL_DOCUMENT_ROOT . "/lib/security.lib.php"); $login = getLoginMethod(); if ($login) $test=false; } @@ -426,7 +425,6 @@ if (! defined('NOLOGIN')) if (! $login) { // We show login page - include_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php"); if (! is_object($langs)) // This can occurs when calling page with NOREQUIRETRAN defined { include_once(DOL_DOCUMENT_ROOT."/core/class/translate.class.php"); diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 3ee4c00f360..860cf5e3577 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -26,7 +26,6 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); $servicename='PayPal'; diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index a64017513c9..973e0955f92 100755 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -166,7 +166,6 @@ function paypaladmin_prepare_head() function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_free_tag') { global $conf; - require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php"); if ($type == 'free') { diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 1f896426b74..7715b98fedf 100755 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -31,7 +31,6 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php"); require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypalfunctions.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 00a70f7d66c..9903b55e162 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1238,7 +1238,6 @@ class User extends CommonObject // If new password not provided, we generate one if (! $password) { - include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); $password=getRandomPassword(''); } diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index b5cc814dacb..6fba9e1d660 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -631,7 +631,6 @@ if (($action == 'create') || ($action == 'adduserldap')) $generated_password=''; if (! $ldap_sid) { - include_once(DOL_DOCUMENT_ROOT.'/lib/security.lib.php'); $generated_password=getRandomPassword(''); } $password=$generated_password;